42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
66#define FT_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
68 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
69 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
70 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS )
85#define FT_DRV_HEADER_DATA 0x40
86#define FT_DRV_HEADER_LEN 5
87#define FT_DRV_DATA_CRC_LEN 2
94#define FT_DRV_NEW_DATA_AVAILABLE 1
95#define FT_DRV_CONFIRMED_PACKAGE 1
96#define FT_DRV_CHECK_HEADER_DATA_1 0
97#define FT_DRV_CHECK_HEADER_DATA_2 1
98#define FT_DRV_CHECK_LEN_DATA_LSB 2
99#define FT_DRV_CHECK_LEN_DATA_MSB 3
106#define FT_NEW_DATA_AVAILABLE 1
107#define FT_NEW_DATA_NOT_AVAILABLE 0
114#define FT_DRV_BUFFER_SIZE ( FT_MAX_DATA_BUFFER + FT_DRV_HEADER_LEN + FT_DRV_DATA_CRC_LEN )
115#define FT_MAX_DATA_BUFFER 256
#define FT_DRV_BUFFER_SIZE
Definition ft.h:114
#define FT_MAX_DATA_BUFFER
Definition ft.h:115
void ft_isr_parser(ft_t *ctx, uint8_t rsp_data)
Collecting and preserving data received via uart interrupt routine.
uint8_t ft_get_data_status(ft_t *ctx)
Gets current status of data.
int32_t ft_generic_read(ft_t *ctx, uint8_t *data_buf, uint16_t max_len)
Generic read function.
void ft_cfg_setup(ft_cfg_t *cfg)
Config Object Initialization function.
err_t ft_init(ft_t *ctx, ft_cfg_t *cfg)
Initialization function.
void ft_generic_write(ft_t *ctx, uint8_t *data_buf, uint16_t len)
Generic write function.
void ft_set_rst_pin(ft_t *ctx, uint8_t state)
Set RST pin state.
uint16_t ft_get_data(ft_t *ctx, uint8_t *data_buf)
Gets new received data.
void ft_send_package(ft_t *ctx, uint8_t *data_buf, uint16_t len, uint8_t queue)
Sends full package to other module.
Click configuration structure definition.
Definition ft.h:153
uint32_t baud_rate
Definition ft.h:163
bool uart_blocking
Definition ft.h:164
uart_data_bits_t data_bit
Definition ft.h:165
pin_name_t tx_pin
Definition ft.h:156
pin_name_t rx_pin
Definition ft.h:155
uart_stop_bits_t stop_bit
Definition ft.h:167
uart_parity_t parity_bit
Definition ft.h:166
pin_name_t rst
Definition ft.h:159
pin_name_t cs
Definition ft.h:160
Click ctx object definition.
Definition ft.h:128
digital_out_t cs
Definition ft.h:131
uint16_t drv_rsp_lenght
Definition ft.h:145
uint16_t drv_buff_cnt
Definition ft.h:144
uint8_t drv_rsp_flag
Definition ft.h:143
uart_t uart
Definition ft.h:134
uint8_t drv_new_data
Definition ft.h:140
digital_out_t rst
Definition ft.h:130
uint8_t drv_start_package
Definition ft.h:141