adc20 2.1.0.0
|
API for configuring and manipulating ADC 20 Click driver. More...
Topics | |
ADC 20 Registers List | |
List of registers of ADC 20 Click driver. | |
ADC 20 Registers Settings | |
Settings for registers of ADC 20 Click driver. | |
ADC 20 MikroBUS Map | |
MikroBUS pin mapping of ADC 20 Click driver. | |
Functions | |
void | adc20_cfg_setup (adc20_cfg_t *cfg) |
ADC 20 configuration object setup function. | |
err_t | adc20_init (adc20_t *ctx, adc20_cfg_t *cfg) |
ADC 20 initialization function. | |
err_t | adc20_default_cfg (adc20_t *ctx) |
ADC 20 default configuration function. | |
err_t | adc20_write_register (adc20_t *ctx, uint8_t reg, uint8_t data_in) |
ADC 20 write register function. | |
err_t | adc20_read_register (adc20_t *ctx, uint8_t reg, uint8_t *data_out) |
ADC 20 read register function. | |
err_t | adc20_read_data (adc20_t *ctx, uint16_t *data_out) |
ADC 20 read data function. | |
err_t | adc20_check_communication (adc20_t *ctx) |
ADC 20 check communication function. | |
err_t | adc20_start_auto_sequence (adc20_t *ctx) |
ADC 20 start auto sequence function. | |
err_t | adc20_stop_auto_sequence (adc20_t *ctx) |
ADC 20 stop auto sequence function. | |
err_t | adc20_set_pin_config (adc20_t *ctx, uint8_t ch_mask, uint8_t pin_cfg) |
ADC 20 set pin config function. | |
err_t | adc20_set_gpio_config (adc20_t *ctx, uint8_t ch_mask, uint8_t gpio_cfg) |
ADC 20 set gpio config function. | |
err_t | adc20_set_gpo_drive_config (adc20_t *ctx, uint8_t ch_mask, uint8_t gpo_drive_cfg) |
ADC 20 set gpo drive config function. | |
err_t | adc20_set_gpo_value (adc20_t *ctx, uint8_t ch_mask, uint8_t value) |
ADC 20 set gpo value function. | |
err_t | adc20_read_gpio_value (adc20_t *ctx, uint8_t *gpio_value) |
ADC 20 read gpio value function. | |
API for configuring and manipulating ADC 20 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void adc20_cfg_setup | ( | adc20_cfg_t * | cfg | ) |
ADC 20 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See adc20_cfg_t object definition for detailed explanation. |
err_t adc20_check_communication | ( | adc20_t * | ctx | ) |
ADC 20 check communication function.
This function checks the communication by reading and verifying the fixed code bytes.
[in] | ctx | : Click context object. See adc20_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc20_default_cfg | ( | adc20_t * | ctx | ) |
ADC 20 default configuration function.
This function executes a default configuration of ADC 20 click board.
[in] | ctx | : Click context object. See adc20_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc20_init | ( | adc20_t * | ctx, |
adc20_cfg_t * | cfg ) |
ADC 20 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See adc20_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See adc20_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc20_read_data | ( | adc20_t * | ctx, |
uint16_t * | data_out ) |
ADC 20 read data function.
This function reads two bytes of data by using SPI serial interface.
[in] | ctx | : Click context object. See adc20_t object definition for detailed explanation. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc20_read_gpio_value | ( | adc20_t * | ctx, |
uint8_t * | gpio_value ) |
ADC 20 read gpio value function.
This function reads the gpio pins value.
[in] | ctx | : Click context object. See adc20_t object definition for detailed explanation. |
[out] | gpio_value | : GPIO pins value, whole port. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc20_read_register | ( | adc20_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
ADC 20 read register function.
This function reads data from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See adc20_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 adc20_set_gpio_config | ( | adc20_t * | ctx, |
uint8_t | ch_mask, | ||
uint8_t | gpio_cfg ) |
ADC 20 set gpio config function.
This function sets the gpio config value for the selected channels.
[in] | ctx | : Click context object. See adc20_t object definition for detailed explanation. |
[in] | ch_mask | : Channel selection mask. |
[in] | gpio_cfg | : GPIO config value
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc20_set_gpo_drive_config | ( | adc20_t * | ctx, |
uint8_t | ch_mask, | ||
uint8_t | gpo_drive_cfg ) |
ADC 20 set gpo drive config function.
This function sets the gpo drive config value for the selected channels.
[in] | ctx | : Click context object. See adc20_t object definition for detailed explanation. |
[in] | ch_mask | : Channel selection mask. |
[in] | gpo_drive_cfg | : GPO drive config value
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc20_set_gpo_value | ( | adc20_t * | ctx, |
uint8_t | ch_mask, | ||
uint8_t | value ) |
ADC 20 set gpo value function.
This function sets the gpo value for the selected channels.
[in] | ctx | : Click context object. See adc20_t object definition for detailed explanation. |
[in] | ch_mask | : Channel selection mask. |
[in] | value | : GPO value
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc20_set_pin_config | ( | adc20_t * | ctx, |
uint8_t | ch_mask, | ||
uint8_t | pin_cfg ) |
ADC 20 set pin config function.
This function sets the pin config value for the selected channels.
[in] | ctx | : Click context object. See adc20_t object definition for detailed explanation. |
[in] | ch_mask | : Channel selection mask. |
[in] | pin_cfg | : Pin config value
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc20_start_auto_sequence | ( | adc20_t * | ctx | ) |
ADC 20 start auto sequence function.
This function starts the auto sequencing by setting the SEQUENCE_CFG register.
[in] | ctx | : Click context object. See adc20_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc20_stop_auto_sequence | ( | adc20_t * | ctx | ) |
ADC 20 stop auto sequence function.
This function stops the auto sequencing by setting the manual sequence mode.
[in] | ctx | : Click context object. See adc20_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc20_write_register | ( | adc20_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
ADC 20 write register function.
This function writes a desired data to the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See adc20_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.