mcp2003b
2.1.0.0
|
API for configuring and manipulating MCP2003B Click driver. More...
Modules | |
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. More... | |
err_t | mcp2003b_init (mcp2003b_t *ctx, mcp2003b_cfg_t *cfg) |
MCP2003B initialization function. More... | |
err_t | mcp2003b_generic_write (mcp2003b_t *ctx, uint8_t *data_in, uint16_t len) |
MCP2003B data writing function. More... | |
err_t | mcp2003b_generic_read (mcp2003b_t *ctx, uint8_t *data_out, uint16_t len) |
MCP2003B data reading function. More... | |
void | mcp2003b_set_cs_pin (mcp2003b_t *ctx, uint8_t state) |
MCP2003B set cs pin function. More... | |
API for configuring and manipulating MCP2003B Click driver.
void mcp2003b_cfg_setup | ( | mcp2003b_cfg_t * | cfg | ) |
MCP2003B configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See mcp2003b_cfg_t object definition for detailed explanation. |
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.
[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. |
>0
- Number of data bytes read, <=0
- Error/Empty Ring buffer. See #err_t definition for detailed explanation. 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.
[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. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See mcp2003b_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |