123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- #ifndef NRF_DRV_CSENSE_H__
- #define NRF_DRV_CSENSE_H__
- #include <stdint.h>
- #include "sdk_errors.h"
- #include "app_timer.h"
- #define MAX_ANALOG_INPUTS 8
- typedef struct
- {
- uint8_t output_pin;
- }nrf_drv_csense_config_t;
- typedef struct
- {
- uint16_t read_value;
- uint8_t analog_channel;
- }nrf_drv_csense_evt_t;
- typedef void (* nrf_drv_csense_event_handler_t) (nrf_drv_csense_evt_t * p_event_struct);
- ret_code_t nrf_drv_csense_init(nrf_drv_csense_config_t const * p_config, nrf_drv_csense_event_handler_t event_handler);
- ret_code_t nrf_drv_csense_uninit(void);
- void nrf_drv_csense_channels_enable(uint8_t channels_mask);
- void nrf_drv_csense_channels_disable(uint8_t channels_mask);
- uint16_t nrf_drv_csense_channel_read(uint8_t csense_channel);
- ret_code_t nrf_drv_csense_sample(void);
- bool nrf_drv_csense_is_busy(void);
- #endif
|