current2 2.0.0.0
|
Functions | |
void | current2_cfg_setup (current2_cfg_t *cfg) |
Config Object Initialization function. | |
uint8_t | current2_init (current2_t *ctx, current2_cfg_t *cfg) |
Initialization function. | |
void | current2_generic_transfer (current2_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len) |
Generic transfer function. | |
uint16_t | current2_get_adc (current2_t *ctx) |
Get ADC function. | |
uint16_t | current2_get_average_adc (current2_t *ctx, uint8_t n_samp) |
Get Averaged ADC function. | |
uint16_t | current2_get_current (current2_t *ctx, uint8_t n_sample) |
Get Current function. | |
void current2_cfg_setup | ( | current2_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void current2_generic_transfer | ( | current2_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
uint16_t current2_get_adc | ( | current2_t * | ctx | ) |
Get ADC function.
ctx | Click object. |
@description Function returns 10-bit digital value from the AD converter.
uint16_t current2_get_average_adc | ( | current2_t * | ctx, |
uint8_t | n_samp ) |
Get Averaged ADC function.
ctx | Click object. |
n_samp | Number of samples to be used for averaging |
@description Function returns averaged result from the AD converter.
uint16_t current2_get_current | ( | current2_t * | ctx, |
uint8_t | n_sample ) |
Get Current function.
ctx | Click object. |
n_sample | Number of samples to be used for averaging |
@description Function reads averaged result from the ADC and performs a calculations to get current in proper value [mA].
uint8_t current2_init | ( | current2_t * | ctx, |
current2_cfg_t * | cfg ) |
Initialization function.
current2 | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.