DSP2833X实验_点亮第一个LED_GPio结构
GPIO结构框图:
void LED_Init(void) { EALLOW; SysCtrlRegs.PCLKCR3.bit.GPIOINENCLK = 1;// 开启GPIO时钟 GpioCtrlRegs.GPBMUX2.bit.GPIO60 = 0; //设置为通用GPIO功能 GpioCtrlRegs.GPBDIR.bit.GPIO60 = 1; //设置GPIO方向为输出 GpioCtrlRegs.GPBPUD.bit.GPIO60 = 0; //使能GPIO上拉电阻 GpioDataRegs.GPBSET.bit.GPIO60 = 1;//默认输出高 EDIS; }
#define LED1_OFF (GpioDataRegs.GPCSET.bit.GPIO68=1) #define LED1_ON (GpioDataRegs.GPCCLEAR.bit.GPIO68=1) #define LED1_TOGGLE (GpioDataRegs.GPCTOGGLE.bit.GPIO68=1)