touchkey3 2.0.0.0
touchkey3.h File Reference

This file contains API for TouchKey 3 Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"

Go to the source code of this file.

Data Structures

struct  touchkey3_t
 Click ctx object definition. More...
 
struct  touchkey3_cfg_t
 Click configuration structure definition. More...
 

Macros

#define TOUCHKEY3_MAP_MIKROBUS(cfg, mikrobus)
 
#define TOUCHKEY3_RETVAL   uint8_t
 
#define TOUCHKEY3_OK   0x00
 
#define TOUCHKEY3_INIT_ERROR   0xFF
 
#define TOUCHKEY3_CMD_SENDSETUP   0x01
 
#define TOUCHKEY3_CMD_RESET   0x04
 
#define TOUCHKEY3_CMD_SLEEP   0x05
 
#define TOUCHKEY3_CMD_EEPROM_STORE   0x0A
 
#define TOUCHKEY3_CMD_EEPROM_RESTORE   0x0B
 
#define TOUCHKEY3_CMD_EEPROM_ERASE   0x0C
 
#define TOUCHKEY3_CMD_EEPROM_RECOVER   0x0D
 
#define TOUCHKEY3_CMD_CALLIBRATE_ALL   0x03
 
#define TOUCHKEY3_CMD_CALLIBRATE_0   0x10
 
#define TOUCHKEY3_CMD_CALLIBRATE_1   0x11
 
#define TOUCHKEY3_CMD_CALLIBRATE_2   0x12
 
#define TOUCHKEY3_CMD_CALLIBRATE_3   0x13
 
#define TOUCHKEY3_CMD_CALLIBRATE_4   0x14
 
#define TOUCHKEY3_CMD_CALLIBRATE_5   0x15
 
#define TOUCHKEY3_CMD_CALLIBRATE_6   0x16
 
#define TOUCHKEY3_REQ_FIRST_KEY   0xC0
 
#define TOUCHKEY3_REQ_ALL_KEYS   0xC1
 
#define TOUCHKEY3_REQ_DEVICE_STATUS   0xC2
 
#define TOUCHKEY3_REQ_EEPROM_CRC   0xC3
 
#define TOUCHKEY3_REQ_RAM_CRC   0xC4
 
#define TOUCHKEY3_REQ_ERROR_KEYS   0xC5
 
#define TOUCHKEY3_REQ_LAST_COMMAND   0xC7
 
#define TOUCHKEY3_REQ_SETUP_DATA   0xC8
 
#define TOUCHKEY3_REQ_DEVICE_ID   0xC9
 
#define TOUCHKEY3_REQ_FIRMWARE_VERSION   0xCA
 

Functions

void touchkey3_cfg_setup (touchkey3_cfg_t *cfg)
 Config Object Initialization function.
 
TOUCHKEY3_RETVAL touchkey3_init (touchkey3_t *ctx, touchkey3_cfg_t *cfg)
 Initialization function.
 
void touchkey3_reset (touchkey3_t *ctx)
 Reset function.
 
void touchkey3_generic_transfer (touchkey3_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
void touchkey3_send_command (touchkey3_t *ctx, uint8_t command)
 Send command.
 
void touchkey3_send_setup (touchkey3_t *ctx, uint8_t *p_setup_data)
 Send setup data.
 
void touchkey3_send_request (touchkey3_t *ctx, uint8_t request, uint8_t *p_response)
 Send request.
 
void touchkey3_set_data (touchkey3_t *ctx, uint8_t data_address, uint8_t write_data)
 Set configuration data.
 
void touchkey3_get_data (touchkey3_t *ctx, uint8_t data_address, uint8_t *read_data)
 Read configuration data.
 

Detailed Description

This file contains API for TouchKey 3 Click driver.