Module for using a capacitive sensor on low-energy level.
More...
Module for using a capacitive sensor on low-energy level.
Csense events 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 last read value from an analog channel.
- Parameters
-
[in] | csense_channel | Number of the channel to get 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 enabled. |
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 function module is in initialized state and all channels are disabled, nrf_drv_csense_channels_enable function needs to be called. Initializes all modules needed by capacitive sensor library: ADC for NRF51 or TIMERs, PPIs and COMP for NRF52.
- Parameters
-
[in] | p_config | Structure for initializing module. |
[in] | event_handler | Event handler for capacitor 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 module is busy.
- Returns
- True if busy or false if not busy.
Function for triggering a measurement on all enabled analog channels. Handler will be called on every completed measurement.
- Return values
-
NRF_ERROR_BUSY | If module was busy or ADC module is in use and was busy. |
NRF_SUCCESS | If measurement was triggered successfully. |
Function for unintializing the capacitive sensor. Clears mask of enabled channels.
- Returns
- Values returned by nrf_drv_ppi_channel_free.