cdc 2.1.0.0
CDC Click Driver

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

Topics

 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.
 
void cdc_drv_interface_sel (cdc_cfg_t *cfg, cdc_drv_t drv_sel)
 CDC driver interface setup function.
 
err_t cdc_init (cdc_t *ctx, cdc_cfg_t *cfg)
 CDC initialization function.
 
err_t cdc_default_cfg (cdc_t *ctx)
 CDC default configuration function.
 
err_t cdc_write_memory (cdc_t *ctx, uint16_t address, const uint8_t *data_in, uint16_t len)
 CDC write memory function.
 
err_t cdc_read_memory (cdc_t *ctx, uint16_t address, uint8_t *data_out, uint16_t len)
 CDC read memory function.
 
err_t cdc_write_config (cdc_t *ctx, uint8_t address, const uint8_t *data_in, uint8_t len)
 CDC write config function.
 
err_t cdc_read_config (cdc_t *ctx, uint8_t address, uint8_t *data_out, uint8_t len)
 CDC read config function.
 
err_t cdc_read_result (cdc_t *ctx, uint8_t address, uint8_t *data_out, uint8_t len)
 CDC read result function.
 
err_t cdc_send_opcode (cdc_t *ctx, uint8_t opcode)
 CDC send opcode function.
 
err_t cdc_check_communication (cdc_t *ctx)
 CDC check communication function.
 
err_t cdc_read_results (cdc_t *ctx, cdc_results_t *results)
 CDC read results function.
 

Detailed Description

API for configuring and manipulating CDC 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

◆ cdc_cfg_setup()

void cdc_cfg_setup ( cdc_cfg_t * cfg)

CDC configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ cdc_check_communication()

err_t cdc_check_communication ( cdc_t * ctx)

CDC check communication function.

This function checks the communication by performing a test read feature.

Parameters
[in]ctx: Click context object. See cdc_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ cdc_default_cfg()

err_t cdc_default_cfg ( cdc_t * ctx)

CDC default configuration function.

This function executes a default configuration of CDC click board.

Parameters
[in]ctx: Click context object. See cdc_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.

◆ cdc_drv_interface_sel()

void cdc_drv_interface_sel ( cdc_cfg_t * cfg,
cdc_drv_t drv_sel )

CDC driver interface setup function.

This function sets a serial driver interface which will be used further in the click driver.

Parameters
[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.
Returns
Nothing.
Note
This driver selection should be called before init function to configure the driver to work with the serial interface which is consistent with the real state of the hardware. If this function is not called, the default driver interface will be set.

◆ cdc_init()

err_t cdc_init ( cdc_t * ctx,
cdc_cfg_t * cfg )

CDC initialization function.

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

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ cdc_read_config()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ cdc_read_memory()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ cdc_read_result()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ cdc_read_results()

err_t cdc_read_results ( cdc_t * ctx,
cdc_results_t * results )

CDC read results function.

This function reads all results and status registers.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ cdc_send_opcode()

err_t cdc_send_opcode ( cdc_t * ctx,
uint8_t opcode )

CDC send opcode function.

This function sends a desired opcode command byte.

Parameters
[in]ctx: Click context object. See cdc_t object definition for detailed explanation.
[in]opcode: Opcode command byte.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ cdc_write_config()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ cdc_write_memory()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.