Hardware access layer for managing the GPIO peripheral. More...
Macros | |
#define | NRF_GPIO_LATCH_PRESENT |
Symbol indicating whether the functionality of latching GPIO state change is present. | |
#define | NRF_GPIO_HAS_SEL 1 |
Presence of MCU/Subsystem control selection. | |
#define | NRF_GPIO_HAS_MULTIPERIPH_SEL 1 |
Presence of MCU/Subsystem control selection for multiple peripherals. | |
#define | NRF_GPIO_HAS_CLOCKPIN 1 |
Presence of clock pin enable. | |
#define | NRF_GPIO_HAS_PORT_IMPEDANCE 1 |
Presence of drive control for impedance. | |
#define | NRF_GPIO_HAS_RETENTION 1 |
Presence of register retention. | |
#define | NRF_GPIO_HAS_DETECT_MODE 1 |
Presence of detect mode. | |
#define | NRF_GPIO_PIN_MAP(port, pin) NRF_PIN_PORT_TO_PIN_NUMBER(pin, port) |
Macro for mapping port and pin numbers to values understandable for nrf_gpio functions. | |
#define | NRF_GPIO_PORT_IMPEDANCE_ALL_MASK |
Mask of all impedances. | |
Enumerations | |
enum | nrf_gpio_pin_dir_t { NRF_GPIO_PIN_DIR_INPUT = GPIO_PIN_CNF_DIR_Input , NRF_GPIO_PIN_DIR_OUTPUT = GPIO_PIN_CNF_DIR_Output } |
Pin direction definitions. More... | |
enum | nrf_gpio_pin_input_t { NRF_GPIO_PIN_INPUT_CONNECT = GPIO_PIN_CNF_INPUT_Connect , NRF_GPIO_PIN_INPUT_DISCONNECT = GPIO_PIN_CNF_INPUT_Disconnect } |
Connection of input buffer. More... | |
enum | nrf_gpio_pin_pull_t { NRF_GPIO_PIN_NOPULL = GPIO_PIN_CNF_PULL_Disabled , NRF_GPIO_PIN_PULLDOWN = GPIO_PIN_CNF_PULL_Pulldown , NRF_GPIO_PIN_PULLUP = GPIO_PIN_CNF_PULL_Pullup } |
Enumerator used for selecting the pin to be pulled down or up at the time of pin configuration. More... | |
enum | nrf_gpio_pin_drive_t { NRF_GPIO_PIN_S0S1 = GPIO_PIN_CNF_DRIVE_S0S1 , NRF_GPIO_PIN_H0S1 = GPIO_PIN_CNF_DRIVE_H0S1 , NRF_GPIO_PIN_S0H1 = GPIO_PIN_CNF_DRIVE_S0H1 , NRF_GPIO_PIN_H0H1 = GPIO_PIN_CNF_DRIVE_H0H1 , NRF_GPIO_PIN_D0S1 = GPIO_PIN_CNF_DRIVE_D0S1 , NRF_GPIO_PIN_D0H1 = GPIO_PIN_CNF_DRIVE_D0H1 , NRF_GPIO_PIN_S0D1 = GPIO_PIN_CNF_DRIVE_S0D1 , NRF_GPIO_PIN_H0D1 = GPIO_PIN_CNF_DRIVE_H0D1 , NRF_GPIO_PIN_E0S1 = GPIO_PIN_CNF_DRIVE_E0S1 , NRF_GPIO_PIN_S0E1 = GPIO_PIN_CNF_DRIVE_S0E1 , NRF_GPIO_PIN_E0E1 = GPIO_PIN_CNF_DRIVE_E0E1 , NRF_GPIO_PIN_E0H1 = GPIO_PIN_CNF_DRIVE_E0H1 , NRF_GPIO_PIN_H0E1 = GPIO_PIN_CNF_DRIVE_H0E1 , NRF_GPIO_PIN_D0E1 = GPIO_PIN_CNF_DRIVE_D0E1 , NRF_GPIO_PIN_E0D1 = GPIO_PIN_CNF_DRIVE_E0D1 } |
Enumerator used for selecting output drive mode. More... | |
enum | nrf_gpio_pin_sense_t { NRF_GPIO_PIN_NOSENSE = GPIO_PIN_CNF_SENSE_Disabled , NRF_GPIO_PIN_SENSE_LOW = GPIO_PIN_CNF_SENSE_Low , NRF_GPIO_PIN_SENSE_HIGH = GPIO_PIN_CNF_SENSE_High } |
Enumerator used for selecting the pin to sense high or low level on the pin input. More... | |
enum | nrf_gpio_pin_sel_t { NRF_GPIO_PIN_SEL_APP = GPIO_PIN_CNF_MCUSEL_AppMCU , NRF_GPIO_PIN_SEL_NETWORK = GPIO_PIN_CNF_MCUSEL_NetworkMCU , NRF_GPIO_PIN_SEL_PERIPHERAL = GPIO_PIN_CNF_MCUSEL_Peripheral , NRF_GPIO_PIN_SEL_TND = GPIO_PIN_CNF_MCUSEL_TND , NRF_GPIO_PIN_SEL_GPIO = GPIO_PIN_CNF_CTRLSEL_GPIO , NRF_GPIO_PIN_SEL_VPR = GPIO_PIN_CNF_CTRLSEL_VPR , NRF_GPIO_PIN_SEL_GRTC = GPIO_PIN_CNF_CTRLSEL_GRTC } |
Enumerator used for selecting the MCU/Subsystem to control the specified pin. More... | |
enum | nrf_gpio_port_impedance_mask_t { NRF_GPIO_PORT_IMPEDANCE_50_MASK = GPIO_PORTCNF_DRIVECTRL_IMPEDANCE50_Msk , NRF_GPIO_PORT_IMPEDANCE_100_MASK = GPIO_PORTCNF_DRIVECTRL_IMPEDANCE100_Msk , NRF_GPIO_PORT_IMPEDANCE_200_MASK = GPIO_PORTCNF_DRIVECTRL_IMPEDANCE200_Msk , NRF_GPIO_PORT_IMPEDANCE_400_MASK = GPIO_PORTCNF_DRIVECTRL_IMPEDANCE400_Msk , NRF_GPIO_PORT_IMPEDANCE_800_MASK = GPIO_PORTCNF_DRIVECTRL_IMPEDANCE800_Msk , NRF_GPIO_PORT_IMPEDANCE_1600_MASK = GPIO_PORTCNF_DRIVECTRL_IMPEDANCE1600_Msk } |
Port impedance enable mask. More... | |
enum | nrf_gpio_retain_mask_t { NRF_GPIO_RETAIN_APPLICATION_MASK = GPIO_RETAIN_APPLICAION_Msk , NRF_GPIO_RETAIN_NETWORK_MASK = GPIO_RETAIN_RADIOCORE_Msk } |
Retention enable mask. More... | |
Functions | |
NRF_STATIC_INLINE void | nrf_gpio_range_cfg_output (uint32_t pin_range_start, uint32_t pin_range_end) |
Function for configuring the GPIO pin range as output pins with normal drive strength. This function can be used to configure pin range as simple output with gate driving GPIO_PIN_CNF_DRIVE_S0S1 (normal cases). | |
NRF_STATIC_INLINE void | nrf_gpio_range_cfg_input (uint32_t pin_range_start, uint32_t pin_range_end, nrf_gpio_pin_pull_t pull_config) |
Function for configuring the GPIO pin range as input pins with given initial value set, hiding inner details. This function can be used to configure pin range as simple input. | |
NRF_STATIC_INLINE void | nrf_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) |
Pin configuration function. | |
NRF_STATIC_INLINE void | nrf_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) |
Function for reconfiguring pin. | |
NRF_STATIC_INLINE void | nrf_gpio_cfg_output (uint32_t pin_number) |
Function for configuring the given GPIO pin number as output, hiding inner details. This function can be used to configure a pin as simple output with gate driving GPIO_PIN_CNF_DRIVE_S0S1 (normal cases). | |
NRF_STATIC_INLINE void | nrf_gpio_cfg_input (uint32_t pin_number, nrf_gpio_pin_pull_t pull_config) |
Function for configuring the given GPIO pin number as input, hiding inner details. This function can be used to configure a pin as simple input. | |
NRF_STATIC_INLINE void | nrf_gpio_cfg_default (uint32_t pin_number) |
Function for resetting pin configuration to its default state. | |
NRF_STATIC_INLINE void | nrf_gpio_cfg_watcher (uint32_t pin_number) |
Function for configuring the given GPIO pin number as a watcher. Only input is connected. | |
NRF_STATIC_INLINE void | nrf_gpio_input_disconnect (uint32_t pin_number) |
Function for disconnecting input for the given GPIO. | |
NRF_STATIC_INLINE void | nrf_gpio_cfg_sense_input (uint32_t pin_number, nrf_gpio_pin_pull_t pull_config, nrf_gpio_pin_sense_t sense_config) |
Function for configuring the given GPIO pin number as input, hiding inner details. This function can be used to configure pin range as simple input. Sense capability on the pin is configurable and input is connected to buffer so that the GPIO->IN register is readable. | |
NRF_STATIC_INLINE void | nrf_gpio_cfg_sense_set (uint32_t pin_number, nrf_gpio_pin_sense_t sense_config) |
Function for configuring sense level for the given GPIO. | |
NRF_STATIC_INLINE void | nrf_gpio_pin_dir_set (uint32_t pin_number, nrf_gpio_pin_dir_t direction) |
Function for setting the direction for a GPIO pin. | |
NRF_STATIC_INLINE void | nrf_gpio_pin_set (uint32_t pin_number) |
Function for setting a GPIO pin. | |
NRF_STATIC_INLINE void | nrf_gpio_pin_clear (uint32_t pin_number) |
Function for clearing a GPIO pin. | |
NRF_STATIC_INLINE void | nrf_gpio_pin_toggle (uint32_t pin_number) |
Function for toggling a GPIO pin. | |
NRF_STATIC_INLINE void | nrf_gpio_pin_write (uint32_t pin_number, uint32_t value) |
Function for writing a value to a GPIO pin. | |
NRF_STATIC_INLINE uint32_t | nrf_gpio_pin_read (uint32_t pin_number) |
Function for reading the input level of a GPIO pin. | |
NRF_STATIC_INLINE uint32_t | nrf_gpio_pin_out_read (uint32_t pin_number) |
Function for reading the output level of a GPIO pin. | |
NRF_STATIC_INLINE nrf_gpio_pin_sense_t | nrf_gpio_pin_sense_get (uint32_t pin_number) |
Function for reading the sense configuration of a GPIO pin. | |
NRF_STATIC_INLINE nrf_gpio_pin_dir_t | nrf_gpio_pin_dir_get (uint32_t pin_number) |
Function for reading the direction configuration of a GPIO pin. | |
NRF_STATIC_INLINE nrf_gpio_pin_input_t | nrf_gpio_pin_input_get (uint32_t pin_number) |
Function for reading the status of GPIO pin input buffer. | |
NRF_STATIC_INLINE nrf_gpio_pin_pull_t | nrf_gpio_pin_pull_get (uint32_t pin_number) |
Function for reading the pull configuration of a GPIO pin. | |
NRF_STATIC_INLINE void | nrf_gpio_port_dir_output_set (NRF_GPIO_Type *p_reg, uint32_t out_mask) |
Function for setting output direction on the selected pins on the given port. | |
NRF_STATIC_INLINE void | nrf_gpio_port_dir_input_set (NRF_GPIO_Type *p_reg, uint32_t in_mask) |
Function for setting input direction on selected pins on a given port. | |
NRF_STATIC_INLINE void | nrf_gpio_port_dir_write (NRF_GPIO_Type *p_reg, uint32_t dir_mask) |
Function for writing the direction configuration of the GPIO pins in the given port. | |
NRF_STATIC_INLINE uint32_t | nrf_gpio_port_dir_read (NRF_GPIO_Type const *p_reg) |
Function for reading the direction configuration of a GPIO port. | |
NRF_STATIC_INLINE uint32_t | nrf_gpio_port_in_read (NRF_GPIO_Type const *p_reg) |
Function for reading the input signals of the GPIO pins on the given port. | |
NRF_STATIC_INLINE uint32_t | nrf_gpio_port_out_read (NRF_GPIO_Type const *p_reg) |
Function for reading the output signals of the GPIO pins on the given port. | |
NRF_STATIC_INLINE void | nrf_gpio_port_out_write (NRF_GPIO_Type *p_reg, uint32_t value) |
Function for writing the GPIO pins output on a given port. | |
NRF_STATIC_INLINE void | nrf_gpio_port_out_set (NRF_GPIO_Type *p_reg, uint32_t set_mask) |
Function for setting high level on selected the GPIO pins on the given port. | |
NRF_STATIC_INLINE void | nrf_gpio_port_out_clear (NRF_GPIO_Type *p_reg, uint32_t clr_mask) |
Function for setting low level on selected the GPIO pins on the given port. | |
NRF_STATIC_INLINE void | nrf_gpio_ports_read (uint32_t start_port, uint32_t length, uint32_t *p_masks) |
Function for reading pin state of multiple consecutive ports. | |
NRF_STATIC_INLINE void | nrf_gpio_port_impedance_set (NRF_GPIO_Type *p_reg, uint32_t mask) |
Function for setting the impedance matching of the pins on the given port. | |
NRF_STATIC_INLINE uint32_t | nrf_gpio_port_impedance_get (NRF_GPIO_Type const *p_reg) |
Function for geting the impedance matching of the pins on the given port. | |
NRF_STATIC_INLINE void | nrf_gpio_port_retain_set (NRF_GPIO_Type *p_reg, uint32_t mask) |
Function for setting the retention of the registers. | |
NRF_STATIC_INLINE uint32_t | nrf_gpio_port_retain_get (NRF_GPIO_Type const *p_reg) |
Function for geting the retention setting of the registers. | |
NRF_STATIC_INLINE void | nrf_gpio_port_detect_latch_set (NRF_GPIO_Type *p_reg, bool enable) |
Function for setting the latched detect behaviour. | |
NRF_STATIC_INLINE bool | nrf_gpio_port_detect_latch_check (NRF_GPIO_Type const *p_reg) |
Function for checking the latched detect behaviour. | |
NRF_STATIC_INLINE void | nrf_gpio_latches_read (uint32_t start_port, uint32_t length, uint32_t *p_masks) |
Function for reading latch state of multiple consecutive ports. | |
NRF_STATIC_INLINE void | nrf_gpio_latches_read_and_clear (uint32_t start_port, uint32_t length, uint32_t *p_masks) |
Function for reading and immediate clearing latch state of multiple consecutive ports. | |
NRF_STATIC_INLINE uint32_t | nrf_gpio_pin_latch_get (uint32_t pin_number) |
Function for reading latch state of single pin. | |
NRF_STATIC_INLINE void | nrf_gpio_pin_latch_clear (uint32_t pin_number) |
Function for clearing latch state of a single pin. | |
NRF_STATIC_INLINE void | nrf_gpio_pin_control_select (uint32_t pin_number, nrf_gpio_pin_sel_t ctrl) |
Function for selecting the MCU or Subsystem to control a GPIO pin. | |
NRF_STATIC_INLINE void | nrf_gpio_pin_clock_set (uint32_t pin_number, bool enable) |
Function for setting whether the clock should be enabled for the specified GPIO pin. | |
NRF_STATIC_INLINE bool | nrf_gpio_pin_clock_check (uint32_t pin_number) |
Function for getting the clock enable setting for the specified GPIO pin. | |
NRF_STATIC_INLINE bool | nrf_gpio_pin_present_check (uint32_t pin_number) |
Function for checking if provided pin is present on the MCU. | |
NRF_STATIC_INLINE uint32_t | nrf_gpio_pin_port_number_extract (uint32_t *p_pin) |
Function for extracting port number and the relative pin number from the absolute pin number. | |
NRF_STATIC_INLINE NRF_GPIO_Type * | nrf_gpio_pin_port_decode (uint32_t *p_pin) |
Function for extracting port and the relative pin number from the absolute pin number. | |
Hardware access layer for managing the GPIO peripheral.
#define NRF_GPIO_PORT_IMPEDANCE_ALL_MASK |
Mask of all impedances.
enum nrf_gpio_pin_dir_t |
enum nrf_gpio_pin_drive_t |
Enumerator used for selecting output drive mode.
enum nrf_gpio_pin_input_t |
enum nrf_gpio_pin_pull_t |
enum nrf_gpio_pin_sel_t |
Enumerator used for selecting the MCU/Subsystem to control the specified pin.
enum nrf_gpio_pin_sense_t |
Port impedance enable mask.
NRF_STATIC_INLINE void nrf_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 | ||
) |
Pin configuration function.
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. |
NRF_STATIC_INLINE void nrf_gpio_cfg_default | ( | uint32_t | pin_number | ) |
Function for resetting pin configuration to its default state.
pin_number | Specifies the pin number. |
NRF_STATIC_INLINE void nrf_gpio_cfg_input | ( | uint32_t | pin_number, |
nrf_gpio_pin_pull_t | pull_config | ||
) |
Function for configuring the given GPIO pin number as input, hiding inner details. This function can be used to configure a pin as simple input.
pin_number | Specifies the pin number. |
pull_config | State of the pin range pull resistor (no pull, pulled down, or pulled high). |
NRF_STATIC_INLINE void nrf_gpio_cfg_output | ( | uint32_t | pin_number | ) |
Function for configuring the given GPIO pin number as output, hiding inner details. This function can be used to configure a pin as simple output with gate driving GPIO_PIN_CNF_DRIVE_S0S1 (normal cases).
pin_number | Specifies the pin number. |
NRF_STATIC_INLINE void nrf_gpio_cfg_sense_input | ( | uint32_t | pin_number, |
nrf_gpio_pin_pull_t | pull_config, | ||
nrf_gpio_pin_sense_t | sense_config | ||
) |
Function for configuring the given GPIO pin number as input, hiding inner details. This function can be used to configure pin range as simple input. Sense capability on the pin is configurable and input is connected to buffer so that the GPIO->IN register is readable.
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). |
NRF_STATIC_INLINE void nrf_gpio_cfg_sense_set | ( | uint32_t | pin_number, |
nrf_gpio_pin_sense_t | sense_config | ||
) |
Function for configuring sense level for the given GPIO.
pin_number | Specifies the pin number. |
sense_config | Sense configuration. |
NRF_STATIC_INLINE void nrf_gpio_cfg_watcher | ( | uint32_t | pin_number | ) |
Function for configuring the given GPIO pin number as a watcher. Only input is connected.
pin_number | Specifies the pin number. |
NRF_STATIC_INLINE void nrf_gpio_input_disconnect | ( | uint32_t | pin_number | ) |
Function for disconnecting input for the given GPIO.
pin_number | Specifies the pin number. |
NRF_STATIC_INLINE void nrf_gpio_latches_read | ( | uint32_t | start_port, |
uint32_t | length, | ||
uint32_t * | p_masks | ||
) |
Function for reading latch state of multiple consecutive ports.
start_port | Index of the first port to read. |
length | Number of ports to read. |
p_masks | Pointer to output array where latch states will be stored. |
NRF_STATIC_INLINE void nrf_gpio_latches_read_and_clear | ( | uint32_t | start_port, |
uint32_t | length, | ||
uint32_t * | p_masks | ||
) |
Function for reading and immediate clearing latch state of multiple consecutive ports.
start_port | Index of the first port to read and clear. |
length | Number of ports to read and clear. |
p_masks | Pointer to output array where latch states will be stored. |
NRF_STATIC_INLINE void nrf_gpio_pin_clear | ( | uint32_t | pin_number | ) |
Function for clearing a GPIO pin.
pin_number | Specifies the pin number to clear. |
NRF_STATIC_INLINE bool nrf_gpio_pin_clock_check | ( | uint32_t | pin_number | ) |
Function for getting the clock enable setting for the specified GPIO pin.
[in] | pin_number | Pin number. |
true | Clock is enabled. |
false | Clock is disabled. |
NRF_STATIC_INLINE void nrf_gpio_pin_clock_set | ( | uint32_t | pin_number, |
bool | enable | ||
) |
Function for setting whether the clock should be enabled for the specified GPIO pin.
[in] | pin_number | Pin number. |
[in] | enable | True if clock is to be enabled, false otherwise. |
NRF_STATIC_INLINE void nrf_gpio_pin_control_select | ( | uint32_t | pin_number, |
nrf_gpio_pin_sel_t | ctrl | ||
) |
Function for selecting the MCU or Subsystem to control a GPIO pin.
pin_number | Pin_number. |
ctrl | MCU/Subsystem to control the pin. |
NRF_STATIC_INLINE nrf_gpio_pin_dir_t nrf_gpio_pin_dir_get | ( | uint32_t | pin_number | ) |
Function for reading the direction configuration of a GPIO pin.
pin_number | Specifies the pin number to read. |
NRF_STATIC_INLINE void nrf_gpio_pin_dir_set | ( | uint32_t | pin_number, |
nrf_gpio_pin_dir_t | direction | ||
) |
Function for setting the direction for a GPIO pin.
pin_number | Specifies the pin number for which to set the direction. |
direction | Specifies the direction. |
NRF_STATIC_INLINE nrf_gpio_pin_input_t nrf_gpio_pin_input_get | ( | uint32_t | pin_number | ) |
Function for reading the status of GPIO pin input buffer.
pin_number | Pin number to be read. |
Input | buffer configuration. |
NRF_STATIC_INLINE void nrf_gpio_pin_latch_clear | ( | uint32_t | pin_number | ) |
Function for clearing latch state of a single pin.
pin_number | Pin number. |
NRF_STATIC_INLINE uint32_t nrf_gpio_pin_latch_get | ( | uint32_t | pin_number | ) |
Function for reading latch state of single pin.
pin_number | Pin number. |
NRF_STATIC_INLINE uint32_t nrf_gpio_pin_out_read | ( | uint32_t | pin_number | ) |
Function for reading the output level of a GPIO pin.
pin_number | Specifies the pin number to read. |
NRF_STATIC_INLINE NRF_GPIO_Type * nrf_gpio_pin_port_decode | ( | uint32_t * | p_pin | ) |
Function for extracting port and the relative pin number from the absolute pin number.
[in,out] | p_pin | Pointer to the absolute pin number overridden by the pin number that is relative to the port. |
NRF_STATIC_INLINE uint32_t nrf_gpio_pin_port_number_extract | ( | uint32_t * | p_pin | ) |
Function for extracting port number and the relative pin number from the absolute pin number.
[in,out] | p_pin | Pointer to the absolute pin number overridden by the pin number that is relative to the port. |
NRF_STATIC_INLINE bool nrf_gpio_pin_present_check | ( | uint32_t | pin_number | ) |
Function for checking if provided pin is present on the MCU.
[in] | pin_number | Number of the pin to be checked. |
true | Pin is present. |
false | Pin is not present. |
NRF_STATIC_INLINE nrf_gpio_pin_pull_t nrf_gpio_pin_pull_get | ( | uint32_t | pin_number | ) |
Function for reading the pull configuration of a GPIO pin.
pin_number | Specifies the pin number to read. |
Pull | configuration. |
NRF_STATIC_INLINE uint32_t nrf_gpio_pin_read | ( | uint32_t | pin_number | ) |
Function for reading the input level of a GPIO pin.
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. |
NRF_STATIC_INLINE nrf_gpio_pin_sense_t nrf_gpio_pin_sense_get | ( | uint32_t | pin_number | ) |
Function for reading the sense configuration of a GPIO pin.
pin_number | Specifies the pin number to read. |
NRF_STATIC_INLINE void nrf_gpio_pin_set | ( | uint32_t | pin_number | ) |
Function for setting a GPIO pin.
pin_number | Specifies the pin number to be set. |
NRF_STATIC_INLINE void nrf_gpio_pin_toggle | ( | uint32_t | pin_number | ) |
Function for toggling a GPIO pin.
pin_number | Specifies the pin number to toggle. |
NRF_STATIC_INLINE void nrf_gpio_pin_write | ( | uint32_t | pin_number, |
uint32_t | value | ||
) |
Function for writing a value to a GPIO pin.
pin_number | Specifies the pin number to write. |
value | Specifies the value to be written to the pin.
|
NRF_STATIC_INLINE bool nrf_gpio_port_detect_latch_check | ( | NRF_GPIO_Type const * | p_reg | ) |
Function for checking the latched detect behaviour.
p_reg | Pointer to the structure of registers of the peripheral. |
true | Latched LDETECT behaviour is used. |
false | DETECT is directly connected to PIN DETECT signals. |
NRF_STATIC_INLINE void nrf_gpio_port_detect_latch_set | ( | NRF_GPIO_Type * | p_reg, |
bool | enable | ||
) |
Function for setting the latched detect behaviour.
p_reg | Pointer to the structure of registers of the peripheral. |
enable | True if the latched LDETECT behaviour is to be used, false if DETECT is to be directly connected to PIN DETECT signals. |
NRF_STATIC_INLINE void nrf_gpio_port_dir_input_set | ( | NRF_GPIO_Type * | p_reg, |
uint32_t | in_mask | ||
) |
Function for setting input direction on selected pins on a given port.
p_reg | Pointer to the structure of registers of the peripheral. |
in_mask | Mask that specifies the pins to be set as input. |
NRF_STATIC_INLINE void nrf_gpio_port_dir_output_set | ( | NRF_GPIO_Type * | p_reg, |
uint32_t | out_mask | ||
) |
Function for setting output direction on the selected pins on the given port.
p_reg | Pointer to the structure of registers of the peripheral. |
out_mask | Mask specifying the pins to set as output. |
NRF_STATIC_INLINE uint32_t nrf_gpio_port_dir_read | ( | NRF_GPIO_Type const * | p_reg | ) |
Function for reading the direction configuration of a GPIO port.
p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_gpio_port_dir_write | ( | NRF_GPIO_Type * | p_reg, |
uint32_t | dir_mask | ||
) |
Function for writing the direction configuration of the GPIO pins in the given port.
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. |
NRF_STATIC_INLINE uint32_t nrf_gpio_port_impedance_get | ( | NRF_GPIO_Type const * | p_reg | ) |
Function for geting the impedance matching of the pins on the given port.
p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_gpio_port_impedance_set | ( | NRF_GPIO_Type * | p_reg, |
uint32_t | mask | ||
) |
Function for setting the impedance matching of the pins on the given port.
p_reg | Pointer to the structure of registers of the peripheral. |
mask | Mask of impedances to be set, created using nrf_gpio_port_impedance_mask_t. |
NRF_STATIC_INLINE uint32_t nrf_gpio_port_in_read | ( | NRF_GPIO_Type const * | p_reg | ) |
Function for reading the input signals of the GPIO pins on the given port.
p_reg | Pointer to the peripheral registers structure. |
NRF_STATIC_INLINE void nrf_gpio_port_out_clear | ( | NRF_GPIO_Type * | p_reg, |
uint32_t | clr_mask | ||
) |
Function for setting low level on selected the GPIO pins on the given port.
p_reg | Pointer to the structure of registers of the peripheral. |
clr_mask | Mask with pins to be set as logical low level. |
NRF_STATIC_INLINE uint32_t nrf_gpio_port_out_read | ( | NRF_GPIO_Type const * | p_reg | ) |
Function for reading the output signals of the GPIO pins on the given port.
p_reg | Pointer to the peripheral registers structure. |
NRF_STATIC_INLINE void nrf_gpio_port_out_set | ( | NRF_GPIO_Type * | p_reg, |
uint32_t | set_mask | ||
) |
Function for setting high level on selected the GPIO pins on the given port.
p_reg | Pointer to the structure of registers of the peripheral. |
set_mask | Mask with pins to be set as logical high level. |
NRF_STATIC_INLINE void nrf_gpio_port_out_write | ( | NRF_GPIO_Type * | p_reg, |
uint32_t | value | ||
) |
Function for writing the GPIO pins output on a given port.
p_reg | Pointer to the structure of registers of the peripheral. |
value | Output port mask. |
NRF_STATIC_INLINE uint32_t nrf_gpio_port_retain_get | ( | NRF_GPIO_Type const * | p_reg | ) |
Function for geting the retention setting of the registers.
p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_gpio_port_retain_set | ( | NRF_GPIO_Type * | p_reg, |
uint32_t | mask | ||
) |
Function for setting the retention of the registers.
p_reg | Pointer to the structure of registers of the peripheral. |
mask | Mask of retention domains to be enabled, created using nrf_gpio_retain_mask_t. |
NRF_STATIC_INLINE void nrf_gpio_ports_read | ( | uint32_t | start_port, |
uint32_t | length, | ||
uint32_t * | p_masks | ||
) |
Function for reading pin state of multiple consecutive ports.
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. |
NRF_STATIC_INLINE void nrf_gpio_range_cfg_input | ( | uint32_t | pin_range_start, |
uint32_t | pin_range_end, | ||
nrf_gpio_pin_pull_t | pull_config | ||
) |
Function for configuring the GPIO pin range as input pins with given initial value set, hiding inner details. This function can be used to configure pin range as simple input.
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). |
NRF_STATIC_INLINE void nrf_gpio_range_cfg_output | ( | uint32_t | pin_range_start, |
uint32_t | pin_range_end | ||
) |
Function for configuring the GPIO pin range as output pins with normal drive strength. This function can be used to configure pin range as simple output with gate driving GPIO_PIN_CNF_DRIVE_S0S1 (normal cases).
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. |
NRF_STATIC_INLINE void nrf_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 | ||
) |
Function for reconfiguring pin.
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. |