cxpi 2.0.0.0
CXPI Click Driver

API for configuring and manipulating CXPI Click driver. More...

Topics

 CXPI Device Settings
 Settings for registers of CXPI Click driver.
 
 CXPI MikroBUS Map
 MikroBUS pin mapping of CXPI Click driver.
 

Functions

void cxpi_cfg_setup (cxpi_cfg_t *cfg)
 CXPI configuration object setup function.
 
err_t cxpi_init (cxpi_t *ctx, cxpi_cfg_t *cfg)
 CXPI initialization function.
 
err_t cxpi_default_cfg (cxpi_t *ctx)
 CXPI default configuration function.
 
err_t cxpi_generic_write (cxpi_t *ctx, char *data_buf, uint16_t len)
 CXPI data writing function.
 
err_t cxpi_generic_read (cxpi_t *ctx, char *data_buf, uint16_t max_len)
 CXPI data reading function.
 
void cxpi_write_byte (cxpi_t *ctx, uint8_t input)
 Write Single Byte.
 
uint8_t cxpi_read_byte (cxpi_t *ctx)
 Read Single Byte.
 
uint8_t cxpi_byte_ready (cxpi_t *ctx)
 Check for new byte received.
 
void cxpi_send_command (cxpi_t *ctx, char *command)
 Send command.
 
void cxpi_set_nslp_pin_state (cxpi_t *ctx, uint8_t pin_state)
 Set NSLP pin state function.
 
void cxpi_set_pwm_pin_state (cxpi_t *ctx, uint8_t pin_state)
 Set PWM pin state function.
 
void cxpi_set_through_mode (cxpi_t *ctx)
 Set through mode function.
 

Detailed Description

API for configuring and manipulating CXPI Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ cxpi_byte_ready()

uint8_t cxpi_byte_ready ( cxpi_t * ctx)

Check for new byte received.

Checks is there a new byte received.

Parameters
[in]ctx: Click context object. See cxpi_t object definition for detailed explanation.
Returns
Returns the number of bytes that are available for reading.

◆ cxpi_cfg_setup()

void cxpi_cfg_setup ( cxpi_cfg_t * cfg)

CXPI configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See cxpi_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ cxpi_default_cfg()

err_t cxpi_default_cfg ( cxpi_t * ctx)

CXPI default configuration function.

This function executes a default configuration of CXPI click board.

Parameters
[in]ctx: Click context object. See cxpi_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ cxpi_generic_read()

err_t cxpi_generic_read ( cxpi_t * ctx,
char * data_buf,
uint16_t max_len )

CXPI data reading function.

This function reads a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See cxpi_t object definition for detailed explanation.
[out]data_buf: Output read data.
[in]max_len: Number of bytes to be read.
Returns
  • >0 - Number of data bytes read,
  • <=0 - Error/Empty Ring buffer.
See #err_t definition for detailed explanation.

◆ cxpi_generic_write()

err_t cxpi_generic_write ( cxpi_t * ctx,
char * data_buf,
uint16_t len )

CXPI data writing function.

This function writes a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See cxpi_t object definition for detailed explanation.
[in]data_buf: Data buffer for sending.
[in]len: Number of bytes for sending.
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.

◆ cxpi_init()

err_t cxpi_init ( cxpi_t * ctx,
cxpi_cfg_t * cfg )

CXPI initialization function.

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

Parameters
[out]ctx: Click context object. See cxpi_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See cxpi_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ cxpi_read_byte()

uint8_t cxpi_read_byte ( cxpi_t * ctx)

Read Single Byte.

Read received byte.

Parameters
[in]ctx: Click context object. See cxpi_t object definition for detailed explanation.
Returns
Received byte.

◆ cxpi_send_command()

void cxpi_send_command ( cxpi_t * ctx,
char * command )

Send command.

This function sends a command by using UART serial interface.

Parameters
[in]ctx: Click context object. See cxpi_t object definition for detailed explanation.
[in]command: Command to be sent.
Returns
Nothing.

◆ cxpi_set_nslp_pin_state()

void cxpi_set_nslp_pin_state ( cxpi_t * ctx,
uint8_t pin_state )

Set NSLP pin state function.

This function set state of the NSLP ( CS ) pin of CXPI Transceiver for Automotive on CXPI click board.

Parameters
[out]ctx: Click context object. See cxpi_t object definition for detailed explanation.
[in]pin_state: Disable or Enable.
Returns
Nothing.

◆ cxpi_set_pwm_pin_state()

void cxpi_set_pwm_pin_state ( cxpi_t * ctx,
uint8_t pin_state )

Set PWM pin state function.

This function set state of the PWM ( CLK ) pin of CXPI Transceiver for Automotive on CXPI click board.

Parameters
[out]ctx: Click context object. See cxpi_t object definition for detailed explanation.
[in]pin_state: Disable or Enable.
Returns
Nothing.

◆ cxpi_set_through_mode()

void cxpi_set_through_mode ( cxpi_t * ctx)

Set through mode function.

This function set through mode does not process Coding/Decoding and it only drives signals from TXD to BUS and from BUS to RXD directly of CXPI Transceiver for Automotive on CXPI click board.

Parameters
[in]ctx: Click context object. See cxpi_t object definition for detailed explanation.
Returns
Nothing.

◆ cxpi_write_byte()

void cxpi_write_byte ( cxpi_t * ctx,
uint8_t input )

Write Single Byte.

Writes sinle byte.

Parameters
[in]ctx: Click context object. See cxpi_t object definition for detailed explanation.
[in]inputByte for sending.
Returns
Nothing.