no-OS
stm32_gpio.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef GPIO_EXTRA_H_
40 #define GPIO_EXTRA_H_
41 
42 #include <stdint.h>
43 #include <stdbool.h>
44 #include "stm32_hal.h"
45 
50 typedef struct stm32_gpio_init_param {
52  GPIO_TypeDef *port;
54  uint32_t mode;
56  uint32_t pull;
58  uint32_t speed;
60 
65 typedef struct stm32_gpio_desc {
67  GPIO_TypeDef *port;
69  uint32_t mode;
71  uint32_t pull;
73  uint32_t speed;
75 
79 extern const struct no_os_gpio_platform_ops stm32_gpio_ops;
80 
81 #endif
no_os_gpio_desc::extra
void * extra
Definition: no_os_gpio.h:112
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:85
NO_OS_GPIO_OUT
#define NO_OS_GPIO_OUT
Definition: no_os_gpio.h:53
stm32_gpio_init_param::port
GPIO_TypeDef * port
Definition: stm32_gpio.h:52
stm32_gpio_desc::port
GPIO_TypeDef * port
Definition: stm32_gpio.h:67
stm32_gpio_get_direction
int32_t stm32_gpio_get_direction(struct no_os_gpio_desc *desc, uint8_t *direction)
Get the direction of the specified GPIO.
Definition: stm32_gpio.c:276
stm32_gpio_desc
struct stm32_gpio_desc stm32_gpio_desc
stm32_gpio_init_param
struct stm32_gpio_init_param stm32_gpio_init_param
no_os_delay.h
Header file of Delay functions.
stm32_gpio_init_param::mode
uint32_t mode
Definition: stm32_gpio.h:54
no_os_gpio_init_param::number
int32_t number
Definition: no_os_gpio.h:89
stm32_gpio_desc::speed
uint32_t speed
Definition: stm32_gpio.h:73
stm32_gpio_init_param
Structure holding the initialization parameters for stm32 platform.
Definition: stm32_gpio.h:50
NO_OS_GPIO_IN
#define NO_OS_GPIO_IN
Definition: no_os_gpio.h:54
no_os_udelay
void no_os_udelay(uint32_t usecs)
Generate microseconds delay.
Definition: stm32_delay.c:64
stm32_gpio_remove
int32_t stm32_gpio_remove(struct no_os_gpio_desc *desc)
Free the resources allocated by no_os_gpio_get().
Definition: stm32_gpio.c:189
stm32_gpio_desc::mode
uint32_t mode
Definition: stm32_gpio.h:69
stm32_gpio_direction_output
int32_t stm32_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition: stm32_gpio.c:238
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:102
stm32_gpio_get_optional
int32_t stm32_gpio_get_optional(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Get the value of an optional GPIO.
Definition: stm32_gpio.c:173
stm32_gpio_set_value
int32_t stm32_gpio_set_value(struct no_os_gpio_desc *desc, uint8_t value)
Set the value of the specified GPIO.
Definition: stm32_gpio.c:295
stm32_gpio.h
Header file for stm32 gpio specifics.
NO_OS_BIT
#define NO_OS_BIT(x)
Definition: no_os_util.h:51
stm32_gpio_desc::pull
uint32_t pull
Definition: stm32_gpio.h:71
NULL
#define NULL
Definition: wrapper.h:64
stm32_gpio_ops
const struct no_os_gpio_platform_ops stm32_gpio_ops
stm32 platform specific gpio platform ops structure
Definition: stm32_gpio.c:343
stm32_gpio_init_param::pull
uint32_t pull
Definition: stm32_gpio.h:56
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Generate miliseconds delay.
Definition: stm32_delay.c:76
stm32_gpio_get_value
int32_t stm32_gpio_get_value(struct no_os_gpio_desc *desc, uint8_t *value)
Get the value of the specified GPIO.
Definition: stm32_gpio.c:322
stm32_gpio_ops
const struct no_os_gpio_platform_ops stm32_gpio_ops
stm32 platform specific GPIO platform ops structure
Definition: stm32_gpio.c:343
stm32_gpio_init_param::speed
uint32_t speed
Definition: stm32_gpio.h:58
no_os_gpio_platform_ops
Structure holding gpio function pointers that point to the platform specific function.
Definition: no_os_gpio.h:133
no_os_gpio_init_param::extra
void * extra
Definition: no_os_gpio.h:95
no_os_gpio.h
Header file of GPIO Interface.
L
#define L(x)
Definition: ad9144.h:1266
_gpio_init
int32_t _gpio_init(struct no_os_gpio_desc *desc, const struct no_os_gpio_init_param *param)
Prepare the GPIO decriptor.
Definition: xilinx_gpio.c:68
no_os_util.h
Implementation of utility functions.
no_os_gpio_platform_ops::gpio_ops_get
int32_t(* gpio_ops_get)(struct no_os_gpio_desc **, const struct no_os_gpio_init_param *)
Definition: no_os_gpio.h:135
stm32_gpio_desc
stm32 platform specific gpio descriptor
Definition: stm32_gpio.h:65
stm32_gpio_get
int32_t stm32_gpio_get(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Obtain the GPIO decriptor.
Definition: stm32_gpio.c:131
no_os_gpio_desc::number
int32_t number
Definition: no_os_gpio.h:106
stm32_hal.h
stm32_gpio_direction_input
int32_t stm32_gpio_direction_input(struct no_os_gpio_desc *desc)
Enable the input direction of the specified GPIO.
Definition: stm32_gpio.c:204
errno.h
Error macro definition for ARM Compiler.
GPIO_MODE
#define GPIO_MODE
Definition: parameters.h:61