surroundings
MAUI.11C.W13.52.SP3.V2
step
mode:
//参数0为GPIO模式,其它模式具体看这个IO所具有的功能
GPIO_ModeSetup(GPIO_PORT_0, 0)
You can view and configure the default mode in the dsw file:
Internal pull-up and pull-down:
//内部上拉
GPIO_PullenSetup(GPIO_PORT_0, KAL_TRUE);
GPIO_PullSelSetup(GPIO_PORT_0, KAL_TRUE);
//内部下拉
GPIO_PullenSetup(GPIO_PORT_0, KAL_TRUE);
GPIO_PullSelSetup(GPIO_PORT_0, KAL_FALSE);
Pull up and down:
//设置为输出
GPIO_InitIO(1,GPIO_PORT_0);
//GPIO上拉
GPIO_WriteIO(1, GPIO_PORT_0);
//GPIO下拉
GPIO_WriteIO(0, GPIO_PORT_0);
Status read:
char value;
//设置为输入
GPIO_InitIO(0,GPIO_PORT_0);
//读取
value = GPIO_ReadIO(GPIO_PORT_0);
dws configuration:
If you need to set the GPIO just simply configure it &