Go to the documentation of this file.
52 #ifndef __GR55xx_HAL_MSIO_H__
53 #define __GR55xx_HAL_MSIO_H__
149 #define MSIO_PIN_0 ((uint16_t)0x0001U)
150 #define MSIO_PIN_1 ((uint16_t)0x0002U)
151 #define MSIO_PIN_2 ((uint16_t)0x0004U)
152 #define MSIO_PIN_3 ((uint16_t)0x0008U)
153 #define MSIO_PIN_4 ((uint16_t)0x0010U)
154 #define MSIO_PIN_5 ((uint16_t)0x0020U)
155 #define MSIO_PIN_6 ((uint16_t)0x0040U)
156 #define MSIO_PIN_7 ((uint16_t)0x0080U)
157 #define MSIO_PIN_ALL ((uint16_t)0x00FFU)
158 #define MSIO_PIN_MASK (0x000000FFU)
165 #define MSIO_DIRECTION_NONE LL_MSIO_DIRECTION_NONE
166 #define MSIO_DIRECTION_INPUT LL_MSIO_DIRECTION_INPUT
167 #define MSIO_DIRECTION_OUTPUT LL_MSIO_DIRECTION_OUTPUT
168 #define MSIO_DIRECTION_INOUT LL_MSIO_DIRECTION_INOUT
178 #define MSIO_MODE_ANALOG LL_MSIO_MODE_ANALOG
179 #define MSIO_MODE_DIGITAL LL_MSIO_MODE_DIGITAL
186 #define MSIO_NOPULL LL_MSIO_PULL_NO
187 #define MSIO_PULLUP LL_MSIO_PULL_UP
188 #define MSIO_PULLDOWN LL_MSIO_PULL_DOWN
195 #define MSIO_SPEED_MEDIUM LL_MSIO_SPEED_MEDIUM
196 #define MSIO_SPEED_HIGH LL_MSIO_SPEED_HIGH
203 #define MSIO_STRENGTH_LOW LL_MSIO_STRENGTH_LOW
204 #define MSIO_STRENGTH_MEDIUM LL_MSIO_STRENGTH_MEDIUM
205 #define MSIO_STRENGTH_HIGH LL_MSIO_STRENGTH_HIGH
206 #define MSIO_STRENGTH_ULTRA LL_MSIO_STRENGTH_ULTRA
213 #define MSIO_INPUT_TYPE_CMOS LL_MSIO_INPUT_TYPE_CMOS
214 #define MSIO_INPUT_TYPE_SCHMITT LL_MSIO_INPUT_TYPE_SCHMITT
220 #define MSIO_DEFAULT_CONFIG \
222 .pin = MSIO_PIN_ALL, \
223 .direction = MSIO_DIRECTION_INPUT, \
224 .mode = MSIO_MODE_DIGITAL, \
225 .pull = MSIO_PULLDOWN, \
226 .speed = MSIO_SPEED_MEDIUM, \
227 .strength = MSIO_STRENGTH_MEDIUM, \
228 .input_type = MSIO_INPUT_TYPE_CMOS, \
246 #define __HAL_MSIO_IT_GET_IT(__MSIOX__, __MSIO_PIN__) ll_msio_read_flag_it(__MSIOX__, __MSIO_PIN__)
255 #define __HAL_MSIO_IT_CLEAR_IT(__MSIOX__, __MSIO_PIN__) ll_msio_clear_flag_it(__MSIOX__, __MSIO_PIN__)
270 #define IS_MSIO_PIN_ACTION(__ACTION__) (((__ACTION__) == MSIO_PIN_RESET) || ((__ACTION__) == MSIO_PIN_SET))
277 #define IS_MSIO_PIN(__PIN__) ((((__PIN__) & MSIO_PIN_MASK) != 0x00U) && \
278 (((__PIN__) & ~MSIO_PIN_MASK) == 0x00U))
285 #define IS_MSIO_DIRECTION(__DIR__) (((__DIR__) == MSIO_DIRECTION_NONE) || \
286 ((__DIR__) == MSIO_DIRECTION_INPUT) || \
287 ((__DIR__) == MSIO_DIRECTION_OUTPUT) || \
288 ((__DIR__) == MSIO_DIRECTION_INOUT))
295 #define IS_MSIO_MODE(__MODE__) (((__MODE__) == MSIO_MODE_ANALOG) || \
296 ((__MODE__) == MSIO_MODE_DIGITAL))
303 #define IS_MSIO_PULL(__PULL__) (((__PULL__) == MSIO_NOPULL) || \
304 ((__PULL__) == MSIO_PULLUP) || \
305 ((__PULL__) == MSIO_PULLDOWN))
HAL_MSIO Callback function definition.
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.
struct _msio_init msio_init_t
MSIO init structure definition.
void hal_msio_exti_callback(msio_pad_t MSIOx, uint16_t msio_pin)
MSIOB 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.
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.
msio_pin_state_t
MSIO Bit SET and Bit RESET enumerations.
struct _hal_msio_callback hal_msio_callback_t
HAL_MSIO Callback function definition.
void(* msio_callback)(msio_pad_t MSIOx, uint16_t msio_pin)
void hal_msio_exti_irq_handler(msio_pad_t MSIOx)
Handle MSIOB interrupt request.
This file contains HAL common definitions, enumeration, macros and structures definitions.
Header file containing extended macro of MSIO HAL library.