42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
61#define SAMLTOUCH_START_FRAME 0x55
62#define SAMLTOUCH_END_FRAME 0xAA
67#define SAMLTOUCH_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
69 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX )
76#define SAMLTOUCH_RETVAL uint8_t
78#define SAMLTOUCH_OK 0x00
79#define SAMLTOUCH_INIT_ERROR 0xFF
86#define DRV_RX_BUFFER_SIZE 1000
87#define DRV_TX_BUFFER_SIZE 80
#define DRV_RX_BUFFER_SIZE
Definition samltouch.h:86
#define DRV_TX_BUFFER_SIZE
Definition samltouch.h:87
#define SAMLTOUCH_RETVAL
Definition samltouch.h:76
SAMLTOUCH_RETVAL samltouch_init(samltouch_t *ctx, samltouch_cfg_t *cfg)
Initialization function.
void samltouch_generic_write(samltouch_t *ctx, char *data_buf, uint16_t len)
Generic write function.
int32_t samltouch_generic_read(samltouch_t *ctx, char *data_buf, uint16_t max_len)
Generic read function.
void samltouch_cfg_setup(samltouch_cfg_t *cfg)
Config Object Initialization function.
void samltouch_parser(char *data_in, samltouch_state_t *state)
Generic parser function.
uint8_t samltouch_error_t
Error type.
Definition samltouch.h:143
Click configuration structure definition.
Definition samltouch.h:124
uint32_t baud_rate
Definition samltouch.h:132
bool uart_blocking
Definition samltouch.h:133
uart_data_bits_t data_bit
Definition samltouch.h:134
pin_name_t tx_pin
Definition samltouch.h:128
pin_name_t rx_pin
Definition samltouch.h:127
uart_stop_bits_t stop_bit
Definition samltouch.h:136
uart_parity_t parity_bit
Definition samltouch.h:135
Definition samltouch.h:98
uint8_t sw_pos
Definition samltouch.h:102
uint8_t button2
Definition samltouch.h:100
uint8_t button1
Definition samltouch.h:99
uint8_t sw_state
Definition samltouch.h:101
Click ctx object definition.
Definition samltouch.h:110
uart_t uart
Definition samltouch.h:113