analogmux2 2.0.0.0
|
API for configuring and manipulating Analog MUX 2 Click driver. More...
Topics | |
Analog MUX 2 Registers List | |
List of registers of Analog MUX 2 Click driver. | |
Analog MUX 2 Registers Settings | |
Settings for registers of Analog MUX 2 Click driver. | |
Analog MUX 2 MikroBUS Map | |
MikroBUS pin mapping of Analog MUX 2 Click driver. | |
Status | |
Functions | |
void | analogmux2_cfg_setup (analogmux2_cfg_t *cfg) |
Analog MUX 2 configuration object setup function. | |
err_t | analogmux2_init (analogmux2_t *ctx, analogmux2_cfg_t *cfg) |
Analog MUX 2 initialization function. | |
void | analogmux2_default_cfg (analogmux2_t *ctx) |
Analog MUX 2 default configuration function. | |
void | analogmux2_hw_reset (analogmux2_t *ctx) |
Analog MUX 2 reset the device function. | |
err_t | analogmux2_generic_write (analogmux2_t *ctx, uint8_t tx_data) |
Analog MUX 2 I2C writing function. | |
uint8_t | analogmux2_generic_read (analogmux2_t *ctx) |
Analog MUX 2 I2C reading function. | |
err_t | analogmux2_set_channel (analogmux2_t *ctx, uint8_t mux_ch) |
Analog MUX 2 set channel function. | |
uint8_t | analogmux2_get_channel (analogmux2_t *ctx) |
Analog MUX 2 get channel function. | |
err_t | analogmux2_read_an_pin_value (analogmux2_t *ctx, uint16_t *data_out) |
Analog MUX 2 read AN pin value function. | |
err_t | analogmux2_read_an_pin_voltage (analogmux2_t *ctx, float *data_out) |
Analog MUX 2 read AN pin voltage level function. | |
API for configuring and manipulating Analog MUX 2 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void analogmux2_cfg_setup | ( | analogmux2_cfg_t * | cfg | ) |
Analog MUX 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See analogmux2_cfg_t object definition for detailed explanation. |
void analogmux2_default_cfg | ( | analogmux2_t * | ctx | ) |
Analog MUX 2 default configuration function.
This function executes a default configuration of Analog MUX 2 click board.
[in] | ctx | : Click context object. See analogmux2_t object definition for detailed explanation. |
uint8_t analogmux2_generic_read | ( | analogmux2_t * | ctx | ) |
Analog MUX 2 I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See analogmux2_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t analogmux2_generic_write | ( | analogmux2_t * | ctx, |
uint8_t | tx_data ) |
Analog MUX 2 I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See analogmux2_t object definition for detailed explanation. |
[in] | tx_data | : Data to be written. |
0
- Success, -1
- Error.uint8_t analogmux2_get_channel | ( | analogmux2_t * | ctx | ) |
Analog MUX 2 get channel function.
This function get the active channel by using I2C serial interface.
[in] | ctx | : Click context object. See analogmux2_t object definition for detailed explanation. |
0x00
( ANALOGMUX2_SET_CHANNEL_0 ) - Active channel 0, 0x01
( ANALOGMUX2_SET_CHANNEL_1 ) - Active channel 1, 0x02
( ANALOGMUX2_SET_CHANNEL_2 ) - Active channel 2, 0x03
( ANALOGMUX2_SET_CHANNEL_3 ) - Active channel 3, 0x04
( ANALOGMUX2_SET_CHANNEL_4 ) - Active channel 4, 0x05
( ANALOGMUX2_SET_CHANNEL_5 ) - Active channel 5, 0x06
( ANALOGMUX2_SET_CHANNEL_6 ) - Active channel 6, 0x07
( ANALOGMUX2_SET_CHANNEL_7 ) - Active channel 7, 0xFF
( ANALOGMUX2_SET_NO_CHANNEL )- Disable all channels.void analogmux2_hw_reset | ( | analogmux2_t * | ctx | ) |
Analog MUX 2 reset the device function.
This function executes a hardware reset of Analog MUX 2 click board.
[in] | ctx | : Click context object. See analogmux2_t object definition for detailed explanation. |
err_t analogmux2_init | ( | analogmux2_t * | ctx, |
analogmux2_cfg_t * | cfg ) |
Analog MUX 2 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See analogmux2_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See analogmux2_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t analogmux2_read_an_pin_value | ( | analogmux2_t * | ctx, |
uint16_t * | data_out ) |
Analog MUX 2 read AN pin value function.
This function reads results of AD conversion of the AN pin.
[in] | ctx | : Click context object. See analogmux2_t object definition for detailed explanation. |
[out] | data_out | : Output ADC result. |
0
- Success, -1
- Error.err_t analogmux2_read_an_pin_voltage | ( | analogmux2_t * | ctx, |
float * | data_out ) |
Analog MUX 2 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 analogmux2_t object definition for detailed explanation. |
[out] | data_out | : Output voltage level of the analog pin [V]. |
0
- Success, -1
- Error.err_t analogmux2_set_channel | ( | analogmux2_t * | ctx, |
uint8_t | mux_ch ) |
Analog MUX 2 set channel function.
This function sets the active channel by using I2C serial interface.
[in] | ctx | : Click context object. See analogmux2_t object definition for detailed explanation. |
[in] | mux_ch | :
|
0
- Success, -1
- Error.