mcp73213 2.0.0.0
|
Functions | |
void | mcp73213_cfg_setup (mcp73213_cfg_t *cfg) |
Config Object Initialization function. | |
MCP73213_RETVAL | mcp73213_init (mcp73213_t *ctx, mcp73213_cfg_t *cfg) |
Initialization function. | |
void | mcp73213_generic_transfer (mcp73213_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len) |
Generic transfer function. | |
void | mcp73213_write_data (mcp73213_t *ctx, uint8_t command, uint8_t write_data) |
Generic write 8-bit data function. | |
uint8_t | mcp73213_read_data (mcp73213_t *ctx, uint8_t command) |
Generic read 8-bit data function. | |
void | mcp73213_set_current_output (mcp73213_t *ctx, uint8_t out_data) |
Set values for output current function. | |
uint8_t | mcp73213_get_status (mcp73213_t *ctx) |
Get the status register data function. | |
float | mcp73213_convert_output (uint8_t value_adc, float v_ref) |
Convert ADC value to volatage. | |
void mcp73213_cfg_setup | ( | mcp73213_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
float mcp73213_convert_output | ( | uint8_t | value_adc, |
float | v_ref ) |
Convert ADC value to volatage.
ctx | Click object. |
value_adc | 10-bit ADC value |
v_ref | Voltage Reference 3.3V or 5V |
@description Convert 8-bit ADC value to volatage of on MCP73213 Click board.
void mcp73213_generic_transfer | ( | mcp73213_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
uint8_t mcp73213_get_status | ( | mcp73213_t * | ctx | ) |
Get the status register data function.
ctx | Click object. |
@description Function get 8-bit status data from status register on the MCP4161 chip register on MCP73213 Click board.
MCP73213_RETVAL mcp73213_init | ( | mcp73213_t * | ctx, |
mcp73213_cfg_t * | cfg ) |
Initialization function.
mcp73213 | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
uint8_t mcp73213_read_data | ( | mcp73213_t * | ctx, |
uint8_t | command ) |
Generic read 8-bit data function.
ctx | Click object. |
command | 8-bit data address command |
@description Function read 8-bit data from address command register on the MCP4161 chip register on MCP73213 Click board.
void mcp73213_set_current_output | ( | mcp73213_t * | ctx, |
uint8_t | out_data ) |
Set values for output current function.
ctx | Click object. |
out_data | 8-bit current output value |
@description Function set values for output current by write outData to the MCP4161 chip register on MCP73213 Click board.
void mcp73213_write_data | ( | mcp73213_t * | ctx, |
uint8_t | command, | ||
uint8_t | write_data ) |
Generic write 8-bit data function.
ctx | Click object. |
command | 8-bit data address command |
write_data | 8-bit data to write |
@description Function write 8-bit data via SPI on the MCP4161 chip register on MCP73213 Click board.