42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_spi_master.h"
67#define C4X4KEY_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
69 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
70 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
71 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS )
79#define C4X4KEY_RETVAL uint8_t
81#define C4X4KEY_OK 0x00
82#define C4X4KEY_INIT_ERROR 0xFF
86#define C4X4KEY_BUTTON_0 0xEFFF
87#define C4X4KEY_BUTTON_1 0xFFFE
88#define C4X4KEY_BUTTON_2 0xFFFD
89#define C4X4KEY_BUTTON_3 0xFFFB
90#define C4X4KEY_BUTTON_4 0xFFEF
91#define C4X4KEY_BUTTON_5 0xFFDF
92#define C4X4KEY_BUTTON_6 0xFFBF
93#define C4X4KEY_BUTTON_7 0xFEFF
94#define C4X4KEY_BUTTON_8 0xFDFF
95#define C4X4KEY_BUTTON_9 0xFBFF
96#define C4X4KEY_BUTTON_A 0xFFF7
97#define C4X4KEY_BUTTON_B 0xFF7F
98#define C4X4KEY_BUTTON_C 0xF7FF
99#define C4X4KEY_BUTTON_D 0xBFFF
100#define C4X4KEY_BUTTON_STAR 0x7FFF
101#define C4X4KEY_BUTTON_HASH 0xDFFF
106#define C4X4KEY_MAX_16_BIT 0xFFFF
#define C4X4KEY_RETVAL
Definition c4x4key.h:79
C4X4KEY_RETVAL c4x4key_init(c4x4key_t *ctx, c4x4key_cfg_t *cfg)
Initialization function.
void c4x4key_cfg_setup(c4x4key_cfg_t *cfg)
Config Object Initialization function.
void c4x4key_generic_transfer(c4x4key_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
Generic transfer function.
uint8_t c4x4key_get_btn_position(c4x4key_t *ctx)
Get position pressed button function.
uint16_t c4x4key_get_data(c4x4key_t *ctx)
Get 16-bit data function.
Click configuration structure definition.
Definition c4x4key.h:134
spi_master_chip_select_polarity_t cs_polarity
Definition c4x4key.h:146
pin_name_t sck
Definition c4x4key.h:139
spi_master_mode_t spi_mode
Definition c4x4key.h:145
pin_name_t mosi
Definition c4x4key.h:138
uint32_t spi_speed
Definition c4x4key.h:144
pin_name_t miso
Definition c4x4key.h:137
pin_name_t cs
Definition c4x4key.h:140
Click ctx object definition.
Definition c4x4key.h:120
digital_out_t cs
Definition c4x4key.h:121
spi_master_t spi
Definition c4x4key.h:125
pin_name_t chip_select
Definition c4x4key.h:126