analogmux2 2.0.0.0
analogmux2.h File Reference

This file contains API for Analog MUX 2 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"
#include "drv_analog_in.h"

Go to the source code of this file.

Data Structures

struct  analogmux2_t
 Analog MUX 2 Click context object. More...
 
struct  analogmux2_cfg_t
 Analog MUX 2 Click configuration object. More...
 

Macros

#define ANALOGMUX2_SET_CHANNEL_0   0x00
 Analog MUX 2 set channel setting.
 
#define ANALOGMUX2_SET_CHANNEL_1   0x01
 
#define ANALOGMUX2_SET_CHANNEL_2   0x02
 
#define ANALOGMUX2_SET_CHANNEL_3   0x03
 
#define ANALOGMUX2_SET_CHANNEL_4   0x04
 
#define ANALOGMUX2_SET_CHANNEL_5   0x05
 
#define ANALOGMUX2_SET_CHANNEL_6   0x06
 
#define ANALOGMUX2_SET_CHANNEL_7   0x07
 
#define ANALOGMUX2_SET_NO_CHANNEL   0xFF
 
#define ANALOGMUX2_VAL_CHANNEL_OFF   0x00
 Analog MUX 2 channel value setting.
 
#define ANALOGMUX2_VAL_CHANNEL_0   0x01
 
#define ANALOGMUX2_VAL_CHANNEL_1   0x02
 
#define ANALOGMUX2_VAL_CHANNEL_2   0x04
 
#define ANALOGMUX2_VAL_CHANNEL_3   0x08
 
#define ANALOGMUX2_VAL_CHANNEL_4   0x10
 
#define ANALOGMUX2_VAL_CHANNEL_5   0x20
 
#define ANALOGMUX2_VAL_CHANNEL_6   0x40
 
#define ANALOGMUX2_VAL_CHANNEL_7   0x80
 
#define ANALOGMUX2_SET_DEV_ADDR_0   0x4C
 Analog MUX 2 device address setting.
 
#define ANALOGMUX2_SET_DEV_ADDR_1   0x4D
 
#define ANALOGMUX2_SET_DEV_ADDR_2   0x4E
 
#define ANALOGMUX2_SET_DEV_ADDR_3   0x4F
 
#define ANALOGMUX2_SUCCESS   0
 Analog MUX 2 error status.
 
#define ANALOGMUX2_ERROR   -1
 
#define ANALOGMUX2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

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.
 

Detailed Description

This file contains API for Analog MUX 2 Click Driver.