Go to the documentation of this file.
52 #ifndef __GR55xx_HAL_MSIO_H__
53 #define __GR55xx_HAL_MSIO_H__
134 #define MSIO_PIN_0 ((uint16_t)0x0001U)
135 #define MSIO_PIN_1 ((uint16_t)0x0002U)
136 #define MSIO_PIN_2 ((uint16_t)0x0004U)
137 #define MSIO_PIN_3 ((uint16_t)0x0008U)
138 #define MSIO_PIN_4 ((uint16_t)0x0010U)
139 #define MSIO_PIN_5 ((uint16_t)0x0020U)
140 #define MSIO_PIN_6 ((uint16_t)0x0040U)
141 #define MSIO_PIN_7 ((uint16_t)0x0080U)
142 #define MSIO_PIN_ALL ((uint16_t)0x00FFU)
143 #define MSIO_PIN_MASK (0x000000FFU)
150 #define MSIO_DIRECTION_NONE LL_MSIO_DIRECTION_NONE
151 #define MSIO_DIRECTION_INPUT LL_MSIO_DIRECTION_INPUT
152 #define MSIO_DIRECTION_OUTPUT LL_MSIO_DIRECTION_OUTPUT
153 #define MSIO_DIRECTION_INOUT LL_MSIO_DIRECTION_INOUT
163 #define MSIO_MODE_ANALOG LL_MSIO_MODE_ANALOG
164 #define MSIO_MODE_DIGITAL LL_MSIO_MODE_DIGITAL
165 #define MSIO_MODE_IT_RISING (LL_MSIO_TRIGGER_IT_RISING << 4)
166 #define MSIO_MODE_IT_FALLING (LL_MSIO_TRIGGER_IT_FALLING << 4)
167 #define MSIO_MODE_IT_HIGH (LL_MSIO_TRIGGER_IT_HIGH << 4)
168 #define MSIO_MODE_IT_LOW (LL_MSIO_TRIGGER_IT_LOW << 4)
169 #define MSIO_MODE_IT_BOTH_EDGE (LL_MSIO_TRIGGER_IT_BOTH_EDGE << 4)
176 #define MSIO_NOPULL LL_MSIO_PULL_NO
177 #define MSIO_PULLUP LL_MSIO_PULL_UP
178 #define MSIO_PULLDOWN LL_MSIO_PULL_DOWN
184 #define MSIO_DEFAULT_CONFIG \
186 .pin = MSIO_PIN_ALL, \
187 .direction = MSIO_DIRECTION_INPUT, \
188 .mode = MSIO_MODE_DIGITAL, \
189 .pull = MSIO_PULLDOWN, \
207 #define __HAL_MSIO_IT_GET_IT(__MSIOX__, __MSIO_PIN__) ll_msio_read_flag_it(__MSIOX__, __MSIO_PIN__)
216 #define __HAL_MSIO_IT_CLEAR_IT(__MSIOX__, __MSIO_PIN__) ll_msio_clear_flag_it(__MSIOX__, __MSIO_PIN__)
231 #define IS_MSIO_PIN_ACTION(__ACTION__) (((__ACTION__) == MSIO_PIN_RESET) || ((__ACTION__) == MSIO_PIN_SET))
238 #define IS_MSIO_PIN(__PIN__) ((((__PIN__) & MSIO_PIN_MASK) != 0x00U) && \
239 (((__PIN__) & ~MSIO_PIN_MASK) == 0x00U))
246 #define IS_MSIO_DIRECTION(__DIR__) (((__DIR__) == MSIO_DIRECTION_NONE) || \
247 ((__DIR__) == MSIO_DIRECTION_INPUT) || \
248 ((__DIR__) == MSIO_DIRECTION_OUTPUT) || \
249 ((__DIR__) == MSIO_DIRECTION_INOUT))
256 #define IS_MSIO_MODE(__MODE__) (((__MODE__) == MSIO_MODE_ANALOG) || \
257 ((__MODE__) == MSIO_MODE_DIGITAL))
264 #define IS_MSIO_PULL(__PULL__) (((__PULL__) == MSIO_NOPULL) || \
265 ((__PULL__) == MSIO_PULLUP) || \
266 ((__PULL__) == MSIO_PULLDOWN))
MSIO init structure definition.
Header file containing functions prototypes of MSIO LL library.
void hal_msio_write_pin(msio_pad_t MSIOx, uint16_t msio_pin, msio_pin_state_t pin_state)
Set or clear the selected data port bit.
void(* msio_callback)(msio_pad_t MSIOx, uint16_t msio_pin)
struct _msio_callback msio_callback_t
HAL_MSIO Callback function definition.
struct _msio_init msio_init_t
MSIO init structure definition.
void hal_msio_exti_callback(msio_pad_t MSIOx, uint16_t msio_pin)
MSIOA pin detection callback.
void hal_msio_init(msio_pad_t MSIOx, msio_init_t *p_msio_init)
Initialize the MSIOx peripheral according to the specified parameters in the msio_init_t.
void hal_msio_deinit(msio_pad_t MSIOx, uint32_t msio_pin)
De-initialize the MSIOx peripheral registers to their default reset values.
msio_pad_t
MSIO pad Enumerations definition.
void hal_msio_toggle_pin(msio_pad_t MSIOx, uint16_t msio_pin)
Toggle the specified MSIO pin.
msio_pin_state_t hal_msio_read_pin(msio_pad_t MSIOx, uint16_t msio_pin)
Read the specified input port pin.
HAL_MSIO Callback function definition.
msio_pin_state_t
MSIO Bit SET and Bit RESET enumerations.
void hal_msio_exti_irq_handler(msio_pad_t MSIOx)
Handle MSIOA interrupt request.
This file contains HAL common definitions, enumeration, macros and structures definitions.
Header file containing extended macro of MSIO HAL library.