canfd2 2.0.0.0
Public function

Functions

void canfd2_cfg_setup (canfd2_cfg_t *cfg)
 Config Object Initialization function.
 
err_t canfd2_init (canfd2_t *ctx, canfd2_cfg_t *cfg)
 Initialization function.
 
void canfd2_generic_write (canfd2_t *ctx, uint8_t *data_buf, uint16_t len)
 Generic write function.
 
int32_t canfd2_generic_read (canfd2_t *ctx, uint8_t *data_buf, uint16_t max_len)
 Generic read function.
 
void canfd2_generic_transfer (canfd2_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
uint8_t canfd2_read_data (canfd2_t *ctx, uint8_t reg_addr)
 Generic read the byte of data function.
 
void canfd2_write_data (canfd2_t *ctx, uint8_t reg_addr, uint8_t write_data)
 Generic write the byte of data function.
 
void canfd2_set_mode (canfd2_t *ctx, uint8_t op_mode)
 Set operating mode function.
 
uint8_t canfd2_get_mode (canfd2_t *ctx)
 Get operating mode function.
 

Detailed Description

Function Documentation

◆ canfd2_cfg_setup()

void canfd2_cfg_setup ( canfd2_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.

◆ canfd2_generic_read()

int32_t canfd2_generic_read ( canfd2_t * ctx,
uint8_t * data_buf,
uint16_t max_len )

Generic read function.

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

◆ canfd2_generic_transfer()

void canfd2_generic_transfer ( canfd2_t * ctx,
uint8_t * wr_buf,
uint16_t wr_len,
uint8_t * rd_buf,
uint16_t rd_len )

Generic transfer function.

Parameters
ctxClick object.
wr_bufWrite data buffer
wr_lenNumber of byte in write data buffer
rd_bufRead data buffer
rd_lenNumber of byte in read data buffer

@description Generic SPI transfer, for sending and receiving packages

◆ canfd2_generic_write()

void canfd2_generic_write ( canfd2_t * ctx,
uint8_t * data_buf,
uint16_t len )

Generic write function.

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

◆ canfd2_get_mode()

uint8_t canfd2_get_mode ( canfd2_t * ctx)

Get operating mode function.

Parameters
ctxClick object.
Returns
operation mode:
  • 1 ( CANFD2_OP_MODE_SLEEP ) : Normal mode;
  • 2 ( CANFD2_OP_MODE_STANDBY ) : Receive mode;
  • 3 ( CANFD2_OP_MODE_RECEIVE_ONLY ) : Stand-by mode;
  • 4 ( CANFD2_OP_MODE_NORMAL ) : Sleep mode;

@description This function set desired soperating mode of TLE9255W HS CAN Transceiver with Partial Networking on CAN FD 2 Click board.

◆ canfd2_init()

err_t canfd2_init ( canfd2_t * ctx,
canfd2_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ canfd2_read_data()

uint8_t canfd2_read_data ( canfd2_t * ctx,
uint8_t reg_addr )

Generic read the byte of data function.

Parameters
ctxClick object.
reg_addr8-bit register address.
Returns
read_data

@description This function read the the byte of data from the target 8-bit register address of TLE9255W HS CAN Transceiver with Partial Networking on CAN FD 2 Click board.

◆ canfd2_set_mode()

void canfd2_set_mode ( canfd2_t * ctx,
uint8_t op_mode )

Set operating mode function.

Parameters
ctxClick object.
op_mode
  • 1 ( CANFD2_OP_MODE_SLEEP ) : Normal mode;
  • 2 ( CANFD2_OP_MODE_STANDBY ) : Receive mode;
  • 3 ( CANFD2_OP_MODE_RECEIVE_ONLY ) : Stand-by mode;
  • 4 ( CANFD2_OP_MODE_NORMAL ) : Sleep mode;

@description This function set desired soperating mode of TLE9255W HS CAN Transceiver with Partial Networking on CAN FD 2 Click board.

◆ canfd2_write_data()

void canfd2_write_data ( canfd2_t * ctx,
uint8_t reg_addr,
uint8_t write_data )

Generic write the byte of data function.

Parameters
ctxClick object.
reg_addr8-bit register address.
write_dataByte of data to write.
Returns
8-bit write status

@description This function write the byte of data to the target 8-bit register address of TLE9255W HS CAN Transceiver with Partial Networking on CAN FD 2 Click board.