libyggdrasil  v1.0.0
gpio.h File Reference

GPIO Pin abstraction implementation for Midgard. More...

#include <c/common/types.h>
#include <stm32f7xx_hal.h>
Include dependency graph for gpio.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  gpio_t
 GPIO handle type. More...
 

Macros

#define LOW_ACTIVE   true
 
#define HIGH_ACTIVE   false
 

Typedefs

typedef GPIO_TypeDef * port_t
 GPIO port type. More...
 
typedef u8 pin_t
 GPIO pin type. More...
 

Functions

C_LINKAGE bool yggdrasil_GPIO_Init (gpio_t gpio)
 GPIO initialization. More...
 
C_LINKAGE bool yggdrasil_GPIO_Deinit (gpio_t gpio)
 GPIO deinitialization. More...
 
C_LINKAGE bool yggdrasil_GPIO_Get (gpio_t gpio)
 Get GPIO state. More...
 
C_LINKAGE void yggdrasil_GPIO_Set (gpio_t gpio, bool state)
 Set GPIO state. More...
 
C_LINKAGE void yggdrasil_GPIO_Toggle (gpio_t gpio)
 Toggle GPIO. More...
 
C_LINKAGE u16 yggdrasil_GPIO_GetMultiple (port_t port, u8 from, u8 to)
 Get multiple GPIO states. More...
 
C_LINKAGE void yggdrasil_GPIO_SetMultiple (port_t port, u8 from, u8 to, u16 value)
 Set multiple GPIO states. More...
 

Detailed Description

GPIO Pin abstraction implementation for Midgard.

Author
Fabian Weber, Nikolaij Saegesser

Macro Definition Documentation

◆ HIGH_ACTIVE

#define HIGH_ACTIVE   false

◆ LOW_ACTIVE

#define LOW_ACTIVE   true

Typedef Documentation

◆ pin_t

typedef u8 pin_t

GPIO pin type.

◆ port_t

typedef GPIO_TypeDef* port_t

GPIO port type.

Function Documentation

◆ yggdrasil_GPIO_Deinit()

C_LINKAGE bool yggdrasil_GPIO_Deinit ( gpio_t  gpio)

GPIO deinitialization.

Parameters
gpioGPIO handle
Returns
Success

◆ yggdrasil_GPIO_Get()

C_LINKAGE bool yggdrasil_GPIO_Get ( gpio_t  gpio)

Get GPIO state.

Parameters
gpioGPIO handle
Returns
GPIO state

◆ yggdrasil_GPIO_GetMultiple()

C_LINKAGE u16 yggdrasil_GPIO_GetMultiple ( port_t  port,
u8  from,
u8  to 
)

Get multiple GPIO states.

Parameters
portGPIO port
fromStart bit number
toEnd bit number
Returns
GPIO state

◆ yggdrasil_GPIO_Init()

C_LINKAGE bool yggdrasil_GPIO_Init ( gpio_t  gpio)

GPIO initialization.

Parameters
gpioGPIO handle
Returns
Success

◆ yggdrasil_GPIO_Set()

C_LINKAGE void yggdrasil_GPIO_Set ( gpio_t  gpio,
bool  state 
)

Set GPIO state.

Parameters
gpioGPIO handle
stateGPIO state

◆ yggdrasil_GPIO_SetMultiple()

C_LINKAGE void yggdrasil_GPIO_SetMultiple ( port_t  port,
u8  from,
u8  to,
u16  value 
)

Set multiple GPIO states.

Parameters
portGPIO port
fromStart bit number
toEnd bit number
valueValue to set
Returns
GPIO state

◆ yggdrasil_GPIO_Toggle()

C_LINKAGE void yggdrasil_GPIO_Toggle ( gpio_t  gpio)

Toggle GPIO.

Parameters
gpioGPIO handle