最近在学习杰理AC692X,将收获及遇到的一些问题写成博客,方便以后工作中使用
普通IO口的输入输出配置很简单,仿照led.c key_drv_io.c就可以完成IO的基本配置,需要注意的是要解决SDK默认配置冲突的问题,把冲突的IO口的其他地方配置直接屏蔽
#define LED_PORTX JL_PORTA
#define LED_BLUE BIT(3)
#define LED_RED BIT(2)
#define LED_INIT_EN() do{LED_PORTX->PU &= ~LED_BLUE;LED_PORTX->PD &= ~LED_BLUE;\
LED_PORTX->DIR &= ~LED_BLUE;LED_PORTX->PU &= ~LED_RED;\
LED_PORTX->PD &= ~LED_RED;LED_PORTX->DIR &= ~LED_RED;}while(0)
#define LED_INIT_DIS() do{LED_PORTX->PU &= ~LED_BLUE;LED_PORTX->PD &= ~LED_BLUE;\
LED_PORTX->DIR |= LED_BLUE;LED_PORTX->PU &= ~LED_RED;\
LED_PORTX->PD &= ~LED_RED;LED_PORTX->DIR |= LED_RED;}while(0)
#define B_LED_ON() do{LED_PORTX->OUT |= LED_BLUE;}while(0)
#define B_LED_OFF() do{LED_PORTX->OUT &= ~LED_BLUE;}while(0)
#define R_LED_ON() do{LED_PORTX-