Myriota UltraLite SDK 2.4.0
Loading...
Searching...
No Matches

General Purpose Input/Output (GPIO) interface for digital signal control. More...

Enumerations

enum  GPIOLevel { GPIO_LOW = 0 , GPIO_HIGH }
 GPIO level. More...
 
enum  GPIOPull { GPIO_NO_PULL = 10 , GPIO_PULL_UP , GPIO_PULL_DOWN }
 GPIO internal pull up/down. More...
 

Functions

MYRIOTA_HARDWARE_API int GPIOSetModeInput (uint8_t PinNum, GPIOPull Pull)
 Set a GPIO to input mode and the internal pull up/down.
 
MYRIOTA_HARDWARE_API int GPIOSetModeOutput (uint8_t PinNum)
 Set a GPIO to output mode.
 
MYRIOTA_HARDWARE_API int GPIOSetHigh (uint8_t PinNum)
 Set a GPIO output high.
 
MYRIOTA_HARDWARE_API int GPIOSetLow (uint8_t PinNum)
 Set a GPIO output low.
 
MYRIOTA_HARDWARE_API int GPIOGet (uint8_t PinNum)
 Get input level of a GPIO.
 
MYRIOTA_HARDWARE_API int GPIOSetWakeupLevel (uint8_t PinNum, GPIOLevel Level)
 Set level polarity of a GPIO pin with wakeup capability for next wakeup.
 
MYRIOTA_HARDWARE_API int GPIODisableWakeup (uint8_t PinNum)
 Disable wakeup capability of a GPIO pin.
 

Detailed Description

General Purpose Input/Output (GPIO) interface for digital signal control.

Enumeration Type Documentation

◆ GPIOLevel

enum GPIOLevel

GPIO level.

Enumerator
GPIO_LOW 

Low logic level.

GPIO_HIGH 

High logic level.

◆ GPIOPull

enum GPIOPull

GPIO internal pull up/down.

Enumerator
GPIO_NO_PULL 

No module internal pull up or pull down.

GPIO_PULL_UP 

Module internal pull up.

GPIO_PULL_DOWN 

Module internal pull down.

Function Documentation

◆ GPIOSetModeInput()

MYRIOTA_HARDWARE_API int GPIOSetModeInput ( uint8_t  PinNum,
GPIOPull  Pull 
)

Set a GPIO to input mode and the internal pull up/down.

Parameters
PinNumThe GPIO pin number from ModulePinDef.
PullThe internal pull up/down configuration from GPIOPull.
Returns
0 if succeeded, -1 if failed.

◆ GPIOSetModeOutput()

MYRIOTA_HARDWARE_API int GPIOSetModeOutput ( uint8_t  PinNum)

Set a GPIO to output mode.

Parameters
PinNumThe GPIO pin number from ModulePinDef.
Returns
0 if succeeded, -1 if failed.

◆ GPIOSetHigh()

MYRIOTA_HARDWARE_API int GPIOSetHigh ( uint8_t  PinNum)

Set a GPIO output high.

Parameters
PinNumThe GPIO pin number from ModulePinDef.
Returns
0 if succeeded, -1 if failed.

◆ GPIOSetLow()

MYRIOTA_HARDWARE_API int GPIOSetLow ( uint8_t  PinNum)

Set a GPIO output low.

Parameters
PinNumThe GPIO pin number from ModulePinDef.
Returns
0 if succeeded, -1 if failed.

◆ GPIOGet()

MYRIOTA_HARDWARE_API int GPIOGet ( uint8_t  PinNum)

Get input level of a GPIO.

Parameters
PinNumThe GPIO pin number from ModulePinDef.
Returns
GPIOLevel if succeeded, -1 if failed.

◆ GPIOSetWakeupLevel()

MYRIOTA_HARDWARE_API int GPIOSetWakeupLevel ( uint8_t  PinNum,
GPIOLevel  Level 
)

Set level polarity of a GPIO pin with wakeup capability for next wakeup.

Parameters
PinNumThe GPIO pin number from ModulePinDef with wakeup capability.
LevelThe wakeup level from GPIOLevel.
Returns
0 if succeeded, -1 if failed.

◆ GPIODisableWakeup()

MYRIOTA_HARDWARE_API int GPIODisableWakeup ( uint8_t  PinNum)

Disable wakeup capability of a GPIO pin.

Parameters
PinNumThe GPIO pin number from ModulePinDef with wakeup capability.
Returns
0 if succeeded, -1 if failed (e.g., pin does not support wakeup).