openMMC
Open Source Modular MMC for AMCs
Loading...
Searching...
No Matches
max116xx.h File Reference

MAX116XX ADC driver function declarations. More...

#include "mmc_error.h"
#include "port.h"
Include dependency graph for max116xx.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  max116xx_cfg
 MAX11606-MAX11611 configuration struct. More...
 

Enumerations

enum  max116xx_ref_sel {
  MAX116XX_REF_VDD = 0b0000000 , MAX116XX_REF_EXT = 0b0100000 , MAX116XX_REF_INT_OFF = 0b1000000 , MAX116XX_REF_INT_ON = 0b1010000 ,
  MAX116XX_REF_INT_OFF_OUT = 0b1100000 , MAX116XX_REF_INT_ON_OUT = 0b1110000
}
 MAX11606-MAX11611 reference selection enum. More...
 
enum  max116xx_clk_sel { MAX116XX_CLK_INT = 0b0000 , MAX116XX_CLK_EXT = 0b1000 }
 
enum  max116xx_pol_sel { MAX116XX_UNIPOLAR = 0b000 , MAX116XX_BIPOLAR = 0b100 }
 
enum  max116xx_scan_mode { MAX116XX_SCAN_FROM_AIN0 = 0b000000 , MAX116XX_SCAN_OFF = 0b010000 , MAX116XX_SCAN_UPPER = 0b100000 , MAX116XX_SCAN_OFF_SINGLE_CONV = 0b110000 }
 
enum  max116xx_diff_mode { MAX116XX_DIFFERENTIAL = 0 , MAX116XX_SINGLE_ENDED = 1 }
 

Functions

mmc_err max116xx_set_config (uint8_t chip_id, const max116xx_cfg *cfg)
 Configure the MAX11606-MAX11611 ADC.
 
mmc_err max116xx_read_uni (uint8_t chip_id, int16_t data[], uint8_t samples)
 Convert and read single or multiple channels, unipolar mode.
 
mmc_err max116xx_read_bip (uint8_t chip_id, int16_t data[], uint8_t samples)
 Convert and read single or multiple channels, bipolar mode.
 

Detailed Description

MAX116XX ADC driver function declarations.

Author
Augusto Fraga Giachero augus.nosp@m.to.f.nosp@m.raga@.nosp@m.cnpe.nosp@m.m.br

Enumeration Type Documentation

◆ max116xx_clk_sel

Enumerator
MAX116XX_CLK_INT 
MAX116XX_CLK_EXT 

◆ max116xx_diff_mode

Enumerator
MAX116XX_DIFFERENTIAL 
MAX116XX_SINGLE_ENDED 

◆ max116xx_pol_sel

Enumerator
MAX116XX_UNIPOLAR 
MAX116XX_BIPOLAR 

◆ max116xx_ref_sel

MAX11606-MAX11611 reference selection enum.

Enumerator
MAX116XX_REF_VDD 
MAX116XX_REF_EXT 
MAX116XX_REF_INT_OFF 
MAX116XX_REF_INT_ON 
MAX116XX_REF_INT_OFF_OUT 
MAX116XX_REF_INT_ON_OUT 

◆ max116xx_scan_mode

Enumerator
MAX116XX_SCAN_FROM_AIN0 
MAX116XX_SCAN_OFF 
MAX116XX_SCAN_UPPER 
MAX116XX_SCAN_OFF_SINGLE_CONV 

Function Documentation

◆ max116xx_read_bip()

mmc_err max116xx_read_bip ( uint8_t chip_id,
int16_t data[],
uint8_t samples )

Convert and read single or multiple channels, bipolar mode.

Parameters
[in]chip_idChip ID to communicate
[out]dataArray containing the samples, -512 - +511 range
[in]samplesNumber of samples requested
Returns
MMC_OK if success, an error code otherwise

◆ max116xx_read_uni()

mmc_err max116xx_read_uni ( uint8_t chip_id,
int16_t data[],
uint8_t samples )

Convert and read single or multiple channels, unipolar mode.

Parameters
[in]chip_idChip ID to communicate
[out]dataArray containing the samples, 0 - +1023 range
[in]samplesNumber of samples requested
Returns
MMC_OK if success, an error code otherwise

◆ max116xx_set_config()

mmc_err max116xx_set_config ( uint8_t chip_id,
const max116xx_cfg * cfg )

Configure the MAX11606-MAX11611 ADC.

Parameters
[in]chip_idChip ID to communicate
[in]cfgmax116xx_cfg struct with the current configuration
Returns
MMC_OK if success, an error code otherwise