cxpi 2.0.0.0
|
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. | |
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.
uint8_t cxpi_byte_ready | ( | cxpi_t * | ctx | ) |
Check for new byte received.
Checks is there a new byte received.
[in] | ctx | : Click context object. See cxpi_t object definition for detailed explanation. |
void cxpi_cfg_setup | ( | cxpi_cfg_t * | cfg | ) |
CXPI configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See cxpi_cfg_t object definition for detailed explanation. |
err_t cxpi_default_cfg | ( | cxpi_t * | ctx | ) |
CXPI default configuration function.
This function executes a default configuration of CXPI click board.
[in] | ctx | : Click context object. See cxpi_t object definition for detailed explanation. |
0
- Success, -1
- Error.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.
[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. |
>0
- Number of data bytes read, <=0
- Error/Empty Ring buffer.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.
[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. |
>=0
- Success, <0
- Error.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.
[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. |
0
- Success, -1
- Error.uint8_t cxpi_read_byte | ( | cxpi_t * | ctx | ) |
Read Single Byte.
Read received byte.
[in] | ctx | : Click context object. See cxpi_t object definition for detailed explanation. |
void cxpi_send_command | ( | cxpi_t * | ctx, |
char * | command ) |
Send command.
This function sends a command by using UART serial interface.
[in] | ctx | : Click context object. See cxpi_t object definition for detailed explanation. |
[in] | command | : Command to be sent. |
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.
[out] | ctx | : Click context object. See cxpi_t object definition for detailed explanation. |
[in] | pin_state | : Disable or Enable. |
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.
[out] | ctx | : Click context object. See cxpi_t object definition for detailed explanation. |
[in] | pin_state | : Disable or Enable. |
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.
[in] | ctx | : Click context object. See cxpi_t object definition for detailed explanation. |