打印
[MCU]

MSP432有关GPIO的配置问题

[复制链接]
449|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
个人认为GPIO函数主要分两类一类是GPIO中断配置函数
主要有以下几个参数设置大同小异,selectedPort可选有
GPIO_PORT_P1
GPIO_PORT_P2
GPIO_PORT_PA
而selectedPins可选有
GPIO_PIN0
GPIO_PIN1
GPIO_PIN2
GPIO_PIN3
GPIO_PIN4
GPIO_PIN5
GPIO_PIN6
GPIO_PIN7
GPIO_PIN8
GPIO_PIN9
GPIO_PIN10
GPIO_PIN11
GPIO_PIN12
GPIO_PIN13
GPIO_PIN14
GPIO_PIN15
//GPIO中断标志位清除
void GPIO_clearInterruptFlag (uint_fast8_t selectedPort, uint_fast16_t selectedPins)
//GPIO边沿触发方式,edgeSelect有以下选择:GPIO_HIGH_TO_LOW_TRANSITION(下降沿触发)
GPIO_LOW_TO_HIGH_TRANSITION(上升沿触发)
void GPIO_interruptEdgeSelect (uint_fast8_t selectedPort, uint_fast16_t selectedPins,
uint_fast8_t edgeSelect)
//GPIO中断使能关闭
void GPIO_disableInterrupt (uint_fast8_t selectedPort, uint_fast16_t selectedPins)
//GPIO中断使能
void GPIO_enableInterrupt (uint_fast8_t selectedPort, uint_fast16_t selectedPins)
//GPIO获取中断使能标志位,返回(unsigned int)的一个数据
uint_fast16_t GPIO_getEnabledInterruptStatus (uint_fast8_t selectedPort)
//GPIO获取IO中断标志位,返回(unsigned int)的一个数据
uint_fast16_t GPIO_getInterruptStatus (uint_fast8_t selectedPort, uint_fast16_t selectedPins)
void GPIO_registerInterrupt (uint_fast8_t selectedPort, void(intHandler)(void))


//第二类就是普通GPIO口配置函数
uint8_t GPIO_getInputPinValue (uint_fast8_t selectedPort, uint_fast16_t selectedPins)
void GPIO_setAsInputPin (uint_fast8_t selectedPort, uint_fast16_t selectedPins)
void GPIO_setAsInputPinWithPullDownResistor (uint_fast8_t selectedPort, uint_fast16_t
selectedPins)
void GPIO_setAsInputPinWithPullUpResistor (uint_fast8_t selectedPort, uint_fast16_t
selectedPins)
void GPIO_setAsOutputPin (uint_fast8_t selectedPort, uint_fast16_t selectedPins)
void GPIO_setAsPeripheralModuleFunctionInputPin (uint_fast8_t selectedPort, uint_fast16_t
selectedPins, uint_fast8_t mode)
void GPIO_setAsPeripheralModuleFunctionOutputPin (uint_fast8_t selectedPort,
uint_fast16_t selectedPins, uint_fast8_t mode)
void GPIO_setDriveStrengthHigh (uint_fast8_t selectedPort, uint_fast8_t selectedPins)
void GPIO_setDriveStrengthLow (uint_fast8_t selectedPort, uint_fast8_t selectedPins)
void GPIO_setOutputHighOnPin (uint_fast8_t selectedPort, uint_fast16_t selectedPins)
void GPIO_setOutputLowOnPin (uint_fast8_t selectedPort, uint_fast16_t selectedPins)
void GPIO_toggleOutputOnPin (uint_fast8_t selectedPort, uint_fast16_t selectedPins)
void GPIO_unregisterInterrupt (uint_fast8_t selectedPort)


使用特权

评论回复

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

116

主题

199

帖子

1

粉丝