Trident IoT SDK
 
Loading...
Searching...
No Matches
tr_hal_gpio.h
Go to the documentation of this file.
1
10
11#ifndef TR_HAL_GPIO_H_
12#define TR_HAL_GPIO_H_
13
14#include "tr_hal_platform.h"
15
16
17// ****************************************************************************
18// GPIO Driver API functions
19// ****************************************************************************
20
26
27
28// ***************************************************************************
29// ---- init, read back settings, read input ----
30// ***************************************************************************
31
32
37 tr_hal_gpio_settings_t* gpio_settings);
38
43 tr_hal_gpio_settings_t* gpio_settings);
44
48 tr_hal_level_t* read_value);
49
50
51// ***************************************************************************
52// ---- is pin available, are pins equal ----
53// ***************************************************************************
54
58
63
64
65// ***************************************************************************
66// ---- setting/getting direction, output state ----
67// ***************************************************************************
68
69// do not need these if use the settings struct and the init function
70
72 tr_hal_direction_t direction);
73
75 tr_hal_direction_t* direction);
76
78 tr_hal_level_t level);
79
81 tr_hal_level_t* level);
82
84
85
86// ***************************************************************************
87// ---- setting interrupt trigger/priority/callback ----
88// ***************************************************************************
89
90// do not need these if use the settings struct and the init function
91
93 tr_hal_trigger_t trigger);
94
96 tr_hal_trigger_t* trigger);
97
99
101
103 tr_hal_gpio_event_callback_t callback_function);
104
106 tr_hal_gpio_event_callback_t* callback_function);
107
108
109// ***************************************************************************
110// ---- setting/getting open drain and pull mode ----
111// ***************************************************************************
112
113// do not need these if use the settings struct and the init function
114
116 bool enable);
117
119 bool* drain_enabled);
120
122 tr_hal_pullopt_t mode);
123
125 tr_hal_pullopt_t* mode);
126
127
128// ***************************************************************************
129// ---- setting/getting debounce ----
130// ***************************************************************************
131
132// do not need these if use the settings struct and the init function
133
135 bool enable);
136
138 bool* debounce_enabled);
139
141
143
144
145// ***************************************************************************
146// ---- setting/getting drive strength ----
147// ***************************************************************************
148
149// do not need these if use the settings struct and the init function
150
152 tr_hal_drive_strength_t new_drive_strength);
153
155 tr_hal_drive_strength_t* drive_strength);
156
157
158// ***************************************************************************
159// ---- enable/disable wake on deep sleep ----
160// ***************************************************************************
161
162// do not need these if use the settings struct and the init function
163
165 tr_hal_wake_mode_t wake_mode);
166
168 tr_hal_wake_mode_t* wake_mode);
169
170// ***************************************************************************
171// ---- set/get the pin mode (GPIO, UART, SPI, etc) for this pin ----
172// ***************************************************************************
174 tr_hal_pin_mode_t mode);
175
177 tr_hal_pin_mode_t* mode);
178
179// ***************************************************************************
180// ---- print a pin in a debug print ----
181// ***************************************************************************
183
184
188
189
190#endif //TR_HAL_GPIO_H_
tr_hal_int_pri_t
values and a range checking function for setting the interrupt priority in the Trident HAL APIs
Definition tr_hal_platform.h:34
tr_hal_status_t
Definition tr_hal_common.h:25
tr_hal_drive_strength_t
values for setting the GPIO drive strength in the Trident HAL APIs NOTE: these CANNOT be changed....
Definition T32CM11_gpio.h:327
tr_hal_wake_mode_t
values for setting the GPIO wake mode
Definition T32CM11_gpio.h:341
tr_hal_pullopt_t
values for setting the pull option in the Trident HAL GPIO APIs NOTE: these CANNOT be changed....
Definition T32CM11_gpio.h:289
tr_hal_direction_t
values for setting the direction in the Trident HAL GPIO APIs
Definition T32CM11_gpio.h:253
tr_hal_pin_mode_t
these are the pin MODEs to be passed to tr_hal_gpio_set_mode note that these are defined by the chip ...
Definition T32CM11_gpio.h:222
tr_hal_debounce_time_t
values for setting the debounce time register each individual GPIO can be set to enable or disable de...
Definition T32CM11_gpio.h:309
tr_hal_trigger_t
values for setting the interrupt trigger in the Trident HAL GPIO APIs
Definition T32CM11_gpio.h:273
void(* tr_hal_gpio_event_callback_t)(tr_hal_gpio_pin_t pin, tr_hal_gpio_event_t event)
Definition T32CM11_gpio.h:366
tr_hal_level_t
values for setting the level in the Trident HAL GPIO APIs
Definition T32CM11_gpio.h:263
tr_hal_status_t tr_hal_gpio_set_output(tr_hal_gpio_pin_t pin, tr_hal_level_t level)
tr_hal_status_t tr_hal_gpio_set_drive_strength(tr_hal_gpio_pin_t pin, tr_hal_drive_strength_t new_drive_strength)
tr_hal_status_t tr_hal_gpio_get_output(tr_hal_gpio_pin_t pin, tr_hal_level_t *level)
tr_hal_status_t tr_hal_gpio_read_settings(tr_hal_gpio_pin_t pin, tr_hal_gpio_settings_t *gpio_settings)
char * tr_hal_gpio_get_string(tr_hal_gpio_pin_t pin)
tr_hal_status_t tr_hal_gpio_toggle_output(tr_hal_gpio_pin_t pin)
tr_hal_status_t tr_hal_gpio_get_debounce(tr_hal_gpio_pin_t pin, bool *debounce_enabled)
bool tr_hal_gpio_is_available(tr_hal_gpio_pin_t pin)
tr_hal_status_t tr_hal_gpio_get_debounce_time(tr_hal_debounce_time_t *debounce_time)
tr_hal_status_t tr_hal_gpio_set_pull_mode(tr_hal_gpio_pin_t pin, tr_hal_pullopt_t mode)
tr_hal_status_t tr_hal_gpio_set_open_drain(tr_hal_gpio_pin_t pin, bool enable)
tr_hal_status_t tr_hal_gpio_set_direction(tr_hal_gpio_pin_t pin, tr_hal_direction_t direction)
tr_hal_status_t tr_hal_gpio_init(tr_hal_gpio_pin_t pin, tr_hal_gpio_settings_t *gpio_settings)
tr_hal_status_t tr_hal_gpio_get_interrupt_trigger(tr_hal_gpio_pin_t pin, tr_hal_trigger_t *trigger)
tr_hal_status_t tr_hal_gpio_set_debounce(tr_hal_gpio_pin_t pin, bool enable)
tr_hal_status_t tr_hal_gpio_get_mode(tr_hal_gpio_pin_t pin, tr_hal_pin_mode_t *mode)
tr_hal_status_t tr_hal_gpio_get_wake_mode(tr_hal_gpio_pin_t pin, tr_hal_wake_mode_t *wake_mode)
tr_hal_status_t tr_hal_gpio_set_wake_mode(tr_hal_gpio_pin_t pin, tr_hal_wake_mode_t wake_mode)
tr_hal_status_t tr_hal_gpio_read_input(tr_hal_gpio_pin_t pin, tr_hal_level_t *read_value)
tr_hal_status_t tr_hal_gpio_set_interrupt_priority(tr_hal_int_pri_t new_interrupt_priority)
tr_hal_status_t tr_hal_gpio_get_interrupt_callback(tr_hal_gpio_pin_t pin, tr_hal_gpio_event_callback_t *callback_function)
tr_hal_status_t tr_hal_gpio_get_drive_strength(tr_hal_gpio_pin_t pin, tr_hal_drive_strength_t *drive_strength)
bool tr_hal_gpio_are_pins_equal(tr_hal_gpio_pin_t pin1, tr_hal_gpio_pin_t pin2)
tr_hal_status_t tr_hal_gpio_set_interrupt_trigger(tr_hal_gpio_pin_t pin, tr_hal_trigger_t trigger)
tr_hal_status_t tr_hal_gpio_set_interrupt_callback(tr_hal_gpio_pin_t pin, tr_hal_gpio_event_callback_t callback_function)
tr_hal_status_t tr_hal_gpio_set_mode(tr_hal_gpio_pin_t pin, tr_hal_pin_mode_t mode)
tr_hal_status_t tr_hal_gpio_set_debounce_time(tr_hal_debounce_time_t new_debounce_time)
tr_hal_status_t tr_hal_gpio_get_direction(tr_hal_gpio_pin_t pin, tr_hal_direction_t *direction)
tr_hal_status_t tr_hal_gpio_get_open_drain(tr_hal_gpio_pin_t pin, bool *drain_enabled)
tr_hal_status_t tr_hal_gpio_get_pull_mode(tr_hal_gpio_pin_t pin, tr_hal_pullopt_t *mode)
tr_hal_status_t tr_hal_gpio_get_interrupt_priority(tr_hal_int_pri_t *interrupt_priority)
pin type
Definition tr_hal_platform.h:23
Definition T32CM11_gpio.h:400