captouch4
2.1.0.0
|
API for configuring and manipulating Cap Touch 4 Click driver. More...
Modules | |
Cap Touch 4 Registers List | |
List of registers of Cap Touch 4 Click driver. | |
Cap Touch 4 Registers Settings | |
Settings for registers of Cap Touch 4 Click driver. | |
Cap Touch 4 MikroBUS Map | |
MikroBUS pin mapping of Cap Touch 4 Click driver. | |
Functions | |
void | captouch4_cfg_setup (captouch4_cfg_t *cfg) |
Cap Touch 4 configuration object setup function. More... | |
err_t | captouch4_init (captouch4_t *ctx, captouch4_cfg_t *cfg) |
Cap Touch 4 initialization function. More... | |
err_t | captouch4_default_cfg (captouch4_t *ctx) |
Cap Touch 4 default configuration function. More... | |
err_t | captouch4_write_reg (captouch4_t *ctx, uint8_t reg, uint8_t data_in) |
Cap Touch 4 write reg function. More... | |
err_t | captouch4_read_reg (captouch4_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Cap Touch 4 read reg function. More... | |
err_t | captouch4_check_communication (captouch4_t *ctx) |
Cap Touch 4 check communication function. More... | |
void | captouch4_enable_device (captouch4_t *ctx) |
Cap Touch 4 enable device function. More... | |
void | captouch4_disable_device (captouch4_t *ctx) |
Cap Touch 4 disable device function. More... | |
err_t | captouch4_read_system_flags (captouch4_t *ctx, uint8_t *sysflags) |
Cap Touch 4 read system flags function. More... | |
err_t | captouch4_read_movement (captouch4_t *ctx, uint8_t *movement) |
Cap Touch 4 read movement function. More... | |
err_t | captouch4_read_cap_counts (captouch4_t *ctx, uint16_t *cap_counts) |
Cap Touch 4 read cap counts function. More... | |
err_t | captouch4_read_lta (captouch4_t *ctx, uint16_t *lta) |
Cap Touch 4 read lta function. More... | |
API for configuring and manipulating Cap Touch 4 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void captouch4_cfg_setup | ( | captouch4_cfg_t * | cfg | ) |
Cap Touch 4 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See captouch4_cfg_t object definition for detailed explanation. |
err_t captouch4_check_communication | ( | captouch4_t * | ctx | ) |
Cap Touch 4 check communication function.
This function checks the communication by reading and verifying the device product and version numbers.
[in] | ctx | : Click context object. See captouch4_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t captouch4_default_cfg | ( | captouch4_t * | ctx | ) |
Cap Touch 4 default configuration function.
This function executes a default configuration of Cap Touch 4 click board.
[in] | ctx | : Click context object. See captouch4_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void captouch4_disable_device | ( | captouch4_t * | ctx | ) |
Cap Touch 4 disable device function.
This function disables the device by setting the EN pin to low logic state.
[in] | ctx | : Click context object. See captouch4_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void captouch4_enable_device | ( | captouch4_t * | ctx | ) |
Cap Touch 4 enable device function.
This function enables the device by setting the EN pin to high logic state.
[in] | ctx | : Click context object. See captouch4_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t captouch4_init | ( | captouch4_t * | ctx, |
captouch4_cfg_t * | cfg | ||
) |
Cap Touch 4 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See captouch4_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See captouch4_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t captouch4_read_cap_counts | ( | captouch4_t * | ctx, |
uint16_t * | cap_counts | ||
) |
Cap Touch 4 read cap counts function.
This function reads the counts number directly proportional to capacitance. The system is calibrated to make the counts as sensitive as possible to changes in capacitance for relative measurements.
[in] | ctx | : Click context object. See captouch4_t object definition for detailed explanation. |
[out] | cap_counts | : 16-bit capacitance counts. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t captouch4_read_lta | ( | captouch4_t * | ctx, |
uint16_t * | lta | ||
) |
Cap Touch 4 read lta function.
This function reads the long-term averate (LTA) value. The LTA is used as reference to compare with capacitance counts.
[in] | ctx | : Click context object. See captouch4_t object definition for detailed explanation. |
[out] | lta | : 16-bit long term average value. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t captouch4_read_movement | ( | captouch4_t * | ctx, |
uint8_t * | movement | ||
) |
Cap Touch 4 read movement function.
This function reads an average of movement pulses over a time period.
[in] | ctx | : Click context object. See captouch4_t object definition for detailed explanation. |
[out] | movement | : 8-bit movement value. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t captouch4_read_reg | ( | captouch4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
Cap Touch 4 read reg function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See captouch4_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 captouch4_read_system_flags | ( | captouch4_t * | ctx, |
uint8_t * | sysflags | ||
) |
Cap Touch 4 read system flags function.
This function reads the system flags register.
[in] | ctx | : Click context object. See captouch4_t object definition for detailed explanation. |
[out] | sysflags | : System flags. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t captouch4_write_reg | ( | captouch4_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in | ||
) |
Cap Touch 4 write reg function.
This function writes a data byte to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See captouch4_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.