ft 2.0.0.0
Public function

Functions

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.
 
int32_t ft_generic_read (ft_t *ctx, uint8_t *data_buf, uint16_t max_len)
 Generic read function.
 
void ft_set_rst_pin (ft_t *ctx, uint8_t state)
 Set RST pin state.
 
void ft_send_package (ft_t *ctx, uint8_t *data_buf, uint16_t len, uint8_t queue)
 Sends full package to other module.
 
uint8_t ft_get_data_status (ft_t *ctx)
 Gets current status of data.
 
uint16_t ft_get_data (ft_t *ctx, uint8_t *data_buf)
 Gets new received data.
 
void ft_isr_parser (ft_t *ctx, uint8_t rsp_data)
 Collecting and preserving data received via uart interrupt routine.
 

Detailed Description

Function Documentation

◆ ft_cfg_setup()

void ft_cfg_setup ( ft_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ ft_generic_read()

int32_t ft_generic_read ( ft_t * ctx,
uint8_t * data_buf,
uint16_t max_len )

Generic read function.

Parameters
ctxClick object.
data_bufData buffer for read data.
max_lenThe maximum length of data that can be read.
Returns
Number of reads data.

This function read data of maximum length.

◆ ft_generic_write()

void ft_generic_write ( ft_t * ctx,
uint8_t * data_buf,
uint16_t len )

Generic write function.

Parameters
ctxClick object.
data_bufData buffer for sends.
lenNumber of bytes for sends.

This function write specific number of data.

◆ ft_get_data()

uint16_t ft_get_data ( ft_t * ctx,
uint8_t * data_buf )

Gets new received data.

Parameters
ctxClick object.
data_bufPointer to the buffer in which the received data will be stored
Returns
number of data that received

Use this function to read received data

Note
This function returns only the received data and not the full received packet.

◆ ft_get_data_status()

uint8_t ft_get_data_status ( ft_t * ctx)

Gets current status of data.

Parameters
ctxClick object.
Returns
current data status [ new data package available or not]

Use this function to get current status of data

◆ ft_init()

err_t ft_init ( ft_t * ctx,
ft_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

This function initializes all necessary pins and peripherals used for this click.

◆ ft_isr_parser()

void ft_isr_parser ( ft_t * ctx,
uint8_t rsp_data )

Collecting and preserving data received via uart interrupt routine.

Parameters
ctxClick object.
rsp_dataOne byte data that received via uart

Used this function to collect and preserve new data

Note
This function must be called as soon as possible

◆ ft_send_package()

void ft_send_package ( ft_t * ctx,
uint8_t * data_buf,
uint16_t len,
uint8_t queue )

Sends full package to other module.

Parameters
ctxClick object.
data_bufBuffer with data that will be sends
lenNumber of data in the data buffer
queueQueue value for this package

Use this function to send data to other module

Note
Package format contains:
   [0] - Header data [ '@' - 0x40 ] 
   [1] - Header data [ '@' - 0x40 ]
   [2] - Package lenth LSB
   [3] - Package lenth MSB
   [4] - Package queue - param(queue)
   [ 5 -> param( len ) ] - Data for sends [ param( data_buf ) ]
   [ param( len ) + 1 ] - CRC data LSB
   [ param( len ) + 2 ] - CRC data MSB

◆ ft_set_rst_pin()

void ft_set_rst_pin ( ft_t * ctx,
uint8_t state )

Set RST pin state.

Parameters
ctxClick object.
stateRST pin state [ 0 or 1 ]

Use this function to set new RST pin state