void appCommand(u8 method) { switch(method) { case 0x00: //select the TLC5940 interface, deselected on rising SEL in appReleaseBus() gIOState &= ~PINMASK_APP_TLC_nCS; break; case 0x10: //connect the timing pins GSCLK, BLANK and XLAT to P1, P3 and P5 respectively gIOState &= ~PINMASK_APP_TLC_nTIMING; break; case 0x11: //disconnect the timing pins GSCLK, BLANK and XLAT gIOState |= PINMASK_APP_TLC_nTIMING; break; case 0x85: //read test string SPISetupGXB(); u8 const* msg = "hello"; u8 i = 5; while(i-- && SPIExchangeGXB(*msg++)); SPIDisableGXB(); break; } }
void appCommand(u8 method) { switch(method) { case 0x10: //assert !reset on the Bluetooth module gIOState &= ~PINMASK_APP_nBT_RESET; break; case 0x11: //deassert !reset on the Bluetooth module gIOState |= PINMASK_APP_nBT_RESET; break; case 0x12: //connect the TXD/RXD pins to the Bluetooth module gIOState &= ~PINMASK_APP_nBT_SEL; break; case 0x13: //disconnect the TXD/RXD pins from the Bluetooth module gIOState |= PINMASK_APP_nBT_SEL; break; case 0x14: //LED on gIOState &= ~PINMASK_APP_nLED; case 0x15: //LED off gIOState |= PINMASK_APP_nLED; break; case 0x85: //read test string SPISetupGXB(); u8 const* msg = "hello"; u8 i = 5; while(i-- && SPIExchangeGXB(*msg++)); SPIDisableGXB(); break; } }
void appCommand(u8 method) { switch(method) { case 0x00: //enable the GPS module gIOState |= PINMASK_APP_GPS_ON; break; case 0x01: //disable the GPS module gIOState &= ~PINMASK_APP_GPS_ON; break; case 0x02: //read test string SPISetupGXB(); u8 const* msg = "hello"; u8 i = 5; while(i-- && SPIExchangeGXB(*msg++)); SPIDisableGXB(); break; case 0x10: //connect TXD/RXD to the GPS module gIOState &= ~PINMASK_APP_GPS_nEN; break; case 0x11: //disconnect TXD/RXD from the GPS module gIOState |= PINMASK_APP_GPS_nEN; break; case 0x20: //select the microSD card, deselected on rising SEL in appReleaseBus() gIOState &= ~PINMASK_APP_SD_nCS; break; } }