no-OS
stm32_gpio.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef STM32_GPIO_H_
34 #define STM32_GPIO_H_
35 
36 #include <stdint.h>
37 #include <stdbool.h>
38 #include "stm32_hal.h"
39 
46  uint32_t mode;
48  uint32_t speed;
50  uint32_t alternate;
51 };
52 
59  GPIO_TypeDef *port;
61  GPIO_InitTypeDef gpio_config;
62 };
63 
67 extern const struct no_os_gpio_platform_ops stm32_gpio_ops;
68 
69 #endif
NO_OS_PULL_DOWN
@ NO_OS_PULL_DOWN
Definition: no_os_gpio.h:70
no_os_gpio_desc::extra
void * extra
Definition: no_os_gpio.h:106
no_os_alloc.h
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
NO_OS_GPIO_OUT
#define NO_OS_GPIO_OUT
Definition: no_os_gpio.h:47
no_os_gpio_init_param::pull
enum no_os_gpio_pull_up pull
Definition: no_os_gpio.h:85
stm32_gpio_desc::port
GPIO_TypeDef * port
Definition: stm32_gpio.h:59
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:319
stm32_gpio_init_param::mode
uint32_t mode
Definition: stm32_gpio.h:46
no_os_gpio_init_param::port
int32_t port
Definition: no_os_gpio.h:81
NO_OS_PULL_UP_WEAK
@ NO_OS_PULL_UP_WEAK
Definition: no_os_gpio.h:71
no_os_gpio_init_param::number
int32_t number
Definition: no_os_gpio.h:83
stm32_gpio_init_param
Structure holding the initialization parameters for stm32 platform.
Definition: stm32_gpio.h:44
NO_OS_PULL_DOWN_WEAK
@ NO_OS_PULL_DOWN_WEAK
Definition: no_os_gpio.h:72
NO_OS_GPIO_IN
#define NO_OS_GPIO_IN
Definition: no_os_gpio.h:48
NO_OS_PULL_NONE
@ NO_OS_PULL_NONE
Definition: no_os_gpio.h:66
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:245
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:287
no_os_gpio_desc::port
int32_t port
Definition: no_os_gpio.h:98
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
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:229
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:341
no_os_malloc
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
stm32_gpio.h
Header file for stm32 gpio specifics.
NO_OS_BIT
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
no_os_gpio_desc::pull
enum no_os_gpio_pull_up pull
Definition: no_os_gpio.h:102
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:389
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:368
stm32_gpio_ops
const struct no_os_gpio_platform_ops stm32_gpio_ops
stm32 platform specific GPIO platform ops structure
Definition: stm32_gpio.c:389
stm32_gpio_init_param::speed
uint32_t speed
Definition: stm32_gpio.h:48
NO_OS_PULL_UP
@ NO_OS_PULL_UP
Definition: no_os_gpio.h:68
no_os_gpio_platform_ops
Structure holding gpio function pointers that point to the platform specific function.
Definition: no_os_gpio.h:127
no_os_gpio_init_param::extra
void * extra
Definition: no_os_gpio.h:89
no_os_gpio.h
Header file of GPIO Interface.
stm32_gpio_init_param::alternate
uint32_t alternate
Definition: stm32_gpio.h:50
_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:63
no_os_util.h
Header file 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:129
stm32_gpio_desc::gpio_config
GPIO_InitTypeDef gpio_config
Definition: stm32_gpio.h:61
stm32_gpio_desc
stm32 platform specific gpio descriptor
Definition: stm32_gpio.h:57
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:187
no_os_gpio_desc::number
int32_t number
Definition: no_os_gpio.h:100
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:260
errno.h
Error macro definition for ARM Compiler.