mcp2003b 2.1.0.0
MCP2003B Click Driver

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

Topics

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

Functions

void mcp2003b_cfg_setup (mcp2003b_cfg_t *cfg)
 MCP2003B configuration object setup function.
 
err_t mcp2003b_init (mcp2003b_t *ctx, mcp2003b_cfg_t *cfg)
 MCP2003B initialization function.
 
err_t mcp2003b_generic_write (mcp2003b_t *ctx, uint8_t *data_in, uint16_t len)
 MCP2003B data writing function.
 
err_t mcp2003b_generic_read (mcp2003b_t *ctx, uint8_t *data_out, uint16_t len)
 MCP2003B data reading function.
 
void mcp2003b_set_cs_pin (mcp2003b_t *ctx, uint8_t state)
 MCP2003B set cs pin function.
 

Detailed Description

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

◆ mcp2003b_cfg_setup()

void mcp2003b_cfg_setup ( mcp2003b_cfg_t * cfg)

MCP2003B configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ mcp2003b_generic_read()

err_t mcp2003b_generic_read ( mcp2003b_t * ctx,
uint8_t * data_out,
uint16_t len )

MCP2003B data reading function.

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

Parameters
[in]ctx: Click context object. See mcp2003b_t object definition for detailed explanation.
[out]data_out: Output read data.
[in]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.
Note
None.

◆ mcp2003b_generic_write()

err_t mcp2003b_generic_write ( mcp2003b_t * ctx,
uint8_t * data_in,
uint16_t len )

MCP2003B data writing function.

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

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

◆ mcp2003b_init()

err_t mcp2003b_init ( mcp2003b_t * ctx,
mcp2003b_cfg_t * cfg )

MCP2003B initialization function.

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

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

◆ mcp2003b_set_cs_pin()

void mcp2003b_set_cs_pin ( mcp2003b_t * ctx,
uint8_t state )

MCP2003B set cs pin function.

This function sets the chip select (CS) pin logic state.

Parameters
[in]ctx: Click context object. See mcp2003b_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.