singlewirecan 2.0.0.0

Functions

void singlewirecan_cfg_setup (singlewirecan_cfg_t *cfg)
 Config Object Initialization function.
 
SINGLEWIRECAN_RETVAL singlewirecan_init (singlewirecan_t *ctx, singlewirecan_cfg_t *cfg)
 Initialization function.
 
void singlewirecan_generic_write (singlewirecan_t *ctx, char *data_buf, uint16_t len)
 Generic write function.
 
int32_t singlewirecan_generic_read (singlewirecan_t *ctx, char *data_buf, uint16_t max_len)
 Generic read function.
 
void singlewirecan_set_md_0_pin_state (singlewirecan_t *ctx, uint8_t rst_state)
 Sets MD0 pin state.
 
void singlewirecan_set_md_1_pin_state (singlewirecan_t *ctx, uint8_t cs_state)
 Sets MD1 pin state.
 
void singlewirecan_set_operating_mode (singlewirecan_t *ctx, uint8_t op_mode)
 Set operating mode function.
 

Detailed Description

Function Documentation

◆ singlewirecan_cfg_setup()

void singlewirecan_cfg_setup ( singlewirecan_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.

◆ singlewirecan_generic_read()

int32_t singlewirecan_generic_read ( singlewirecan_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 read data.

@description This function reads a desired number of data bytes.

◆ singlewirecan_generic_write()

void singlewirecan_generic_write ( singlewirecan_t * ctx,
char * data_buf,
uint16_t len )

Generic write function.

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

@description This function write specified number of bytes

◆ singlewirecan_init()

SINGLEWIRECAN_RETVAL singlewirecan_init ( singlewirecan_t * ctx,
singlewirecan_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ singlewirecan_set_md_0_pin_state()

void singlewirecan_set_md_0_pin_state ( singlewirecan_t * ctx,
uint8_t rst_state )

Sets MD0 pin state.

Parameters
ctxClick object.
cs_statePin state

@description The function set MD0 ( RST ) pin to high or low state.

◆ singlewirecan_set_md_1_pin_state()

void singlewirecan_set_md_1_pin_state ( singlewirecan_t * ctx,
uint8_t cs_state )

Sets MD1 pin state.

Parameters
ctxClick object.
cs_statePin state

@description The function set MD1 ( CS ) pin to high or low state.

◆ singlewirecan_set_operating_mode()

void singlewirecan_set_operating_mode ( singlewirecan_t * ctx,
uint8_t op_mode )

Set operating mode function.

Parameters
ctxClick object.
op_mode
- 0x00 ( ONEWIRECAN_OPERATING_MODE_SLEEP )                : Sleep mode;
- 0x01 ( ONEWIRECAN_OPERATING_MODE_HIGH_SPEED )           : High-Speed mode;
- 0x02 ( ONEWIRECAN_OPERATING_MODE_HIGH_VOLTAGE_WAKE_UP ) : Wake_Up mode;
- 0x03 ( ONEWIRECAN_OPERATING_MODE_NORMAL )               : Normal mode;

@description The function set desired operating mode of NCV7356 Single Wire CAN Transceiver on One-Wire CAN Click board.