capextend 2.0.0.0
capextend.h File Reference

This file contains API for Cap Extend Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  capextend_t
 Click ctx object definition. More...
 
struct  capextend_cfg_t
 Click configuration structure definition. More...
 

Macros

#define CAPEXTEND_MAP_MIKROBUS(cfg, mikrobus)
 
#define CAPEXTEND_RETVAL   uint8_t
 
#define CAPEXTEND_OK   0x00
 
#define CAPEXTEND_INIT_ERROR   0xFF
 
#define CAPEXTEND_SPM_CFG   0x0D
 
#define CAPEXTEND_SPM_BASE_ADDR   0x0E
 
#define CAPEXTEND_SPM_KEY_MSB   0xAC
 
#define CAPEXTEND_SPM_KEY_LSB   0xAD
 
#define CAPEXTEND_BLOCK_1   0x00
 
#define CAPEXTEND_BLOCK_2   0x08
 
#define CAPEXTEND_BLOCK_3   0x10
 
#define CAPEXTEND_BLOCK_4   0x20
 
#define CAPEXTEND_BLOCK_5   0x28
 
#define CAPEXTEND_BLOCK_6   0x30
 
#define CAPEXTEND_BLOCK_7   0x38
 
#define CAPEXTEND_BLOCK_8   0x40
 
#define CAPEXTEND_BLOCK_9   0x48
 
#define CAPEXTEND_BLOCK_10   0x50
 
#define CAPEXTEND_BLOCK_11   0x58
 
#define CAPEXTEND_BLOCK_12   0x60
 
#define CAPEXTEND_BLOCK_13   0x68
 
#define CAPEXTEND_BLOCK_14   0x70
 
#define CAPEXTEND_BLOCK_15   0x78
 
#define CAPEXTEND_IRQ_SRC   0x00
 
#define CAPEXTEND_CAP_STAT_MSB   0x01
 
#define CAPEXTEND_CAP_STAT_LSB   0x02
 
#define CAPEXTEND_GPI_STAT   0x07
 
#define CAPEXTEND_SPM_STAT   0x08
 
#define CAPEXTEND_COMP_OP_MODE   0x09
 
#define CAPEXTEND_GPO_CTRL   0x0A
 
#define CAPEXTEND_GPP_PIN_ID   0x0B
 
#define CAPEXTEND_GPP_INTENSITY   0x0C
 
#define CAPEXTEND_SOFT_RESET   0xB1
 
#define CAPEXTEND_MON_SCAN_PER   0xF9
 
#define CAPEXTEND_SLAVE_ADDRESS   0x2B
 
#define CAPEXTEND_CAP_DIFF_BA   0xB4
 
#define CAPEXTEND_CAP_RAW_BA   0x80
 
#define CAPEXTEND_CAP_AVG_BA   0x9A
 
#define CAPEXTEND_CAP_DIFF_BLK_1   0xB4
 
#define CAPEXTEND_CAP_DIFF_BLK_2   0xBC
 
#define CAPEXTEND_CAP_DIFF_BLK_3   0xC4
 
#define CAPEXTEND_CAP_AVG_BLK_1   0x80
 
#define CAPEXTEND_CAP_AVG_BLK_2   0x88
 
#define CAPEXTEND_CAP_AVG_BLK_3   0x90
 
#define CAPEXTEND_CAP_RAW_BLK_1   0x9A
 
#define CAPEXTEND_CAP_RAW_BLK_2   0xA2
 
#define CAPEXTEND_CAP_RAW_BLK_3   0xAA
 
#define CAPEXTEND_GPIO_0   0x00
 
#define CAPEXTEND_GPIO_1   0x01
 
#define CAPEXTEND_GPIO_2   0x02
 
#define CAPEXTEND_GPIO_3   0x03
 
#define CAPEXTEND_GPIO_4   0x04
 
#define CAPEXTEND_GPIO_5   0x05
 
#define CAPEXTEND_GPIO_6   0x06
 
#define CAPEXTEND_GPIO_7   0x07
 
#define CAPEXTEND_GPIO_ALL   0x08
 
#define CAPEXTEND_COMMON_SETTINGS   0x01
 
#define CAPEXTEND_INDIVIDUAL_SETTINGS   0x04
 
#define CAPEXTEND_DISABLED   0x00
 
#define CAPEXTEND_BUTTON   0x01
 
#define CAPEXTEND_MULTI_TOUCH   0x00
 
#define CAPEXTEND_SINGLE_TOUCH   0x01
 
#define CAPEXTEND_INT_MASKED   0x00
 
#define CAPEXTEND_INT_TOUCH   0x01
 
#define CAPEXTEND_INT_RELEASE   0x02
 
#define CAPEXTEND_INT_BOTH_TR   0x03
 
#define CAPEXTEND_SMPL_0   0x00
 
#define CAPEXTEND_SMPL_2   0x01
 
#define CAPEXTEND_SMPL_3   0x02
 
#define CAPEXTEND_SMPL_4   0x03
 
#define CAPEXTEND_BTN_0   0x00
 
#define CAPEXTEND_BTN_1   0x01
 
#define CAPEXTEND_BTN_2   0x02
 
#define CAPEXTEND_BTN_3   0x03
 
#define CAPEXTEND_BTN_4   0x04
 
#define CAPEXTEND_BTN_5   0x05
 
#define CAPEXTEND_BTN_6   0x06
 
#define CAPEXTEND_BTN_7   0x07
 
#define CAPEXTEND_BTN_8   0x08
 
#define CAPEXTEND_BTN_9   0x09
 
#define CAPEXTEND_BTN_10   0x0A
 
#define CAPEXTEND_BTN_11   0x0B
 
#define CAPEXTEND_GROUP_0   0x0C
 
#define CAPEXTEND_GROUP_1   0x0D
 
#define CAPEXTEND_GPO   0x00
 
#define CAPEXTEND_GPP   0x01
 
#define CAPEXTEND_GPI   0x02
 
#define CAPEXTEND_LOG   0x00
 
#define CAPEXTEND_LIN   0x01
 
#define CAPEXTEND_EVERY_TIME   0x00
 
#define CAPEXTEND_EVERY_16   0x01
 
#define CAPEXTEND_NONE   0x00
 
#define CAPEXTEND_PULLUP   0x01
 
#define CAPEXTEND_PULLDOWN   0x02
 
#define CAPEXTEND_NO_INT   0x00
 
#define CAPEXTEND_RISING   0x01
 
#define CAPEXTEND_FALLING   0x02
 
#define CAPEXTEND_BOTH   0x03
 
#define CAPEXTEND_OP_MODE_INT   0x01
 
#define CAPEXTEND_COMP_INT   0x02
 
#define CAPEXTEND_BUTTON_INT   0x04
 
#define CAPEXTEND_GPI_INT   0x10
 
#define CAPEXTEND_SPM_INT   0x20
 
#define CAPEXTEND_NVM_INT   0x40
 
#define CAPEXTEND_ACTIVE_MODE   0x00
 
#define CAPEXTEND_DOZE_MODE   0x01
 
#define CAPEXTEND_SLEEP_MODE   0x02
 
#define CAPEXTEND_RAW   0x00
 
#define CAPEXTEND_AVG   0x01
 
#define CAPEXTEND_DIFF   0x02
 
#define CAPEXTEND_MSB_BUTTONS_ADDR   0x01
 
#define CAPEXTEND_LSB_BUTTONS_ADDR   0x02
 

Functions

void capextend_cfg_setup (capextend_cfg_t *cfg)
 Config Object Initialization function.
 
CAPEXTEND_RETVAL capextend_init (capextend_t *ctx, capextend_cfg_t *cfg)
 Initialization function.
 
void capextend_generic_write (capextend_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void capextend_generic_read (capextend_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
int8_t capextend_read_msb_buttons (capextend_t *ctx)
 Read MSB buttons function.
 
int8_t capextend_read_lsb_buttons (capextend_t *ctx)
 Read LSB buttons function.
 
uint16_t capextend_read_buttons (capextend_t *ctx)
 Read buttons function.
 
void capextend_reset (capextend_t *ctx)
 Reset function.
 
void capextend_set_rst_high (capextend_t *ctx)
 Set reset high function.
 
void capextend_set_rst_low (capextend_t *ctx)
 Set reset low function.
 
uint8_t capextend_get_int_input (capextend_t *ctx)
 Get interrupt input function.
 

Detailed Description

This file contains API for Cap Extend Click driver.