gainamp 2.0.0.0
|
API for configuring and manipulating GainAMP Click driver. More...
Modules | |
GainAMP Registers Settings | |
Settings for registers of GainAMP Click driver. | |
GainAMP MikroBUS Map | |
MikroBUS pin mapping of GainAMP Click driver. | |
Functions | |
void | gainamp_cfg_setup (gainamp_cfg_t *cfg) |
GainAMP configuration object setup function. More... | |
err_t | gainamp_init (gainamp_t *ctx, gainamp_cfg_t *cfg) |
GainAMP initialization function. More... | |
err_t | gainamp_generic_write (gainamp_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
GainAMP data writing function. More... | |
err_t | gainamp_generic_read (gainamp_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
GainAMP data reading function. More... | |
err_t | gainamp_read_an_pin_value (gainamp_t *ctx, uint16_t *data_out) |
GainAMP read AN pin value function. More... | |
err_t | gainamp_read_an_pin_voltage (gainamp_t *ctx, float *data_out) |
GainAMP read AN pin voltage level function. More... | |
void | gainamp_reset (gainamp_t *ctx) |
Function for reset chip of the GainAMP Click. More... | |
void | gainamp_set_gain (gainamp_t *ctx, uint8_t gain) |
Function for sets gain of the GainAMP Click. More... | |
API for configuring and manipulating GainAMP Click driver.
void gainamp_cfg_setup | ( | gainamp_cfg_t * | cfg | ) |
GainAMP configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See gainamp_cfg_t object definition for detailed explanation. |
err_t gainamp_generic_read | ( | gainamp_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
GainAMP data reading function.
This function reads a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See gainamp_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t gainamp_generic_write | ( | gainamp_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len | ||
) |
GainAMP data writing function.
This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See gainamp_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error.err_t gainamp_init | ( | gainamp_t * | ctx, |
gainamp_cfg_t * | cfg | ||
) |
GainAMP initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See gainamp_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See gainamp_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t gainamp_read_an_pin_value | ( | gainamp_t * | ctx, |
uint16_t * | data_out | ||
) |
GainAMP read AN pin value function.
This function reads results of AD conversion of the AN pin.
[in] | ctx | : Click context object. See gainamp_t object definition for detailed explanation. |
[out] | data_out | : Output ADC result. |
0
- Success, -1
- Error.err_t gainamp_read_an_pin_voltage | ( | gainamp_t * | ctx, |
float * | data_out | ||
) |
GainAMP read AN pin voltage level function.
This function reads results of AD conversion of the AN pin and converts them to proportional voltage level.
[in] | ctx | : Click context object. See gainamp_t object definition for detailed explanation. |
[out] | data_out | : Output voltage level of the analog pin [V]. |
0
- Success, -1
- Error.void gainamp_reset | ( | gainamp_t * | ctx | ) |
Function for reset chip of the GainAMP Click.
This function performs hardware reset.
[in] | ctx | : Click context object. See gainamp_t object definition for detailed explanation. |