|
adac4 2.2.0
|
API for configuring and manipulating ADAC 4 Click driver. More...
Topics | |
| ADAC 4 Registers List | |
| List of registers of ADAC 4 Click driver. | |
| ADAC 4 Registers Settings | |
| Settings for registers of ADAC 4 Click driver. | |
| ADAC 4 MikroBUS Map | |
| MikroBUS pin mapping of ADAC 4 Click driver. | |
Functions | |
| void | adac4_cfg_setup (adac4_cfg_t *cfg) |
| ADAC 4 configuration object setup function. | |
| err_t | adac4_init (adac4_t *ctx, adac4_cfg_t *cfg) |
| ADAC 4 initialization function. | |
| err_t | adac4_default_cfg (adac4_t *ctx) |
| ADAC 4 default configuration function. | |
| err_t | adac4_write_reg (adac4_t *ctx, uint8_t reg, uint16_t data_in) |
| ADAC 4 write register function. | |
| err_t | adac4_read_reg (adac4_t *ctx, uint8_t reg, uint16_t *data_out) |
| ADAC 4 read register function. | |
| void | adac4_set_rst_pin (adac4_t *ctx, uint8_t state) |
| ADAC 4 set RST pin state function. | |
| void | adac4_reset_device (adac4_t *ctx) |
| ADAC 4 hardware reset function. | |
| err_t | adac4_check_communication (adac4_t *ctx) |
| ADAC 4 check communication function. | |
| err_t | adac4_write_dac (adac4_t *ctx, uint8_t channel, uint16_t dac_data) |
| ADAC 4 write DAC channel function. | |
| err_t | adac4_read_raw_adc (adac4_t *ctx, uint8_t channel, uint16_t *raw_adc) |
| ADAC 4 read raw ADC value function. | |
| err_t | adac4_read_adc_voltage (adac4_t *ctx, uint8_t channel, float *voltage) |
| ADAC 4 read ADC voltage function. | |
| err_t | adac4_read_die_temp (adac4_t *ctx, float *die_temp) |
| ADAC 4 read die temperature function. | |
API for configuring and manipulating ADAC 4 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void adac4_cfg_setup | ( | adac4_cfg_t * | cfg | ) |
ADAC 4 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See adac4_cfg_t object definition for detailed explanation. |
| err_t adac4_check_communication | ( | adac4_t * | ctx | ) |
ADAC 4 check communication function.
This function checks communication by verifying the CHIP ID register.
| [in] | ctx | : Click context object. See adac4_t object definition for detailed explanation. |
0 - Success, -1 - Error. | err_t adac4_default_cfg | ( | adac4_t * | ctx | ) |
ADAC 4 default configuration function.
This function executes a default configuration of ADAC 4 Click board.
| [in] | ctx | : Click context object. See adac4_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t adac4_init | ( | adac4_t * | ctx, |
| adac4_cfg_t * | cfg ) |
ADAC 4 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See adac4_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See adac4_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t adac4_read_adc_voltage | ( | adac4_t * | ctx, |
| uint8_t | channel, | ||
| float * | voltage ) |
ADAC 4 read ADC voltage function.
This function reads an ADC voltage value from the specified channel.
| [in] | ctx | : Click context object. See adac4_t object definition for detailed explanation. |
| [in] | channel | : ADC channel number (0?7). |
| [out] | voltage | : Pointer to memory where voltage in volts will be stored. |
0 - Success, -1 - Error. | err_t adac4_read_die_temp | ( | adac4_t * | ctx, |
| float * | die_temp ) |
ADAC 4 read die temperature function.
This function reads and calculates internal die temperature.
| [in] | ctx | : Click context object. See adac4_t object definition for detailed explanation. |
| [out] | die_temp | : Pointer to memory where temperature in degrees Celsius will be stored. |
0 - Success, -1 - Error. | err_t adac4_read_raw_adc | ( | adac4_t * | ctx, |
| uint8_t | channel, | ||
| uint16_t * | raw_adc ) |
ADAC 4 read raw ADC value function.
This function reads a raw ADC value from the specified channel.
| [in] | ctx | : Click context object. See adac4_t object definition for detailed explanation. |
| [in] | channel | : ADC channel number (0?7). |
| [out] | raw_adc | : Pointer to memory where raw ADC data will be stored. |
0 - Success, -1 - Error. | err_t adac4_read_reg | ( | adac4_t * | ctx, |
| uint8_t | reg, | ||
| uint16_t * | data_out ) |
ADAC 4 read register function.
This function reads a 16-bit value from the specified register.
| [in] | ctx | : Click context object. See adac4_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [out] | data_out | : Pointer to memory where read data will be stored. |
0 - Success, -1 - Error. | void adac4_reset_device | ( | adac4_t * | ctx | ) |
ADAC 4 hardware reset function.
This function performs a hardware reset by toggling the RST pin.
| [in] | ctx | : Click context object. See adac4_t object definition for detailed explanation. |
| void adac4_set_rst_pin | ( | adac4_t * | ctx, |
| uint8_t | state ) |
ADAC 4 set RST pin state function.
This function sets the RST pin to the specified logic level.
| [in] | ctx | : Click context object. See adac4_t object definition for detailed explanation. |
| [in] | state | : Pin logic level (0 or 1). |
| err_t adac4_write_dac | ( | adac4_t * | ctx, |
| uint8_t | channel, | ||
| uint16_t | dac_data ) |
ADAC 4 write DAC channel function.
This function writes a value to the specified DAC channel.
| [in] | ctx | : Click context object. See adac4_t object definition for detailed explanation. |
| [in] | channel | : DAC channel number (0?7). |
| [in] | dac_data | : 12-bit DAC data. |
0 - Success, -1 - Error. | err_t adac4_write_reg | ( | adac4_t * | ctx, |
| uint8_t | reg, | ||
| uint16_t | data_in ) |
ADAC 4 write register function.
This function writes a 16-bit value to the specified register.
| [in] | ctx | : Click context object. See adac4_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [in] | data_in | : 16-bit data to be written. |
0 - Success, -1 - Error.