ADG2404/ADG6404/ADG2704 Driver
Supported Devices
Overview
The ADG2404/ADG6404/ADG2704 are CMOS analog multiplexers. All are 4:1 single-ended multiplexers sharing an identical control interface (A0, A1, EN). This driver provides control over the multiplexer channel selection and enable/disable functionality for all device variants.
ADG2404/ADG6404 features:
4:1 single-ended multiplexer
0.62Ω on-resistance
Fast switching times
Break-before-make switching
Identical control interface (A0, A1, EN)
ADG2404 specifications: * ±16.5V dual supply or +16.5V single supply * 1.8V/3.3V/5V logic compatible
ADG6404 specifications: * ±20V dual supply or +36V single supply * Higher voltage capability for demanding applications
ADG2704 specifications:
±1.08V to ±2.75V dual supply or +1.08V to +5.5V single supply
9.1Ω on-resistance
Ultra-low leakage, ±0.3pA typical at 25°C
1.8V and 3V JEDEC compliant logic
Hardware Configuration
The driver requires three GPIO connections:
A0: Address bit 0 for channel selection
A1: Address bit 1 for channel selection
EN: Enable/disable control (active high)
Channel Selection
The multiplexer supports 4 channels (S1-S4) plus an "all off" state using the following enum:
ADG2404_CH_OFF: All channels off (disables the multiplexer)ADG2404_S1: Channel S1 selected (A1=0, A0=0)ADG2404_S2: Channel S2 selected (A1=0, A0=1)ADG2404_S3: Channel S3 selected (A1=1, A0=0)ADG2404_S4: Channel S4 selected (A1=1, A0=1)
Device Selection
The part in use is selected through the id field of
struct adg2404_init_param:
ID_ADG2404ID_ADG6404ID_ADG2704
The device structure exposes the matching entry of the chip information table
as dev->chip_info, which carries the part name.
API Functions
- Initialization
int adg2404_init(struct adg2404_dev **device, struct adg2404_init_param *init_param)Initialize the device and configure GPIO pins. The
idfield selects the part; passing an out-of-range value returns-EINVAL.- Channel Selection
int adg2404_select_channel(struct adg2404_dev *dev, enum adg2404_channel channel)Select one of the multiplexer channels or turn all channels off. Use
ADG2404_CH_OFFto disable all channels, orADG2404_S1toADG2404_S4to select a specific channel.- Enable/Disable
int adg2404_enable(struct adg2404_dev *dev, bool enable)Enable or disable the multiplexer using
trueto enable orfalseto disable.- Cleanup
int adg2404_remove(struct adg2404_dev *dev)Free resources allocated during initialization.
Usage Example
struct adg2404_dev *dev;
struct adg2404_init_param init_param = {
.id = ID_ADG2404,
.gpio_a0 = { /* A0 GPIO configuration */ },
.gpio_a1 = { /* A1 GPIO configuration */ },
.gpio_en = { /* EN GPIO configuration */ },
};
// Initialize the device
ret = adg2404_init(&dev, &init_param);
if (ret)
return ret;
// Select channel S2 (automatically enables the multiplexer)
ret = adg2404_select_channel(dev, ADG2404_S2);
if (ret)
goto cleanup;
// Turn off all channels (disables the multiplexer)
ret = adg2404_select_channel(dev, ADG2404_CH_OFF);
if (ret)
goto cleanup;
cleanup:
adg2404_remove(dev);