I've got the proto board on hand now and I'm trying to get back into this SPI eval thing. The SPI device is attached to UEXT connector, and I had the LPC board displaying custom text via application_lcd.h's E_LCD_INITIALISED if statement.
I seem to be having some trouble figuring out this compiler. For example, in application_lcd.h, if I try to make the grey go away by commenting out the #if and matching #endif statements for this LCD section that includes code I know is being compiled, it will format correctly with green and blue, ect. However it won't compile. I get lots of syntax errors, and misc junk.
So I leave the define, statement, and the grey, and chock it to ignorance about why this is happening.
Then I copy most of spi_flash_lpc_atmel.h into applicaton_lcd.h below the if E_LCD_INITIALISED statement. Theory being that I can cut it down to something simple. My first goal is to simply read the status reg out of the AIS226 chip. I believe that's the same as the datasheet's noted STATUS_REG (0x27) which should read 0000. After a bit of chopping, I see SPI_FLASH_Danger which appears to be a first check before trying SPI stuff. I see it's defined in LPC23XX.c, however spi_flash_lpc_atmel.h file doesn't have an #include statement in the code. So I guess there must be some compiler config file that's allowing it to resolve when it's called in spi_flash_lpc_atmel.h. Another indicator that I don't understand how this compiler gets to point B. I tried to add an include file in my code just before it's called, but that really blew up. Again another indicator that I'm ignorant about this compile process.
So I try it another way. I copied spi_flash_lpc_atmel.h to spi_flash_lpc_AIS226.h in the same dir. Then started hacking out #define options I don't need. When I #include spi_flash_lpc_atmel.h in application_lcd.h, it compiles fine, but when I change that #include to spi_flash_lpc_AIS226.h, it produces a large pile of errors. It would appear that when I stripped out the define stuff, I took something important. It also looks like I can't declare things correctly. Line 5 is the first non-comment in the spi_flash_lpc_AIS226.h file, and looks like this.
static unsigned char fnCheckAIS226(void);
I get this error.
c:\utaskerv1.4_lpc\hardware\lpc23xx\spi_flash_lpc_ais226.h(5) : error C2143: syntax error : missing ';' before 'type'
It would appear to me that when it was behind the #define statement before, that changed the compile process, such that it could compile. However, I removed the #define's so it's broken.
So I should ask if using an #include statement in application_lcd.h is an appropriate method, or should I be calling fnSPI_command_AIS226 from spi_flash_lpc_AIS226.h a different way? If calling it that way is an OK theory of operation, how do I fix this syntax error?