SmartSnippets DA1459x SDK
ad.h
Go to the documentation of this file.
1 
44 #ifndef AD_H_
45 #define AD_H_
46 
47 #include "hw_gpio.h"
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
53 #define AD_IO_PIN_PORT_VALID(_port, _pin) ((_pin >= HW_GPIO_PIN_0) &&\
54  (_port >= HW_GPIO_PORT_0) &&\
55  (_pin < HW_GPIO_PIN_MAX) &&\
56  (_port < HW_GPIO_PORT_MAX))
57 
58 /*
59  * Data types definitions section
60  */
61 
65 typedef enum {
69 
73 typedef enum {
82 
86 typedef enum {
90 } AD_IO_ERROR;
91 
95 typedef struct {
97  HW_GPIO_FUNC function;
98  bool high;
100 
104 typedef struct {
105  HW_GPIO_PORT port;
106  HW_GPIO_PIN pin;
107  ad_pin_conf_t on;
108  ad_pin_conf_t off;
109 } ad_io_conf_t;
110 
125 AD_IO_ERROR ad_io_configure(const ad_io_conf_t *io, uint8_t size, AD_IO_CONF_STATE state);
126 
137 AD_IO_ERROR ad_io_set_pad_latch(const ad_io_conf_t *io, uint8_t size, AD_IO_PAD_LATCHES_OP operation);
138 
139 
140 #ifdef __cplusplus
141 }
142 #endif
143 
144 #endif /* AD_H_ */
145 
ad_io_configure
AD_IO_ERROR ad_io_configure(const ad_io_conf_t *io, uint8_t size, AD_IO_CONF_STATE state)
Apply a list of IO configurations.
AD_IO_ERROR_NONE
Definition: ad.h:87
ad_io_set_pad_latch
AD_IO_ERROR ad_io_set_pad_latch(const ad_io_conf_t *io, uint8_t size, AD_IO_PAD_LATCHES_OP operation)
Apply a list of io pad latch operations.
AD_IO_PAD_LATCHES_OP_TOGGLE
Definition: ad.h:80
AD_IO_ERROR_INVALID_PIN
Definition: ad.h:88
AD_IO_PAD_LATCHES_OP_DISABLE
Definition: ad.h:74
HW_GPIO_PIN
HW_GPIO_PIN
GPIO pin number.
Definition: hw_gpio.h:106
HW_GPIO_PORT
HW_GPIO_PORT
GPIO port number.
Definition: hw_gpio.h:96
AD_IO_CONF_OFF
Definition: ad.h:66
AD_IO_PAD_LATCHES_OP_ENABLE
Definition: ad.h:77
HW_GPIO_FUNC
HW_GPIO_FUNC
GPIO function.
Definition: hw_gpio.h:130
AD_IO_CONF_STATE
AD_IO_CONF_STATE
Adapters IO configuration state.
Definition: ad.h:65
AD_IO_ERROR_INVALID_CFG
Definition: ad.h:89
AD_IO_ERROR
AD_IO_ERROR
ad_io_configure return value
Definition: ad.h:86
mode
HW_GPIO_MODE mode
Definition: hw_gpio.h:211
ad_pin_conf_t::high
bool high
Definition: ad.h:98
hw_gpio.h
Definition of API for the GPIO Low Level Driver.
AD_IO_PAD_LATCHES_OP
AD_IO_PAD_LATCHES_OP
Pad latch operation.
Definition: ad.h:73
HW_GPIO_MODE
HW_GPIO_MODE
GPIO input/output mode.
Definition: hw_gpio.h:82
ad_io_conf_t
Adapters IO configuration.
Definition: ad.h:104
ad_pin_conf_t
Adapters pin configuration.
Definition: ad.h:95
AD_IO_CONF_ON
Definition: ad.h:67