Обновление
This commit is contained in:
parent
6b9aea2c76
commit
662e0b43a3
|
|
@ -20,12 +20,14 @@ tGpioPin vInitGpioPinPull(
|
||||||
uint32_t pinMask,
|
uint32_t pinMask,
|
||||||
GPIO_PinDirectionType direction,
|
GPIO_PinDirectionType direction,
|
||||||
bool reverse,
|
bool reverse,
|
||||||
GPIO_PinLevelType gpio_pull
|
GPIO_PinLevelType ePinLevel,
|
||||||
|
bool bPullEn,
|
||||||
|
PORT_PullStatusType ePullSel
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
void GpioPinSet(tGpioPin *pin, bool value);
|
void GpioPinSet(tGpioPin *pin, bool value);
|
||||||
|
|
||||||
bool GpioPinGet(tGpioPin *pin);
|
bool GpioPinGet(tGpioPin *pin);
|
||||||
|
void GpioPinToggle(tGpioPin *pin);
|
||||||
|
|
||||||
#endif //HVAC_M7_GPIOPIN_H
|
#endif //HVAC_M7_GPIOPIN_H
|
||||||
|
|
|
||||||
|
|
@ -8,14 +8,22 @@ tGpioPin vInitGpioPinPull(
|
||||||
uint32_t pinMask,
|
uint32_t pinMask,
|
||||||
GPIO_PinDirectionType direction,
|
GPIO_PinDirectionType direction,
|
||||||
bool reverse,
|
bool reverse,
|
||||||
GPIO_PinLevelType gpio_pull
|
GPIO_PinLevelType ePinLevel,
|
||||||
|
bool bPullEn,
|
||||||
|
PORT_PullStatusType ePullSel
|
||||||
) {
|
) {
|
||||||
GPIO_InitType tGpioInitStruct;
|
PORT_InitType tInitStruct = {0};
|
||||||
|
GPIO_InitType tGpioInitStruct = {0};
|
||||||
|
|
||||||
|
tInitStruct.bPullEn = bPullEn;
|
||||||
|
tInitStruct.ePullSel = ePullSel;
|
||||||
|
tInitStruct.u32PortPins = pinMask;
|
||||||
|
tInitStruct.uPortPinMux.u32PortPinMode = PORT_GPIO_MODE;
|
||||||
|
PORT_InitPins((PORT_InstanceType)port, &tInitStruct);
|
||||||
|
|
||||||
tGpioInitStruct.u32GpioPins = pinMask;
|
tGpioInitStruct.u32GpioPins = pinMask;
|
||||||
tGpioInitStruct.ePinDirection = direction;
|
tGpioInitStruct.ePinDirection = direction;
|
||||||
tGpioInitStruct.ePinLevel = gpio_pull;
|
tGpioInitStruct.ePinLevel = ePinLevel;
|
||||||
|
|
||||||
GPIO_InitPins(port, &tGpioInitStruct);
|
GPIO_InitPins(port, &tGpioInitStruct);
|
||||||
|
|
||||||
tGpioPin pin = {
|
tGpioPin pin = {
|
||||||
|
|
@ -52,3 +60,6 @@ bool GpioPinGet(tGpioPin *pin) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GpioPinToggle(tGpioPin *pin) {
|
||||||
|
GPIO_Toggle(pin->port, pin->pin);
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue