cdc
2.1.0.0
|
API for configuring and manipulating CDC Click driver. More...
Modules | |
CDC Registers List | |
List of registers of CDC Click driver. | |
CDC Registers Settings | |
Settings for registers of CDC Click driver. | |
CDC MikroBUS Map | |
MikroBUS pin mapping of CDC Click driver. | |
Functions | |
void | cdc_cfg_setup (cdc_cfg_t *cfg) |
CDC configuration object setup function. More... | |
void | cdc_drv_interface_sel (cdc_cfg_t *cfg, cdc_drv_t drv_sel) |
CDC driver interface setup function. More... | |
err_t | cdc_init (cdc_t *ctx, cdc_cfg_t *cfg) |
CDC initialization function. More... | |
err_t | cdc_default_cfg (cdc_t *ctx) |
CDC default configuration function. More... | |
err_t | cdc_write_memory (cdc_t *ctx, uint16_t address, const uint8_t *data_in, uint16_t len) |
CDC write memory function. More... | |
err_t | cdc_read_memory (cdc_t *ctx, uint16_t address, uint8_t *data_out, uint16_t len) |
CDC read memory function. More... | |
err_t | cdc_write_config (cdc_t *ctx, uint8_t address, const uint8_t *data_in, uint8_t len) |
CDC write config function. More... | |
err_t | cdc_read_config (cdc_t *ctx, uint8_t address, uint8_t *data_out, uint8_t len) |
CDC read config function. More... | |
err_t | cdc_read_result (cdc_t *ctx, uint8_t address, uint8_t *data_out, uint8_t len) |
CDC read result function. More... | |
err_t | cdc_send_opcode (cdc_t *ctx, uint8_t opcode) |
CDC send opcode function. More... | |
err_t | cdc_check_communication (cdc_t *ctx) |
CDC check communication function. More... | |
err_t | cdc_read_results (cdc_t *ctx, cdc_results_t *results) |
CDC read results function. More... | |
API for configuring and manipulating CDC Click driver.
void cdc_cfg_setup | ( | cdc_cfg_t * | cfg | ) |
CDC configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See cdc_cfg_t object definition for detailed explanation. |
err_t cdc_check_communication | ( | cdc_t * | ctx | ) |
CDC check communication function.
This function checks the communication by performing a test read feature.
[in] | ctx | : Click context object. See cdc_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t cdc_default_cfg | ( | cdc_t * | ctx | ) |
CDC default configuration function.
This function executes a default configuration of CDC click board.
[in] | ctx | : Click context object. See cdc_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. CDC driver interface setup function.
This function sets a serial driver interface which will be used further in the click driver.
[out] | cfg | : Click configuration structure. See cdc_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See cdc_drv_t object definition for detailed explanation. |
CDC initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See cdc_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See cdc_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t cdc_read_config | ( | cdc_t * | ctx, |
uint8_t | address, | ||
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
CDC read config function.
This function reads a desired number of configuration data registers starting from the selected address.
[in] | ctx | : Click context object. See cdc_t object definition for detailed explanation. |
[in] | address | : Start config address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t cdc_read_memory | ( | cdc_t * | ctx, |
uint16_t | address, | ||
uint8_t * | data_out, | ||
uint16_t | len | ||
) |
CDC read memory function.
This function reads a desired number of data bytes starting from the selected memory address.
[in] | ctx | : Click context object. See cdc_t object definition for detailed explanation. |
[in] | address | : Start memory address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t cdc_read_result | ( | cdc_t * | ctx, |
uint8_t | address, | ||
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
CDC read result function.
This function reads a desired number of result data registers starting from the selected address.
[in] | ctx | : Click context object. See cdc_t object definition for detailed explanation. |
[in] | address | : Start result address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t cdc_read_results | ( | cdc_t * | ctx, |
cdc_results_t * | results | ||
) |
CDC read results function.
This function reads all results and status registers.
[in] | ctx | : Click context object. See cdc_t object definition for detailed explanation. |
[out] | results | : Results object data output. See cdc_results_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t cdc_send_opcode | ( | cdc_t * | ctx, |
uint8_t | opcode | ||
) |
CDC send opcode function.
This function sends a desired opcode command byte.
[in] | ctx | : Click context object. See cdc_t object definition for detailed explanation. |
[in] | opcode | : Opcode command byte. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t cdc_write_config | ( | cdc_t * | ctx, |
uint8_t | address, | ||
const uint8_t * | data_in, | ||
uint8_t | len | ||
) |
CDC write config function.
This function writes configuration data starting from the selected config address.
[in] | ctx | : Click context object. See cdc_t object definition for detailed explanation. |
[in] | address | : Start config address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t cdc_write_memory | ( | cdc_t * | ctx, |
uint16_t | address, | ||
const uint8_t * | data_in, | ||
uint16_t | len | ||
) |
CDC write memory function.
This function writes data to memory starting from the selected address.
[in] | ctx | : Click context object. See cdc_t object definition for detailed explanation. |
[in] | address | : Start memory address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.