Tool/software: Code Composer Studio
Hello all,
I've configured the BLED (Blue LED) on my board file BoardGpioInitTable[] like this:
const PIN_Config BoardGpioInitTable[] = { Board_GLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */ Board_BLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MIN, /* LED initially off */ Board_RLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */ Board_KEY1 | PIN_INPUT_EN | PIN_PULLUP | PIN_HYSTERESIS | PINCC26XX_WAKEUP_NEGEDGE, /* Button is active low */ Board_KEY2 | PIN_INPUT_EN | PIN_PULLUP | PIN_HYSTERESIS, /* Button is active low */ Board_SPI0_CSN | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL, /* CS pin at inactive level */ Board_ADC0 | PIN_INPUT_EN | PIN_PULLDOWN, /* ADC Enable */ Board_UART_TX | PIN_GPIO_OUTPUT_DIS | PIN_INPUT_EN | PIN_PULLUP, /* UART TX pin at inactive level */ Board_UART_RX | PIN_GPIO_OUTPUT_DIS | PIN_INPUT_EN | PIN_PULLUP, /* UART RX pin at inactive level */ PIN_TERMINATE
The BLED pin is defined like this:
//LEDs #define Board_LED_ON 0 /* LEDs on SaBLE-x EM board LEDs are active low */ #define Board_LED_OFF 1 #define Board_GLED IOID_14 #define Board_BLED IOID_7 #define Board_RLED IOID_4
In SimplePeripheral.c I want to simply turn on the BLED when advertising starts. So I tried to call GPIO_write(Board_BLED, Board_LED_ON) like this:
static void SimplePeripheral_processAppMsg(spEvt_t *pMsg) { bool dealloc = TRUE; switch (pMsg->event) { case SP_CHAR_CHANGE_EVT: SimplePeripheral_processCharValueChangeEvt(*(uint8_t*)(pMsg->pData)); break; case SP_KEY_CHANGE_EVT: SimplePeripheral_handleKeys(*(uint8_t*)(pMsg->pData)); break; case SP_ADV_EVT: GPIO_write(Board_BLED, Board_LED_ON); SimplePeripheral_processAdvEvent((spGapAdvEventData_t*)(pMsg->pData)); break;
Unfortunately the blue LED doesn't turn on. Am I doing something wrong? BTW if I change the state in the BoardGpioInitTable[] in the board file from low to high and vice versa I can change the state of the LED off->on / on->off.
Help please.
Patrick