mcp16331inv 2.0.0.0
|
Functions | |
void | mcp16331inv_cfg_setup (mcp16331inv_cfg_t *cfg) |
Config Object Initialization function. | |
MCP16331INV_RETVAL | mcp16331inv_init (mcp16331inv_t *ctx, mcp16331inv_cfg_t *cfg) |
Initialization function. | |
void | mcp16331inv_generic_transfer (mcp16331inv_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len) |
Generic transfer function. | |
void | mcp16331inv_set_dac_vout (mcp16331inv_t *ctx, uint16_t dac_value, uint8_t gain_value, uint8_t mode) |
DAC output voltage set function. | |
void | mcp16331inv_enable_vin (mcp16331inv_t *ctx, uint8_t state) |
VIN Pull Up enable function. | |
void mcp16331inv_cfg_setup | ( | mcp16331inv_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void mcp16331inv_enable_vin | ( | mcp16331inv_t * | ctx, |
uint8_t | state ) |
VIN Pull Up enable function.
ctx | Click object. |
state | 1 - enable, 0 - disable |
@description Function enables or disables internal VIN pull up.
void mcp16331inv_generic_transfer | ( | mcp16331inv_t * | ctx, |
uint8_t * | wr_buf, | ||
uint16_t | wr_len, | ||
uint8_t * | rd_buf, | ||
uint16_t | rd_len ) |
Generic transfer function.
ctx | Click object. |
wr_buf | Write data buffer |
wr_len | Number of byte in write data buffer |
rd_buf | Read data buffer |
rd_len | Number of byte in read data buffer |
@description Generic SPI transfer, for sending and receiving packages
MCP16331INV_RETVAL mcp16331inv_init | ( | mcp16331inv_t * | ctx, |
mcp16331inv_cfg_t * | cfg ) |
Initialization function.
mcp16331inv | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void mcp16331inv_set_dac_vout | ( | mcp16331inv_t * | ctx, |
uint16_t | dac_value, | ||
uint8_t | gain_value, | ||
uint8_t | mode ) |
DAC output voltage set function.
ctx | Click object. |
DAC_value | 12-bit DAC input value |
gain_value | 1 - 1x VREF, 0 - 2x VREF |
mode | 1 - active mode, 0 - shutdown mode |
@description Function determines DAC output voltage value in depending on the input DAC_value (0x0000 - 0x0FFF) and gain_value. Function also can put device on active or shutdown mode.