Module for using the capacitive sensor on low-energy level.
More...
Module for using the capacitive sensor on low-energy level.
Capacitive sensor event handler. Called from conversion handler.
- Parameters
-
[in] | event_struct | Structure holding event parameters. |
uint16_t nrf_drv_csense_channel_read |
( |
uint8_t |
csense_channel | ) |
|
Function for getting the last read value from an analog channel.
- Parameters
-
[in] | csense_channel | Number of the channel to get the value from. |
- Returns
- Analog value measured on the channel.
void nrf_drv_csense_channels_disable |
( |
uint8_t |
channels_mask | ) |
|
Function for disabling analog channels of the capacitive sensor.
- Parameters
-
[in] | channels_mask | Mask of analog channels to be disabled. |
void nrf_drv_csense_channels_enable |
( |
uint8_t |
channels_mask | ) |
|
Function for enabling analog channels for the capacitive sensor.
- Parameters
-
[in] | channels_mask | Mask of analog channels to be enabled. |
Function for initializing the module.
After calling this function, the module is in initialized state and all channels are disabled. The nrf_drv_csense_channels_enable function must be called. This function initializes all modules required by the capacitive sensor library: ADC for (nRF51) or TIMERs, PPIs, and COMP (for nRF52).
- Parameters
-
[in] | p_config | Structure for initializing the module. |
[in] | event_handler | Event handler for capacitive sensor events. |
- Return values
-
NRF_ERROR_INVALID_PARAM | Invalid parameter. |
NRF_ERROR_NO_MEM | Timer operations queue was full. |
NRF_ERROR_INTERNAL | Error occurred during timers, PPI's, or COMP initialization. |
NRF_SUCCESS | Module was initialized successfully. |
- See Also
- nrf_drv_csense_channels_enable
bool nrf_drv_csense_is_busy |
( |
void |
| ) |
|
Function for checking if the module is busy.
- Returns
- True if busy or false if not busy.
Function for triggering a measurement on all enabled analog channels. The handler will be called on every completed measurement.
- Return values
-
NRF_ERROR_BUSY | If the module was busy or SAADC module is in use and was busy. |
NRF_SUCCESS | If the measurement was triggered successfully. |
Function for unintializing the capacitive sensor. Clears the mask of enabled channels.
- Returns
- Values returned by nrf_drv_ppi_channel_free.