在线时间2194 小时
UID3253523
注册时间2016-3-21
NXP金币1444
该用户从未签到
超级版主
 
- 积分
- 23839
- 最后登录
- 2025-4-18
|
发表于 2016-12-16 16:10:52
|
显示全部楼层
Setting the output value of four adjacent GPIO pinsThis example shows how to set the output value of four GPIO pins (e.g. a 4-bit wide data bus). A set of four adjacent pins is selected as a bit field, whose output value is configured by one method call with a bit field identifier as a parameter.
Required component setup of GPIO1:
Content of ProcessorExpert.c:
LDD_TDeviceData *MyGPIO1Ptr;
void main(void)
{ ...
MyGPIO1Ptr = GPIO1_Init((LDD_TUserData *)NULL); /* Initialize the pins */
GPIO1_SetFieldValue(MyGPIO1Ptr, Bus, 0b1100U); /* Configure the output value */
/* Output values: PTA12 = 0, PTA13 = 0, PTA14 = 1, PTA15 = 1 */
}
这个是GPIO_LDD的典型应用,你可以在help中找到。
|
|