CC2640的LED配置
新手初次接触CC2640,欲配置LED。根据Software developer's guide的步骤,却不知应该在simpleBLEphripheral.c文件的什么位置添加这步骤2和3的代码?望指教。谢谢
2. Declare the pin configuration table and pin state / handle variables to be used by the
SimpleBLEPeripheral task:
static PIN_Config SBP_configTable[] =
{
Board_LED1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
Board_KEY_UP | PIN_INPUT_EN | PIN_PULLUP | PIN_HYSTERESIS,
PIN_TERMINATE
};
static PIN_State sbpPins;
static PIN_Handle hSbpPins;
3. Declare the ISR to be performed in the hwi context. Note that all this is doing is setting an
event in the application task and waking it up. This is done to minimize processing in the hwi
context.
static void buttonHwiFxn(PIN_Handle hPin, PIN_Id pinId)
{
// set event in SBP task to process outside of hwi context
events |= SBP_BTN_EVT;
// Wake up the application.
Semaphore_post(sem);
}
io口在main.c第一行初始化的,官方蓝牙有ble stack例程的
如手册所说,你可以参考TI 协议栈的simple_peripheral这个例程。无论是哪个板子【CC2650STK,CC2650EM等】都有相应例程