Hardware access layer with cache and barrier support for managing the GPIO peripheral. More...
Functions | |
NRFY_STATIC_INLINE void | nrfy_gpio_range_cfg_output (uint32_t pin_range_start, uint32_t pin_range_end) |
NRFY_STATIC_INLINE void | nrfy_gpio_range_cfg_input (uint32_t pin_range_start, uint32_t pin_range_end, nrf_gpio_pin_pull_t pull_config) |
NRFY_STATIC_INLINE void | nrfy_gpio_cfg (uint32_t pin_number, nrf_gpio_pin_dir_t dir, nrf_gpio_pin_input_t input, nrf_gpio_pin_pull_t pull, nrf_gpio_pin_drive_t drive, nrf_gpio_pin_sense_t sense) |
NRFY_STATIC_INLINE void | nrfy_gpio_reconfigure (uint32_t pin_number, const nrf_gpio_pin_dir_t *p_dir, const nrf_gpio_pin_input_t *p_input, const nrf_gpio_pin_pull_t *p_pull, const nrf_gpio_pin_drive_t *p_drive, const nrf_gpio_pin_sense_t *p_sense) |
NRFY_STATIC_INLINE void | nrfy_gpio_cfg_output (uint32_t pin_number) |
NRFY_STATIC_INLINE void | nrfy_gpio_cfg_input (uint32_t pin_number, nrf_gpio_pin_pull_t pull_config) |
NRFY_STATIC_INLINE void | nrfy_gpio_cfg_default (uint32_t pin_number) |
NRFY_STATIC_INLINE void | nrfy_gpio_cfg_watcher (uint32_t pin_number) |
NRFY_STATIC_INLINE void | nrfy_gpio_input_disconnect (uint32_t pin_number) |
NRFY_STATIC_INLINE void | nrfy_gpio_cfg_sense_input (uint32_t pin_number, nrf_gpio_pin_pull_t pull_config, nrf_gpio_pin_sense_t sense_config) |
NRFY_STATIC_INLINE void | nrfy_gpio_cfg_sense_set (uint32_t pin_number, nrf_gpio_pin_sense_t sense_config) |
NRFY_STATIC_INLINE void | nrfy_gpio_pin_dir_set (uint32_t pin_number, nrf_gpio_pin_dir_t direction) |
NRFY_STATIC_INLINE void | nrfy_gpio_pin_set (uint32_t pin_number) |
NRFY_STATIC_INLINE void | nrfy_gpio_pin_clear (uint32_t pin_number) |
NRFY_STATIC_INLINE void | nrfy_gpio_pin_toggle (uint32_t pin_number) |
NRFY_STATIC_INLINE void | nrfy_gpio_pin_write (uint32_t pin_number, uint32_t value) |
NRFY_STATIC_INLINE uint32_t | nrfy_gpio_pin_read (uint32_t pin_number) |
NRFY_STATIC_INLINE uint32_t | nrfy_gpio_pin_out_read (uint32_t pin_number) |
NRFY_STATIC_INLINE nrf_gpio_pin_sense_t | nrfy_gpio_pin_sense_get (uint32_t pin_number) |
NRFY_STATIC_INLINE nrf_gpio_pin_dir_t | nrfy_gpio_pin_dir_get (uint32_t pin_number) |
NRFY_STATIC_INLINE nrf_gpio_pin_input_t | nrfy_gpio_pin_input_get (uint32_t pin_number) |
NRFY_STATIC_INLINE nrf_gpio_pin_pull_t | nrfy_gpio_pin_pull_get (uint32_t pin_number) |
NRFY_STATIC_INLINE void | nrfy_gpio_port_dir_output_set (NRF_GPIO_Type *p_reg, uint32_t out_mask) |
NRFY_STATIC_INLINE void | nrfy_gpio_port_dir_input_set (NRF_GPIO_Type *p_reg, uint32_t in_mask) |
NRFY_STATIC_INLINE void | nrfy_gpio_port_dir_write (NRF_GPIO_Type *p_reg, uint32_t dir_mask) |
NRFY_STATIC_INLINE uint32_t | nrfy_gpio_port_dir_read (NRF_GPIO_Type const *p_reg) |
NRFY_STATIC_INLINE uint32_t | nrfy_gpio_port_in_read (NRF_GPIO_Type const *p_reg) |
NRFY_STATIC_INLINE uint32_t | nrfy_gpio_port_out_read (NRF_GPIO_Type const *p_reg) |
NRFY_STATIC_INLINE void | nrfy_gpio_port_out_write (NRF_GPIO_Type *p_reg, uint32_t value) |
NRFY_STATIC_INLINE void | nrfy_gpio_port_out_set (NRF_GPIO_Type *p_reg, uint32_t set_mask) |
NRFY_STATIC_INLINE void | nrfy_gpio_port_out_clear (NRF_GPIO_Type *p_reg, uint32_t clr_mask) |
NRFY_STATIC_INLINE void | nrfy_gpio_ports_read (uint32_t start_port, uint32_t length, uint32_t *p_masks) |
NRFY_STATIC_INLINE bool | nrfy_gpio_pin_present_check (uint32_t pin_number) |
NRFY_STATIC_INLINE uint32_t | nrfy_gpio_pin_port_number_extract (uint32_t *p_pin) |
Hardware access layer with cache and barrier support for managing the GPIO peripheral.
NRFY_STATIC_INLINE void nrfy_gpio_cfg | ( | uint32_t | pin_number, |
nrf_gpio_pin_dir_t | dir, | ||
nrf_gpio_pin_input_t | input, | ||
nrf_gpio_pin_pull_t | pull, | ||
nrf_gpio_pin_drive_t | drive, | ||
nrf_gpio_pin_sense_t | sense | ||
) |
The main pin configuration function. This function allows to set any aspect in PIN_CNF register.
pin_number | Specifies the pin number. |
dir | Pin direction. |
input | Connect or disconnect the input buffer. |
pull | Pull configuration. |
drive | Drive configuration. |
sense | Pin sensing mechanism. |
NRFY_STATIC_INLINE void nrfy_gpio_cfg_default | ( | uint32_t | pin_number | ) |
pin_number | Specifies the pin number. |
NRFY_STATIC_INLINE void nrfy_gpio_cfg_input | ( | uint32_t | pin_number, |
nrf_gpio_pin_pull_t | pull_config | ||
) |
pin_number | Specifies the pin number. |
pull_config | State of the pin range pull resistor (no pull, pulled down, or pulled high). |
NRFY_STATIC_INLINE void nrfy_gpio_cfg_output | ( | uint32_t | pin_number | ) |
pin_number | Specifies the pin number. |
NRFY_STATIC_INLINE void nrfy_gpio_cfg_sense_input | ( | uint32_t | pin_number, |
nrf_gpio_pin_pull_t | pull_config, | ||
nrf_gpio_pin_sense_t | sense_config | ||
) |
pin_number | Specifies the pin number. |
pull_config | State of the pin pull resistor (no pull, pulled down, or pulled high). |
sense_config | Sense level of the pin (no sense, sense low, or sense high). |
NRFY_STATIC_INLINE void nrfy_gpio_cfg_sense_set | ( | uint32_t | pin_number, |
nrf_gpio_pin_sense_t | sense_config | ||
) |
pin_number | Specifies the pin number. |
sense_config | Sense configuration. |
NRFY_STATIC_INLINE void nrfy_gpio_cfg_watcher | ( | uint32_t | pin_number | ) |
pin_number | Specifies the pin number. |
NRFY_STATIC_INLINE void nrfy_gpio_input_disconnect | ( | uint32_t | pin_number | ) |
pin_number | Specifies the pin number. |
NRFY_STATIC_INLINE void nrfy_gpio_pin_clear | ( | uint32_t | pin_number | ) |
pin_number | Specifies the pin number to clear. |
NRFY_STATIC_INLINE nrf_gpio_pin_dir_t nrfy_gpio_pin_dir_get | ( | uint32_t | pin_number | ) |
pin_number | Specifies the pin number to read. |
NRFY_STATIC_INLINE void nrfy_gpio_pin_dir_set | ( | uint32_t | pin_number, |
nrf_gpio_pin_dir_t | direction | ||
) |
pin_number | Specifies the pin number for which to set the direction. |
direction | Specifies the direction. |
NRFY_STATIC_INLINE nrf_gpio_pin_input_t nrfy_gpio_pin_input_get | ( | uint32_t | pin_number | ) |
pin_number | Pin number to be read. |
Input | buffer configuration. |
NRFY_STATIC_INLINE uint32_t nrfy_gpio_pin_out_read | ( | uint32_t | pin_number | ) |
pin_number | Specifies the pin number to read. |
NRFY_STATIC_INLINE uint32_t nrfy_gpio_pin_port_number_extract | ( | uint32_t * | p_pin | ) |
[in,out] | p_pin | Pointer to the absolute pin number overridden by the pin number that is relative to the port. |
NRFY_STATIC_INLINE bool nrfy_gpio_pin_present_check | ( | uint32_t | pin_number | ) |
[in] | pin_number | Number of the pin to be checked. |
true | Pin is present. |
false | Pin is not present. |
NRFY_STATIC_INLINE nrf_gpio_pin_pull_t nrfy_gpio_pin_pull_get | ( | uint32_t | pin_number | ) |
pin_number | Specifies the pin number to read. |
Pull | configuration. |
NRFY_STATIC_INLINE uint32_t nrfy_gpio_pin_read | ( | uint32_t | pin_number | ) |
If the value returned by this function is to be valid, the pin's input buffer must be connected.
pin_number | Specifies the pin number to read. |
NRFY_STATIC_INLINE nrf_gpio_pin_sense_t nrfy_gpio_pin_sense_get | ( | uint32_t | pin_number | ) |
pin_number | Specifies the pin number to read. |
NRFY_STATIC_INLINE void nrfy_gpio_pin_set | ( | uint32_t | pin_number | ) |
pin_number | Specifies the pin number to be set. |
NRFY_STATIC_INLINE void nrfy_gpio_pin_toggle | ( | uint32_t | pin_number | ) |
pin_number | Specifies the pin number to toggle. |
NRFY_STATIC_INLINE void nrfy_gpio_pin_write | ( | uint32_t | pin_number, |
uint32_t | value | ||
) |
pin_number | Specifies the pin number to write. |
value | Specifies the value to be written to the pin.
|
NRFY_STATIC_INLINE void nrfy_gpio_port_dir_input_set | ( | NRF_GPIO_Type * | p_reg, |
uint32_t | in_mask | ||
) |
p_reg | Pointer to the structure of registers of the peripheral. |
in_mask | Mask that specifies the pins to be set as input. |
NRFY_STATIC_INLINE void nrfy_gpio_port_dir_output_set | ( | NRF_GPIO_Type * | p_reg, |
uint32_t | out_mask | ||
) |
p_reg | Pointer to the structure of registers of the peripheral. |
out_mask | Mask specifying the pins to set as output. |
NRFY_STATIC_INLINE uint32_t nrfy_gpio_port_dir_read | ( | NRF_GPIO_Type const * | p_reg | ) |
p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE void nrfy_gpio_port_dir_write | ( | NRF_GPIO_Type * | p_reg, |
uint32_t | dir_mask | ||
) |
p_reg | Pointer to the structure of registers of the peripheral. |
dir_mask | Mask that specifies the direction of pins. Bit set means that the given pin is configured as output. |
NRFY_STATIC_INLINE uint32_t nrfy_gpio_port_in_read | ( | NRF_GPIO_Type const * | p_reg | ) |
p_reg | Pointer to the peripheral registers structure. |
NRFY_STATIC_INLINE void nrfy_gpio_port_out_clear | ( | NRF_GPIO_Type * | p_reg, |
uint32_t | clr_mask | ||
) |
p_reg | Pointer to the structure of registers of the peripheral. |
clr_mask | Mask with pins to be set as logical low level. |
NRFY_STATIC_INLINE uint32_t nrfy_gpio_port_out_read | ( | NRF_GPIO_Type const * | p_reg | ) |
p_reg | Pointer to the peripheral registers structure. |
NRFY_STATIC_INLINE void nrfy_gpio_port_out_set | ( | NRF_GPIO_Type * | p_reg, |
uint32_t | set_mask | ||
) |
p_reg | Pointer to the structure of registers of the peripheral. |
set_mask | Mask with pins to be set as logical high level. |
NRFY_STATIC_INLINE void nrfy_gpio_port_out_write | ( | NRF_GPIO_Type * | p_reg, |
uint32_t | value | ||
) |
p_reg | Pointer to the structure of registers of the peripheral. |
value | Output port mask. |
NRFY_STATIC_INLINE void nrfy_gpio_ports_read | ( | uint32_t | start_port, |
uint32_t | length, | ||
uint32_t * | p_masks | ||
) |
start_port | Index of the first port to read. |
length | Number of ports to read. |
p_masks | Pointer to output array where port states will be stored. |
NRFY_STATIC_INLINE void nrfy_gpio_range_cfg_input | ( | uint32_t | pin_range_start, |
uint32_t | pin_range_end, | ||
nrf_gpio_pin_pull_t | pull_config | ||
) |
pin_range_start | Specifies the start number (inclusive) in the range of pin numbers to be configured. |
pin_range_end | Specifies the end number (inclusive) in the range of pin numbers to be configured. |
pull_config | State of the pin range pull resistor (no pull, pulled down, or pulled high). |
NRFY_STATIC_INLINE void nrfy_gpio_range_cfg_output | ( | uint32_t | pin_range_start, |
uint32_t | pin_range_end | ||
) |
pin_range_start | Specifies the start number (inclusive) in the range of pin numbers to be configured. |
pin_range_end | Specifies the end number (inclusive) in the range of pin numbers to be configured. |
NRFY_STATIC_INLINE void nrfy_gpio_reconfigure | ( | uint32_t | pin_number, |
const nrf_gpio_pin_dir_t * | p_dir, | ||
const nrf_gpio_pin_input_t * | p_input, | ||
const nrf_gpio_pin_pull_t * | p_pull, | ||
const nrf_gpio_pin_drive_t * | p_drive, | ||
const nrf_gpio_pin_sense_t * | p_sense | ||
) |
pin_number | Specifies the pin number. |
p_dir | Pin direction. If NULL, previous setting remains. |
p_input | Connect or disconnect the input buffer. If NULL, previous setting remains. |
p_pull | Pull configuration. If NULL, previous setting remains. |
p_drive | Drive configuration. If NULL, previous setting remains. |
p_sense | Pin sensing mechanism. If NULL, previous setting remains. |