isoadc7
2.1.0.0
|
API for configuring and manipulating ISO ADC 7 Click driver. More...
Modules | |
ISO ADC 7 Registers List | |
List of registers of ISO ADC 7 Click driver. | |
ISO ADC 7 Registers Settings | |
Settings for registers of ISO ADC 7 Click driver. | |
ISO ADC 7 MikroBUS Map | |
MikroBUS pin mapping of ISO ADC 7 Click driver. | |
Functions | |
void | isoadc7_cfg_setup (isoadc7_cfg_t *cfg) |
ISO ADC 7 configuration object setup function. More... | |
err_t | isoadc7_init (isoadc7_t *ctx, isoadc7_cfg_t *cfg) |
ISO ADC 7 initialization function. More... | |
err_t | isoadc7_default_cfg (isoadc7_t *ctx) |
ISO ADC 7 default configuration function. More... | |
err_t | isoadc7_write_reg (isoadc7_t *ctx, uint8_t reg, uint16_t data_in) |
ISO ADC 7 write reg function. More... | |
err_t | isoadc7_write_regs (isoadc7_t *ctx, uint8_t reg, uint16_t *data_in, uint8_t len) |
ISO ADC 7 write regs function. More... | |
err_t | isoadc7_read_reg (isoadc7_t *ctx, uint8_t reg, uint16_t *data_out) |
ISO ADC 7 read reg function. More... | |
err_t | isoadc7_read_regs (isoadc7_t *ctx, uint8_t reg, uint16_t *data_out, uint8_t len) |
ISO ADC 7 read regs function. More... | |
err_t | isoadc7_standby (isoadc7_t *ctx) |
ISO ADC 7 standby function. More... | |
err_t | isoadc7_wakeup (isoadc7_t *ctx) |
ISO ADC 7 wakeup function. More... | |
err_t | isoadc7_lock (isoadc7_t *ctx) |
ISO ADC 7 lock function. More... | |
err_t | isoadc7_unlock (isoadc7_t *ctx) |
ISO ADC 7 unlock function. More... | |
err_t | isoadc7_sw_reset (isoadc7_t *ctx) |
ISO ADC 7 sw reset function. More... | |
void | isoadc7_reset_device (isoadc7_t *ctx) |
ISO ADC 7 reset device function. More... | |
void | isoadc7_set_rst_pin (isoadc7_t *ctx, uint8_t state) |
ISO ADC 7 set RST pin function. More... | |
void | isoadc7_enable_osc (isoadc7_t *ctx) |
ISO ADC 7 enable osc function. More... | |
void | isoadc7_disable_osc (isoadc7_t *ctx) |
ISO ADC 7 disable osc function. More... | |
uint8_t | isoadc7_get_drdy_pin (isoadc7_t *ctx) |
ISO ADC 7 get DRDY pin function. More... | |
err_t | isoadc7_check_id (isoadc7_t *ctx) |
ISO ADC 7 check ID function. More... | |
err_t | isoadc7_set_word_size (isoadc7_t *ctx, uint8_t word_size) |
ISO ADC 7 set word size function. More... | |
err_t | isoadc7_set_gain (isoadc7_t *ctx, uint8_t gain_ch0, uint8_t gain_ch1, uint8_t gain_ch2) |
ISO ADC 7 set gain function. More... | |
err_t | isoadc7_read_data (isoadc7_t *ctx, isoadc7_data_t *data_out) |
ISO ADC 7 read data function. More... | |
err_t | isoadc7_read_voltage (isoadc7_t *ctx, float *ch0, float *ch1, float *ch2) |
ISO ADC 7 read voltage function. More... | |
API for configuring and manipulating ISO ADC 7 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void isoadc7_cfg_setup | ( | isoadc7_cfg_t * | cfg | ) |
ISO ADC 7 configuration object setup function.
This function initializes Click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See isoadc7_cfg_t object definition for detailed explanation. |
err_t isoadc7_check_id | ( | isoadc7_t * | ctx | ) |
ISO ADC 7 check ID function.
This function checks the communication by reading and verifying the device ID.
[in] | ctx | : Click context object. See isoadc7_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t isoadc7_default_cfg | ( | isoadc7_t * | ctx | ) |
ISO ADC 7 default configuration function.
This function executes a default configuration of ISO ADC 7 Click board.
[in] | ctx | : Click context object. See isoadc7_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void isoadc7_disable_osc | ( | isoadc7_t * | ctx | ) |
ISO ADC 7 disable osc function.
This function disables the 8.192 MHz oscillator by setting the XEN pin to low logic state.
[in] | ctx | : Click context object. See isoadc7_t object definition for detailed explanation. |
void isoadc7_enable_osc | ( | isoadc7_t * | ctx | ) |
ISO ADC 7 enable osc function.
This function enables the 8.192 MHz oscillator by setting the XEN pin to high logic state.
[in] | ctx | : Click context object. See isoadc7_t object definition for detailed explanation. |
uint8_t isoadc7_get_drdy_pin | ( | isoadc7_t * | ctx | ) |
ISO ADC 7 get DRDY pin function.
This function returns the DRDY pin logic state.
[in] | ctx | : Click context object. See isoadc7_t object definition for detailed explanation. |
err_t isoadc7_init | ( | isoadc7_t * | ctx, |
isoadc7_cfg_t * | cfg | ||
) |
ISO ADC 7 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
[out] | ctx | : Click context object. See isoadc7_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See isoadc7_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t isoadc7_lock | ( | isoadc7_t * | ctx | ) |
ISO ADC 7 lock function.
This function locks the device settings.
[in] | ctx | : Click context object. See isoadc7_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t isoadc7_read_data | ( | isoadc7_t * | ctx, |
isoadc7_data_t * | data_out | ||
) |
ISO ADC 7 read data function.
This function reads the status register and raw data of all three channels.
[in] | ctx | : Click context object. See isoadc7_t object definition for detailed explanation. |
[out] | data_out | : Output data read. See isoadc7_data_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t isoadc7_read_reg | ( | isoadc7_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out | ||
) |
ISO ADC 7 read reg function.
This function reads data from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See isoadc7_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t isoadc7_read_regs | ( | isoadc7_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out, | ||
uint8_t | len | ||
) |
ISO ADC 7 read regs function.
This function reads a desired number of data words starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See isoadc7_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of words to be read [2-23]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t isoadc7_read_voltage | ( | isoadc7_t * | ctx, |
float * | ch0, | ||
float * | ch1, | ||
float * | ch2 | ||
) |
ISO ADC 7 read voltage function.
This function reads the voltage measurements of all three channels.
[in] | ctx | : Click context object. See isoadc7_t object definition for detailed explanation. |
[out] | ch0 | : Voltage measurement from channel 0 in millivolts. |
[out] | ch1 | : Voltage measurement from channel 1 in millivolts. |
[out] | ch2 | : Voltage measurement from channel 2 in millivolts. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void isoadc7_reset_device | ( | isoadc7_t * | ctx | ) |
ISO ADC 7 reset device function.
This function resets the device by toggling the RST pin.
[in] | ctx | : Click context object. See isoadc7_t object definition for detailed explanation. |
err_t isoadc7_set_gain | ( | isoadc7_t * | ctx, |
uint8_t | gain_ch0, | ||
uint8_t | gain_ch1, | ||
uint8_t | gain_ch2 | ||
) |
ISO ADC 7 set gain function.
This function sets the gain level for all channels.
[in] | ctx | : Click context object. See isoadc7_t object definition for detailed explanation. |
[in] | gain_ch0 | : Gain level of channel 0 [0-7]. |
[in] | gain_ch1 | : Gain level of channel 1 [0-7]. |
[in] | gain_ch2 | : Gain level of channel 2 [0-7]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void isoadc7_set_rst_pin | ( | isoadc7_t * | ctx, |
uint8_t | state | ||
) |
ISO ADC 7 set RST pin function.
This function sets the RST pin logic state.
[in] | ctx | : Click context object. See isoadc7_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
err_t isoadc7_set_word_size | ( | isoadc7_t * | ctx, |
uint8_t | word_size | ||
) |
ISO ADC 7 set word size function.
This function sets the data word size to 2, 3, or 4 bytes.
[in] | ctx | : Click context object. See isoadc7_t object definition for detailed explanation. |
[in] | word_size | : Word size in bytes [2-4]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t isoadc7_standby | ( | isoadc7_t * | ctx | ) |
ISO ADC 7 standby function.
This function sets the device to standby mode.
[in] | ctx | : Click context object. See isoadc7_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t isoadc7_sw_reset | ( | isoadc7_t * | ctx | ) |
ISO ADC 7 sw reset function.
This function performs the device software reset.
[in] | ctx | : Click context object. See isoadc7_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t isoadc7_unlock | ( | isoadc7_t * | ctx | ) |
ISO ADC 7 unlock function.
This function unlocks the device settings.
[in] | ctx | : Click context object. See isoadc7_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t isoadc7_wakeup | ( | isoadc7_t * | ctx | ) |
ISO ADC 7 wakeup function.
This function wakes up the device from standby mode.
[in] | ctx | : Click context object. See isoadc7_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t isoadc7_write_reg | ( | isoadc7_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in | ||
) |
ISO ADC 7 write reg function.
This function writes a data word to the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See isoadc7_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t isoadc7_write_regs | ( | isoadc7_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_in, | ||
uint8_t | len | ||
) |
ISO ADC 7 write regs function.
This function writes a desired number of data words starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See isoadc7_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of words to be written [1-23]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.