nRF5 SDK v17.1.0
Modules | Functions
nRF21540 front-end Bluetooth range extender.

nRF21540 front-end Bluetooth range extender. More...

Modules

 nRF21540 board peripherals driver configuration
 
 nRF21540 front-end Bluetooth range extender types
 

Functions

ret_code_t nrf21540_init (void)
 Initialization of modules needed by nRF21540: More...
 
ret_code_t nrf21540_tx_set (uint32_t user_trigger_event, nrf21540_execution_mode_t mode)
 Set nRF21540 to TX mode. More...
 
ret_code_t nrf21540_rx_set (uint32_t user_trigger_event, nrf21540_execution_mode_t mode)
 Set nRF21540 to TX mode. More...
 
ret_code_t nrf21540_ant_set (nrf21540_antenna_t antenna)
 Function choses one of two physical antenna outputs. More...
 
ret_code_t nrf21540_pwr_mode_set (nrf21540_pwr_mode_t mode)
 Function choses one of two predefined power modes in nRF21540. More...
 
ret_code_t nrf21540_power_down (uint32_t user_trigger_event, nrf21540_execution_mode_t mode)
 nRF21540 power down. More...
 
bool nrf21540_is_error (void)
 Checks if nRF21540 driver is in error state. More...
 

Detailed Description

nRF21540 front-end Bluetooth range extender.

Function Documentation

ret_code_t nrf21540_ant_set ( nrf21540_antenna_t  antenna)

Function choses one of two physical antenna outputs.

Parameters
[in]antennaOne of antenna outputs. See nrf21540_antenna_t.
Returns
NRF based error code. NRF_ERROR_BUSY when driver performs another operation at the moment. NRF_SUCCESS on success.
ret_code_t nrf21540_init ( void  )

Initialization of modules needed by nRF21540:

    - SPI
    - GPIO
    - GPIOTE
    - PPI
    - RADIO
    - NVIC
Returns
NRF based error code. NRF_ERROR_INTERNAL when driver is in error state, or SPI initialization has failed. Reinitialization is required. NRF_ERROR_INVALID_STATE when nRF21540's state isn't proper to perform the operation (
See Also
nrf21540_state_t). NRF_SUCCESS on success.
bool nrf21540_is_error ( void  )

Checks if nRF21540 driver is in error state.

Returns
true if driver is in error state and should be reinitialized.
ret_code_t nrf21540_power_down ( uint32_t  user_trigger_event,
nrf21540_execution_mode_t  mode 
)

nRF21540 power down.

Disables chip functionality and enter power save mode.

Note
Dependently on configuration GPIO or SPI interface will be used.
Parameters
[in]user_trigger_eventevent that triggers start of procedure - this event will be connected to appropriate PPI channel. NRF21540_EXECUTE_NOW value causes start procedure immediately.
[in]modeNRF21540_EXEC_MODE_BLOCKING - function will wait for finishing configuration including settling times required by nRF21540 (waits till all procedure has finished). NRF21540_EXEC_MODE_NON_BLOCKING - function will start procedure and set busy flag. User code can be executed at this time and busy flag will be unset when done.
Returns
NRF_ERROR_INTERNAL when driver is in error state. Reinitialization is required then. NRF_ERROR_INVALID_STATE when nRF21540's state isn't proper to perform the operation (
See Also
nrf21540_state_t). NRF_ERROR_BUSY when driver performs another operation at the moment. NRF_SUCCESS on success.
ret_code_t nrf21540_pwr_mode_set ( nrf21540_pwr_mode_t  mode)

Function choses one of two predefined power modes in nRF21540.

Refer to nRF21540 Objective Product Specification, section: TX power control.

Parameters
[in]modePower mode. See nrf21540_pwr_mode_t.
Returns
NRF based error code. NRF_ERROR_BUSY when driver performs another operation at the moment. NRF_SUCCESS on success.
ret_code_t nrf21540_rx_set ( uint32_t  user_trigger_event,
nrf21540_execution_mode_t  mode 
)

Set nRF21540 to TX mode.

Note
Dependently on configuration GPIO or SPI interface will be used (NRF21540_USE_SPI_MANAGEMENT/NRF21540_USE_GPIO_MANAGEMENT).
Parameters
[in]user_trigger_eventevent that triggers start of procedure - this event will be connected to appropriate PPI channel. NRF21540_EXECUTE_NOW value causes start procedure immediately.
[in]modeNRF21540_EXEC_MODE_BLOCKING - function will wait for finishing configuration including settling times required by nRF21540 (waits till all procedure has finished). NRF21540_EXEC_MODE_NON_BLOCKING - function will start procedure and set busy flag. User code can be executed at this time and busy flag will be unset when done.
Returns
NRF based error code. NRF_ERROR_INTERNAL when driver is in error state. Reinitialization is required. NRF_ERROR_INVALID_STATE when nRF21540's state isn't proper to perform the operation (
See Also
nrf21540_state_t). NRF_SUCCESS on success.
ret_code_t nrf21540_tx_set ( uint32_t  user_trigger_event,
nrf21540_execution_mode_t  mode 
)

Set nRF21540 to TX mode.

Note
Dependently on configuration GPIO or SPI interface will be used.
Parameters
[in]user_trigger_eventevent that triggers start of procedure - this event will be connected to appropriate PPI channel. NRF21540_EXECUTE_NOW value causes start procedure immediately.
[in]modeNRF21540_EXEC_MODE_BLOCKING - function will wait for finishing configuration including settling times required by nRF21540 (waits till all procedure has finished). NRF21540_EXEC_MODE_NON_BLOCKING - function will start procedure and set busy flag. User code can be executed at this time and busy flag will be unset when done.
Returns
NRF based error code. NRF_ERROR_INTERNAL when driver is in error state. Reinitialization is required. NRF_ERROR_INVALID_STATE when nRF21540's state isn't proper to perform the operation (
See Also
nrf21540_state_t). NRF_SUCCESS on success.

Documentation feedback | Developer Zone | Subscribe | Updated