PIN_Config PressBtnTableWakeUp[] = {IOID_24 | PIN_INPUT_EN | PIN_NOPULL | PINCC26XX_WAKEUP_NEGEDGE,PIN_TERMINATE/* Terminate list */ }; static void Init_Led() {PIN_setOutputEnable(m_ledPinHandle, LED_RUN, 1);LED_RUN_OFF; } static void Init_CS() { PIN_setOutputEnable(m_cs1PinHandle, MCP_SPI0_CS, 1); } static void Init_Rst() { PIN_setOutputEnable(m_rstPinHandle, MCP_SPI0_RST, 1); } static void Init_MUX() { for (unsigned char i = 0; i < 4; i++) { PIN_setOutputEnable(m_enPinHandle[i], m_enPort[i], 1); PIN_setOutputValue(m_enPinHandle[i], m_enPort[i], 0); } } //LD_EN 低电平使能 void switchMux(unsigned char code) { unsigned char value = 0; if (code >= 4) return; for (unsigned char i = 0; i < 4; i++) { value = (code &(1 << i)) ? 1: 0; PIN_setOutputValue(m_enPinHandle[i], m_enPort[i], value); } } void DiableIOs() {SPI_close(0);closeUart();PIN_setConfig(m_cs1PinHandle,PIN_BM_DRVSTR, MCP_SPI0_CS| PIN_INPUT_EN | PIN_NOPULL );PIN_setConfig(m_cs1PinHandle,PIN_BM_DRVSTR, MCP_SPI0_MOSI| PIN_INPUT_EN | PIN_NOPULL );PIN_setConfig(m_cs1PinHandle,PIN_BM_DRVSTR, MCP_SPI0_MISO| PIN_INPUT_EN | PIN_NOPULL );PIN_setConfig(m_cs1PinHandle,PIN_BM_DRVSTR, MCP_SPI0_CLK| PIN_INPUT_EN | PIN_NOPULL );PIN_setConfig(m_cs1PinHandle,PIN_BM_DRVSTR, MCP_SPI0_DR| PIN_INPUT_EN | PIN_NOPULL );PIN_setConfig(m_cs1PinHandle,PIN_BM_DRVSTR, MCP_SPI0_RST| PIN_INPUT_EN | PIN_NOPULL );PIN_setConfig(m_enPinHandle[0],PIN_BM_DRVSTR, MUX_S0| PIN_INPUT_EN | PIN_NOPULL );PIN_setConfig(m_enPinHandle[1],PIN_BM_DRVSTR, MUX_S1| PIN_INPUT_EN | PIN_NOPULL );PIN_setConfig(m_enPinHandle[2],PIN_BM_DRVSTR, MUX_S2| PIN_INPUT_EN | PIN_NOPULL );PIN_setConfig(m_enPinHandle[3],PIN_BM_DRVSTR, MUX_S3| PIN_INPUT_EN | PIN_NOPULL );PIN_setConfig(m_ledPinHandle,PIN_BM_DRVSTR, LED_RUN| PIN_INPUT_EN | PIN_NOPULL );PIN_setConfig(m_ledPinHandle,PIN_BM_DRVSTR, DEBUG_RX| PIN_INPUT_EN | PIN_NOPULL );PIN_setConfig(m_ledPinHandle,PIN_BM_DRVSTR, DEBUG_TX| PIN_INPUT_EN | PIN_NOPULL );PINCC26XX_setWakeup(PressBtnTableWakeUp);Power_shutdown(NULL, 0); }
我是这样关机的,关机后,按开关没反应,开不了机,之前这样在2650下是好的。
IOID_24好像是ADC的通道,不太确定能否作为开机使用
YiKai Chen:
可以用IOID_24 作为shutdown 唤醒
Kevin Qiu1:
IOID_24可以设为模拟IO或数字IO,可以作为shutdown 唤醒
user1388075:
回复 Kevin Qiu1:
PIN_Config PressBtnTableWakeUp[] = { IOID24| PIN_INPUT_EN | PIN_NOPULL | PINCC26XX_WAKEUP_NEGEDGE, PIN_TERMINATE /* Terminate list */};
PINCC26XX_setWakeup(PressBtnTableWakeUp);
Power_shutdown(NULL, 0);
那奇怪了, 设置了wakeup 管脚的,为啥关机成功,开不了机呢
YiKai Chen:
回复 user1388075:
剛剛用pinshutdown 例程測試IO24當wakeup 管脚是可以的
user1388075:
回复 YiKai Chen:
嗯 我2650用的好好的。照着搬到2640R2F上就不对了,奇怪。
YiKai Chen:
回复 user1388075:
檢查一下你的程序有沒有把IO24拿去作其他用途