adc4 2.0.0.0
|
Functions | |
void | adc4_cfg_setup (adc4_cfg_t *cfg) |
Config Object Initialization function. | |
ADC4_RETVAL | adc4_init (adc4_t *ctx, adc4_cfg_t *cfg) |
Initialization function. | |
void | adc4_default_cfg (adc4_t *ctx) |
Click Default Configuration function. | |
void | adc4_generic_transfer (adc4_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len) |
Generic transfer function. | |
uint8_t | adc4_write_reg (adc4_t *ctx, const uint8_t reg_address, uint8_t *value) |
Generic Write Function. | |
uint8_t | adc4_read_reg (adc4_t *ctx, const uint8_t reg_address, uint8_t *value) |
Generic Write Function. | |
void | adc4_reset (adc4_t *ctx) |
Reset function. | |
uint8_t | adc4_get_err_pin (adc4_t *ctx) |
Error check function. | |
void | adc4_get_config (adc4_t *ctx, uint8_t reg_address, uint16_t *value) |
Get configuration function. | |
void | adc4_set_config (adc4_t *ctx, const uint8_t reg_address, uint16_t value) |
Set configuration function. | |
uint32_t | adc4_get_data (adc4_t *ctx) |
Get data function. | |
uint16_t | adc4_get_voltage (adc4_t *ctx, const float ref_voltage) |
Get voltage function. | |
void adc4_cfg_setup | ( | adc4_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void adc4_default_cfg | ( | adc4_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for ADC 4 click.
void adc4_generic_transfer | ( | adc4_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 |
Set: ADC4_CH_REG_BASE - ADC4_CH_EN Set: ADC4_MODE_REG - ADC4_MODE_INT_REF_AND_SING_CYC_EN Set: ADC4_IFACE_MODE_REG - ADC4_IFACE_MODE_CRC_DIS Set: ADC4_GPIO_CONFIG_REG - ADC4_CFG_SYNC_EN Set: ADC4_SETUP_CONFIGURATION_REG - 0x1320@description Generic SPI transfer, for sending and receiving packages
void adc4_get_config | ( | adc4_t * | ctx, |
uint8_t | reg_address, | ||
uint16_t * | value ) |
Get configuration function.
ctx | Click object. |
reg_address | register address |
value | pointer when output data will be storaged |
@description This function writes value of configuration registers in storage determined by pointer value.
uint32_t adc4_get_data | ( | adc4_t * | ctx | ) |
Get data function.
ctx | Click object. |
@description This function checks ready bit, is data ready or not, and returns 24-bit value from data register.
uint8_t adc4_get_err_pin | ( | adc4_t * | ctx | ) |
Error check function.
ctx | Click object. |
@description This function returns value of INT (ERROR) pin witch is controlled by ERR_DAT bit in the GPIOCON register.
uint16_t adc4_get_voltage | ( | adc4_t * | ctx, |
const float | ref_voltage ) |
Get voltage function.
ctx | Click object. |
ref_voltage | Referent voltage for ADC conversion |
@description This function returns 16-bit calculated and AD converted voltage value.
ADC4_RETVAL adc4_init | ( | adc4_t * | ctx, |
adc4_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
uint8_t adc4_read_reg | ( | adc4_t * | ctx, |
const uint8_t | reg_address, | ||
uint8_t * | value ) |
Generic Write Function.
ctx | Click object. |
reg_address | register address |
value | pointer when output data will be storaged |
@description Function reads data from register determined by register address parametar of function.
void adc4_reset | ( | adc4_t * | ctx | ) |
Reset function.
ctx | Click object. |
@description This function reset ADC 4 click.
void adc4_set_config | ( | adc4_t * | ctx, |
const uint8_t | reg_address, | ||
uint16_t | value ) |
Set configuration function.
ctx | Click object. |
reg_address | register address |
value | 16-bit value to be written |
@description This function writes 16-bit value in configuration registers determined by register address parametar.
uint8_t adc4_write_reg | ( | adc4_t * | ctx, |
const uint8_t | reg_address, | ||
uint8_t * | value ) |
Generic Write Function.
ctx | Click object. |
reg_sddress | register address |
value | pointer to input data |
@description Function writes data in register determined by register address parametar of function.