capsense2 2.0.0.0
|
API for configuring and manipulating CapSense 2 Click driver. More...
Topics | |
CapSense 2 Registers List | |
List of registers of CapSense 2 Click driver. | |
CapSense 2 Registers Settings | |
Settings for registers of CapSense 2 Click driver. | |
CapSense 2 MikroBUS Map | |
MikroBUS pin mapping of CapSense 2 Click driver. | |
Functions | |
void | capsense2_cfg_setup (capsense2_cfg_t *cfg) |
CapSense 2 configuration object setup function. | |
err_t | capsense2_init (capsense2_t *ctx, capsense2_cfg_t *cfg) |
CapSense 2 initialization function. | |
err_t | capsense2_default_cfg (capsense2_t *ctx) |
CapSense 2 default configuration function. | |
err_t | capsense2_generic_write (capsense2_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
CapSense 2 I2C writing function. | |
err_t | capsense2_generic_read (capsense2_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
CapSense 2 I2C reading function. | |
err_t | capsense2_write_register (capsense2_t *ctx, uint8_t reg, uint8_t data_in) |
CapSense 2 write register function. | |
err_t | capsense2_read_register (capsense2_t *ctx, uint8_t reg, uint8_t *data_out) |
CapSense 2 read register function. | |
void | capsense2_set_reset_pin (capsense2_t *ctx, uint8_t state) |
CapSense 2 set reset pin function. | |
uint8_t | capsense2_get_alert_pin (capsense2_t *ctx) |
CapSense 2 get alert pin function. | |
void | capsense2_reset_device (capsense2_t *ctx) |
CapSense 2 reset device function. | |
err_t | capsense2_check_communication (capsense2_t *ctx) |
CapSense 2 check communication function. | |
err_t | capsense2_clear_interrupt (capsense2_t *ctx) |
CapSense 2 clear interrupt function. | |
API for configuring and manipulating CapSense 2 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void capsense2_cfg_setup | ( | capsense2_cfg_t * | cfg | ) |
CapSense 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See capsense2_cfg_t object definition for detailed explanation. |
err_t capsense2_check_communication | ( | capsense2_t * | ctx | ) |
CapSense 2 check communication function.
This function checks the communication by reading and verifying the chip identification numbers.
[in] | ctx | : Click context object. See capsense2_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t capsense2_clear_interrupt | ( | capsense2_t * | ctx | ) |
CapSense 2 clear interrupt function.
This function clears the INT bit of the main status register if the interrupt pin is asserted.
[in] | ctx | : Click context object. See capsense2_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t capsense2_default_cfg | ( | capsense2_t * | ctx | ) |
CapSense 2 default configuration function.
This function executes a default configuration of CapSense 2 click board.
[in] | ctx | : Click context object. See capsense2_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t capsense2_generic_read | ( | capsense2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
CapSense 2 I2C reading 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 capsense2_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t capsense2_generic_write | ( | capsense2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len ) |
CapSense 2 I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See capsense2_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_buf | : Data to be written. |
[in] | tx_len | : Number of bytes to be written. |
0
- Success, -1
- Error.uint8_t capsense2_get_alert_pin | ( | capsense2_t * | ctx | ) |
CapSense 2 get alert pin function.
This function returns the alert pin logic state.
[in] | ctx | : Click context object. See capsense2_t object definition for detailed explanation. |
err_t capsense2_init | ( | capsense2_t * | ctx, |
capsense2_cfg_t * | cfg ) |
CapSense 2 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See capsense2_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See capsense2_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t capsense2_read_register | ( | capsense2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
CapSense 2 read register function.
This function reads a data byte from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See capsense2_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error.void capsense2_reset_device | ( | capsense2_t * | ctx | ) |
CapSense 2 reset device function.
This function performs the device reset by toggling the RST pin.
[in] | ctx | : Click context object. See capsense2_t object definition for detailed explanation. |
void capsense2_set_reset_pin | ( | capsense2_t * | ctx, |
uint8_t | state ) |
CapSense 2 set reset pin function.
This function sets the RST pin to a desired logic state.
[in] | ctx | : Click context object. See capsense2_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
err_t capsense2_write_register | ( | capsense2_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
CapSense 2 write register function.
This function writes a data byte to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See capsense2_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error.