hodcap 2.1.0.0
|
API for configuring and manipulating HOD CAP Click driver. More...
Topics | |
HOD CAP Registers List | |
List of registers of HOD CAP Click driver. | |
HOD CAP Registers Settings | |
Settings for registers of HOD CAP Click driver. | |
HOD CAP MikroBUS Map | |
MikroBUS pin mapping of HOD CAP Click driver. | |
Functions | |
void | hodcap_cfg_setup (hodcap_cfg_t *cfg) |
HOD CAP configuration object setup function. | |
err_t | hodcap_init (hodcap_t *ctx, hodcap_cfg_t *cfg) |
HOD CAP initialization function. | |
err_t | hodcap_default_cfg (hodcap_t *ctx) |
HOD CAP default configuration function. | |
err_t | hodcap_generic_write (hodcap_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
HOD CAP data writing function. | |
err_t | hodcap_generic_read (hodcap_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
HOD CAP data reading function. | |
err_t | hodcap_write_reg (hodcap_t *ctx, uint8_t reg, uint16_t data_in) |
HOD CAP write register function. | |
err_t | hodcap_read_reg (hodcap_t *ctx, uint8_t reg, uint16_t *data_out) |
HOD CAP read register function. | |
err_t | hodcap_get_sensor_id (hodcap_t *ctx, uint16_t *sensor_id) |
HOD CAP gets sensor ID function. | |
err_t | hodcap_get_status (hodcap_t *ctx, hodcap_status_t *status) |
HOD CAP gets sensor status function. | |
err_t | hodcap_check_adc_data_ready (hodcap_t *ctx, uint16_t *data_ready) |
HOD CAP check ADC data ready function. | |
err_t | hodcap_set_adc_op_mode (hodcap_t *ctx, uint16_t adc_op_mode) |
HOD CAP sets the ADC operation mode function. | |
err_t | hodcap_mux_channel_selection (hodcap_t *ctx, uint8_t sen_pos) |
HOD CAP MUX channel selection function. | |
err_t | hodcap_get_i_q_data (hodcap_t *ctx, uint16_t *i_data, uint16_t *q_data) |
HOD CAP gets the I and Q data function. | |
err_t | hodcap_wait_adc_data_ready (hodcap_t *ctx) |
HOD CAP wait ADC data ready function. | |
void | hodcap_set_clk_state (hodcap_t *ctx, uint8_t clk_state) |
HOD CAP set CLK pin state function. | |
API for configuring and manipulating HOD CAP Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void hodcap_cfg_setup | ( | hodcap_cfg_t * | cfg | ) |
HOD CAP configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See hodcap_cfg_t object definition for detailed explanation. |
err_t hodcap_check_adc_data_ready | ( | hodcap_t * | ctx, |
uint16_t * | data_ready ) |
HOD CAP check ADC data ready function.
This function check if ADC data is ready of the AS8579 Capacitive Sensor on the HOD CAP Click board™.
[in] | ctx | : Click context object. See hodcap_t object definition for detailed explanation. |
[out] | data_ready | : ADC data ready. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hodcap_default_cfg | ( | hodcap_t * | ctx | ) |
HOD CAP default configuration function.
This function executes a default configuration of HOD CAP click board.
[in] | ctx | : Click context object. See hodcap_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hodcap_generic_read | ( | hodcap_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
HOD CAP data reading function.
This function reads a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See hodcap_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hodcap_generic_write | ( | hodcap_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
HOD CAP data writing function.
This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See hodcap_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hodcap_get_i_q_data | ( | hodcap_t * | ctx, |
uint16_t * | i_data, | ||
uint16_t * | q_data ) |
HOD CAP gets the I and Q data function.
This function reads the I-Channel and Q-Channel data of the AS8579 Capacitive Sensor on the HOD CAP Click board™.
[in] | ctx | : Click context object. See hodcap_t object definition for detailed explanation. |
[out] | i_data | : I data values. |
[out] | q_data | : Q data values. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hodcap_get_sensor_id | ( | hodcap_t * | ctx, |
uint16_t * | sensor_id ) |
HOD CAP gets sensor ID function.
This function reads a sensor ID of the AS8579 Capacitive Sensor on the HOD CAP Click board™.
[in] | ctx | : Click context object. See hodcap_t object definition for detailed explanation. |
[out] | sensor_id | : Sensor ID. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hodcap_get_status | ( | hodcap_t * | ctx, |
hodcap_status_t * | status ) |
HOD CAP gets sensor status function.
This function reads a sensor status data of the AS8579 Capacitive Sensor on the HOD CAP Click board™.
[in] | ctx | : Click context object. See hodcap_t object definition for detailed explanation. |
[out] | status | : Sensor status object. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hodcap_init | ( | hodcap_t * | ctx, |
hodcap_cfg_t * | cfg ) |
HOD CAP initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See hodcap_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See hodcap_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hodcap_mux_channel_selection | ( | hodcap_t * | ctx, |
uint8_t | sen_pos ) |
HOD CAP MUX channel selection function.
This function is used to select the desired channel (SEN) of the AS8579 Capacitive Sensor on the HOD CAP Click board™.
[in] | ctx | : Click context object. See hodcap_t object definition for detailed explanation. |
[in] | sen_pos | : Channel (SEN) position [0-9]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hodcap_read_reg | ( | hodcap_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out ) |
HOD CAP read register function.
This function reads a 16-bit data from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See hodcap_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : 16-bit output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t hodcap_set_adc_op_mode | ( | hodcap_t * | ctx, |
uint16_t | adc_op_mode ) |
HOD CAP sets the ADC operation mode function.
This function configure the ADC operation mode of the AS8579 Capacitive Sensor on the HOD CAP Click board™.
[in] | ctx | : Click context object. See hodcap_t object definition for detailed explanation. |
[in] | adc_op_mode | : ADC operation mode. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void hodcap_set_clk_state | ( | hodcap_t * | ctx, |
uint8_t | clk_state ) |
HOD CAP set CLK pin state function.
This function sets CLK (PWM) pin state of the AS8579 Capacitive Sensor on the HOD CAP Click board™.
[in] | ctx | : Click context object. See hodcap_t object definition for detailed explanation. |
[in] | clk_state | : Logic value to write. |
err_t hodcap_wait_adc_data_ready | ( | hodcap_t * | ctx | ) |
HOD CAP wait ADC data ready function.
This function wait until ADC has completed accumulation of the AS8579 Capacitive Sensor on the HOD CAP Click board™.
[in] | ctx | : Click context object. See hodcap_t object definition for detailed explanation. |
0
- Success, -1
- Error/Timeout error. See #err_t definition for detailed explanation. err_t hodcap_write_reg | ( | hodcap_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in ) |
HOD CAP write register function.
This function writes a 16-bit data to the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See hodcap_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : 16-bit data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.