ft  2.0.0.0
Functions
Public function

Functions

void ft_cfg_setup (ft_cfg_t *cfg)
 Config Object Initialization function. More...
 
FT_RETVAL ft_init (ft_t *ctx, ft_cfg_t *cfg)
 Initialization function. More...
 
void ft_default_cfg (ft_t *ctx)
 Click Default Configuration function. More...
 
void ft_generic_write (ft_t *ctx, char *data_buf, uint16_t len)
 Generic write function. More...
 
int32_t ft_generic_read (ft_t *ctx, char *data_buf, uint16_t max_len)
 Generic read function. More...
 
void ft_set_rst_pin (ft_t *ctx, uint8_t state)
 Set RST pin state. More...
 
void ft_send_package (ft_t *ctx, uint8_t *data_buf, uint16_t len, uint8_t queue)
 Sends full package to other module. More...
 
uint8_t ft_get_data_status (ft_t *ctx)
 Gets current status of data. More...
 
uint16_t ft_get_data (ft_t *ctx, uint8_t *data_buf)
 Gets new received data. More...
 
void ft_isr_parser (ft_t *ctx, uint8_t rsp_data)
 Collecting and preserving data received via uart interrupt routine. More...
 

Detailed Description

Function Documentation

◆ ft_cfg_setup()

void ft_cfg_setup ( ft_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ ft_default_cfg()

void ft_default_cfg ( ft_t ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Ft click.

◆ ft_generic_read()

int32_t ft_generic_read ( ft_t ctx,
char *  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.

@description This function read data of maximum length.

◆ ft_generic_write()

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

Generic write function.

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

@description 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

@description Use this function for 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]

@description Use this function for gets current status of data

◆ ft_init()

FT_RETVAL ft_init ( ft_t ctx,
ft_cfg_t cfg 
)

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

@description 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

@description Used this function for collect and preser 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

@description Use this function for 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 ]

@description Use this function for set new RST pin state