原来的程序是 LAUNCHXL -CC2640R2 现我从新编译 工程 为 5X5封装。但是发现IO口无法输出。
const PIN_Config BoardGpioInitTable[] = {
IOID_11 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
IOID_3 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
IOID_13 | PIN_INPUT_EN | PIN_PULLDOWN, /* UART RX via debugger back channel */
IOID_12 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL, /* UART TX via debugger back channel */
PIN_TERMINATE
};
IOID_11 是控制 LED的IO口。
在main函数调用
int main()
{
#if defined( USE_FPGA )
HWREG(PRCM_BASE + PRCM_O_PDCTL0) &= ~PRCM_PDCTL0_RFC_ON;
HWREG(PRCM_BASE + PRCM_O_PDCTL1) &= ~PRCM_PDCTL1_RFC_ON;
#endif // USE_FPGA
/* Register Application callback to trap asserts raised in the Stack */
RegisterAssertCback(AssertHandler);
PIN_init(BoardGpioInitTable);
//
PIN_Handle pin_handle;
PIN_State pin_state;
PIN_Config pin_config[] = {IOID_11};
pin_handle = PIN_open(&pin_state,pin_config);
PIN_setOutputValue(pin_handle,PIN_ID(11),1);
da qin zheng sheng:
首先确保5×5板子硬件可靠。
jasmes ce:
回复 da qin zheng sheng:
可靠的 好像是 PIN_open 返回NULL是怎么回事?
Viki Shi:
该代码有在7*7板子上测试过吗?