Go to the documentation of this file.
38 #include "drv_digital_out.h"
39 #include "drv_digital_in.h"
40 #include "drv_spi_master.h"
53 #define TOUCHKEY3_MAP_MIKROBUS( cfg, mikrobus ) \
54 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
55 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
56 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
57 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
58 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
59 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
66 #define TOUCHKEY3_RETVAL uint8_t
68 #define TOUCHKEY3_OK 0x00
69 #define TOUCHKEY3_INIT_ERROR 0xFF
76 #define TOUCHKEY3_CMD_SENDSETUP 0x01
77 #define TOUCHKEY3_CMD_RESET 0x04
78 #define TOUCHKEY3_CMD_SLEEP 0x05
79 #define TOUCHKEY3_CMD_EEPROM_STORE 0x0A
80 #define TOUCHKEY3_CMD_EEPROM_RESTORE 0x0B
81 #define TOUCHKEY3_CMD_EEPROM_ERASE 0x0C
82 #define TOUCHKEY3_CMD_EEPROM_RECOVER 0x0D
89 #define TOUCHKEY3_CMD_CALLIBRATE_ALL 0x03
90 #define TOUCHKEY3_CMD_CALLIBRATE_0 0x10
91 #define TOUCHKEY3_CMD_CALLIBRATE_1 0x11
92 #define TOUCHKEY3_CMD_CALLIBRATE_2 0x12
93 #define TOUCHKEY3_CMD_CALLIBRATE_3 0x13
94 #define TOUCHKEY3_CMD_CALLIBRATE_4 0x14
95 #define TOUCHKEY3_CMD_CALLIBRATE_5 0x15
96 #define TOUCHKEY3_CMD_CALLIBRATE_6 0x16
103 #define TOUCHKEY3_REQ_FIRST_KEY 0xC0
104 #define TOUCHKEY3_REQ_ALL_KEYS 0xC1
105 #define TOUCHKEY3_REQ_DEVICE_STATUS 0xC2
106 #define TOUCHKEY3_REQ_EEPROM_CRC 0xC3
107 #define TOUCHKEY3_REQ_RAM_CRC 0xC4
108 #define TOUCHKEY3_REQ_ERROR_KEYS 0xC5
115 #define TOUCHKEY3_REQ_LAST_COMMAND 0xC7
116 #define TOUCHKEY3_REQ_SETUP_DATA 0xC8
117 #define TOUCHKEY3_REQ_DEVICE_ID 0xC9
118 #define TOUCHKEY3_REQ_FIRMWARE_VERSION 0xCA
290 #endif // _TOUCHKEY3_H_
uint32_t spi_speed
Definition: touchkey3.h:168
digital_out_t cs
Definition: touchkey3.h:136
pin_name_t sck
Definition: touchkey3.h:158
pin_name_t chip_select
Definition: touchkey3.h:145
pin_name_t miso
Definition: touchkey3.h:156
pin_name_t mosi
Definition: touchkey3.h:157
Click ctx object definition.
Definition: touchkey3.h:131
digital_in_t int_pin
Definition: touchkey3.h:140
pin_name_t rst
Definition: touchkey3.h:163
TOUCHKEY3_RETVAL touchkey3_init(touchkey3_t *ctx, touchkey3_cfg_t *cfg)
Initialization function.
spi_master_t spi
Definition: touchkey3.h:144
void touchkey3_send_request(touchkey3_t *ctx, uint8_t request, uint8_t *p_response)
Send request.
digital_out_t rst
Definition: touchkey3.h:135
pin_name_t cs
Definition: touchkey3.h:159
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_set_data(touchkey3_t *ctx, uint8_t data_address, uint8_t write_data)
Set configuration data.
spi_master_mode_t spi_mode
Definition: touchkey3.h:169
pin_name_t int_pin
Definition: touchkey3.h:164
Click configuration structure definition.
Definition: touchkey3.h:152
void touchkey3_send_setup(touchkey3_t *ctx, uint8_t *p_setup_data)
Send setup data.
void touchkey3_send_command(touchkey3_t *ctx, uint8_t command)
Send command.
void touchkey3_cfg_setup(touchkey3_cfg_t *cfg)
Config Object Initialization function.
void touchkey3_reset(touchkey3_t *ctx)
Reset function.
spi_master_chip_select_polarity_t cs_polarity
Definition: touchkey3.h:170
void touchkey3_get_data(touchkey3_t *ctx, uint8_t data_address, uint8_t *read_data)
Read configuration data.
#define TOUCHKEY3_RETVAL
Definition: touchkey3.h:66