nRF51 SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
GPIOTE abstraction

GPIOTE abstraction for configuration of channels. More...

Enumerations

enum  nrf_gpiote_polarity_t {
  NRF_GPIOTE_POLARITY_LOTOHI = GPIOTE_CONFIG_POLARITY_LoToHi,
  NRF_GPIOTE_POLARITY_HITOLO = GPIOTE_CONFIG_POLARITY_HiToLo,
  NRF_GPIOTE_POLARITY_TOGGLE = GPIOTE_CONFIG_POLARITY_Toggle
}
 Polarity for GPIOTE channel enumerator. More...
 
enum  nrf_gpiote_outinit_t {
  NRF_GPIOTE_INITIAL_VALUE_LOW = GPIOTE_CONFIG_OUTINIT_Low,
  NRF_GPIOTE_INITIAL_VALUE_HIGH = GPIOTE_CONFIG_OUTINIT_High
}
 Initial output value for GPIOTE channel enumerator. More...
 

Functions

static __INLINE void nrf_gpiote_task_config (uint32_t channel_number, uint32_t pin_number, nrf_gpiote_polarity_t polarity, nrf_gpiote_outinit_t initial_value)
 Function for configuring GPIOTE channel as output, setting the properly desired output level. More...
 
static __INLINE void nrf_gpiote_event_config (uint32_t channel_number, uint32_t pin_number, nrf_gpiote_polarity_t polarity)
 Function for configuring GPIOTE channel as input, automatically clearing an event that appears in some cases under configuration. More...
 
static __INLINE void nrf_gpiote_unconfig (uint32_t channel_number)
 Function for unconfiguring GPIOTE channel. More...
 

Detailed Description

Enumeration Type Documentation

Enumerator
NRF_GPIOTE_POLARITY_LOTOHI 

Low to high.

NRF_GPIOTE_POLARITY_HITOLO 

High to low.

NRF_GPIOTE_POLARITY_TOGGLE 

Toggle.

Enumerator
NRF_GPIOTE_INITIAL_VALUE_LOW 

Low to high.

NRF_GPIOTE_INITIAL_VALUE_HIGH 

High to low.

Function Documentation

static __INLINE void nrf_gpiote_task_config ( uint32_t  channel_number,
uint32_t  pin_number,
nrf_gpiote_polarity_t  polarity,
nrf_gpiote_outinit_t  initial_value 
)
static
Parameters
channel_numberspecifies the GPIOTE channel [0:3] to configure as an output channel.
pin_numberspecifies the pin number [0:30] to use in the GPIOTE channel.
polarityspecifies the desired polarity in the output GPIOTE channel.
initial_valuespecifies the initial value of the GPIOTE channel input after the channel configuration.
static __INLINE void nrf_gpiote_event_config ( uint32_t  channel_number,
uint32_t  pin_number,
nrf_gpiote_polarity_t  polarity 
)
static

Note that the pin must be configured as connected input for this function to have any effect.

Note that when configuring the channel as input an event might be triggered. Care of disabling interrupts for that channel is left to the user.

Parameters
channel_numberspecifies the GPIOTE channel [0:3] to configure as an input channel.
pin_numberspecifies the pin number [0:30] to use in the GPIOTE channel.
polarityspecifies the desired polarity in the output GPIOTE channel.
static __INLINE void nrf_gpiote_unconfig ( uint32_t  channel_number)
static

Note that when unconfiguring the channel, the pin is configured as GPIO PIN_CNF configuration.

Parameters
channel_numberspecifies the GPIOTE channel [0:3] to unconfigure.