capsense 2.0.0.0
|
Functions | |
void | capsense_cfg_setup (capsense_cfg_t *cfg) |
Config Object Initialization function. | |
err_t | capsense_init (capsense_t *ctx, capsense_cfg_t *cfg) |
Initialization function. | |
err_t | capsense_default_cfg (capsense_t *ctx) |
Click Default Configuration function. | |
err_t | capsense_generic_write (capsense_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
err_t | capsense_generic_read (capsense_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
err_t | capsense_write_data (capsense_t *ctx, uint8_t reg_address, uint8_t write_command) |
Generic write data function. | |
err_t | capsense_read_data (capsense_t *ctx, uint8_t reg_address, uint8_t *read_data) |
Read one byte from register address. | |
err_t | capsense_read_data_bytes (capsense_t *ctx, uint8_t reg_address, uint16_t *read_data) |
Read two bytes from register address. | |
err_t | capsense_get_slider_lvl (capsense_t *ctx, uint8_t *slider_lvl) |
Function get slider level. | |
void capsense_cfg_setup | ( | capsense_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
err_t capsense_default_cfg | ( | capsense_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. @description This function executes default configuration for CapSense click. The following configuration is set in main: -Enable pins on B0,B1 and slider as CapSense -Five pins will be used for Slider pads -Two pins will be used for Button pads -Three pins will be used as GPIO 2 for LED and 1 as GPIO2 -Enable strong drive mode for GPIOs -Enable slider -Configure slider resolution -Configure slider resolution -Store Current Configuration to NVM -Reconfigure Device (POR)
err_t capsense_generic_read | ( | capsense_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. @description This function reads data from the desired register. err_t capsense_generic_write | ( | capsense_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. @description This function writes data to the desired register. err_t capsense_get_slider_lvl | ( | capsense_t * | ctx, |
uint8_t * | slider_lvl ) |
Function get slider level.
ctx | Click object. |
slider_lvl | Slider pressed position |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. @description This function gets slider level of click object ctx. err_t capsense_init | ( | capsense_t * | ctx, |
capsense_cfg_t * | cfg ) |
Initialization function.
capsense | Click object. |
cfg | Click configuration structure. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. @description This function initializes all necessary pins and peripherals used for this click. err_t capsense_read_data | ( | capsense_t * | ctx, |
uint8_t | reg_address, | ||
uint8_t * | read_data ) |
Read one byte from register address.
ctx | Click object. |
reg_address | Register address. |
read_data | 8-bit data from addressed register |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. @description This function reads one byte from reg_address. err_t capsense_read_data_bytes | ( | capsense_t * | ctx, |
uint8_t | reg_address, | ||
uint16_t * | read_data ) |
Read two bytes from register address.
ctx | Click object. |
reg_address | Register address |
read_data | 16-bit data from addressed register |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. @description This function reads two bytes from address reg_address. err_t capsense_write_data | ( | capsense_t * | ctx, |
uint8_t | reg_address, | ||
uint8_t | write_command ) |
Generic write data function.
ctx | Click object. |
reg_address | Register address. |
write_command | Command to write. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. @description This function writes one byte to reg_address.