Skip to main content

ADC Lib API

danger

this is a legacy library and thus not supported by Toradex anymore. We recommend that you use the new libraries for all Toradex modules. Please see the Toradex CE Libraries and Code Samples for up-to-date information.


Library to support ADC interfacing. More...

Macros

##define CODEC_UNKNOWN   0 #define CODEC_UCB1400   1 #define CODEC_WM9713   2 #define CODEC_WM9715   3 #define CODEC_SGTL5000   4 #define ADC_VER_MAJ   2 Version Info. More...
 #define ADC_VER_MIN   3 #define ADC_VER_BUILD   0 

Functions

BOOL Ac97Init (void)
 
BOOL Ac97DeInit (void)
 
void ADCGetLibVersion (DWORD *pVerMaj, DWORD *pVerMin, DWORD *pBuild)
 
DWORD getCodecType (void)
 
BOOL ReadADCChannel (BYTE channel, DWORD *value, DWORD samples)
 
DWORD MicrovoltsPerLsb (BYTE channel)
 
DWORD ReadTouch (BYTE mode, DWORD filter)
 
BOOL Ac97Write (UINT16 offset, UINT16 data)
 
BOOL Ac97Read (UINT16 offset, UINT16 *pdata)
 

Detailed Description

Library to support ADC interfacing.
Author
samuel.bissig
Rev
2688
Date
2015-03-09 13:36:34 +0100 (Mo, 09 Mrz 2015)
Target Platforms:
PXAxxx, T20

Macro Definition Documentation

#define ADC_VER_BUILD   0
#define ADC_VER_MAJ   2
Version Info.
#define ADC_VER_MIN   3
#define CODEC_SGTL5000   4
#define CODEC_UCB1400   1
#define CODEC_UNKNOWN   0
#define CODEC_WM9713   2
#define CODEC_WM9715   3

Function Documentation

BOOL Ac97DeInit(void  ) 
Deinitializes the AC97 interface.
Return values
TRUESuccess.
FALSEError.
BOOL Ac97Init(void  ) 
Initializes the AC97 interface.
Return values
TRUESuccess.
FALSEError.
BOOL Ac97Read(UINT16 offset,
  UINT16 * pdata 
 )  
Directly reads an AC97 register.
Parameters
[in]offsetRegister address.
[out]pdata16-bit value read from the register.
Return values
TRUESuccess.
FALSEError.
BOOL Ac97Write(UINT16 offset,
  UINT16 data 
 )  
Directly writes to an AC97 register
Parameters
[in]offsetRegister address.
[in]data16-bit value to write into the register.
Return values
TRUESuccess.
FALSEError.
void ADCGetLibVersion(DWORD * pVerMaj,
  DWORD * pVerMin,
  DWORD * pBuild 
 )  
Reads the library Version.
Parameters
[out]pVerMajMajor version number.
[out]pVerMinMinor version number.
[out]pBuildBuild number.
DWORD getCodecType(void  ) 
Reads which codec is installed on the current Colibri module.
Return values
0Codec unknown.
1UCB1400.
2WM9713.
3WM9715.
4SGTL5000
DWORD MicrovoltsPerLsb(BYTE channel) 
Gets Converstion constant Microvolts per LSB. This can be different for each ADC and even for each channel.
Parameters
[in]channelADC channel number (0..3)
Return values
(7500000/1024)Conversion constant Microvolts per ADC LSB.
(3300000*3/4096)Conversion constant Microvolts per ADC LSB.
(3300000/4096) Conversion constant Microvolts per ADC LSB.
0Error.
BOOL ReadADCChannel(BYTE channel,
  DWORD * value,
  DWORD samples 
 )  
Reads one ADC channel from Colibri's audio codec.
Parameters
[in]channelADC channel number (0..3)
[in]samplesnumber of samples that should be taken, they will be summed up
[out]valueraw ADC value, if sampels>1, value is the SUM of all measurements.
Return values
TRUESuccess.
FALSEError.
DWORD ReadTouch(BYTE mode,
  DWORD filter 
 )  
Reads one value from the touch controller
Parameters
[in]modeX or Y axis measurement.
[in]samplesNumber of samples required.
Return values
valuePosition value.
FALSENo access.
-1Error.
Remarks: Only the UCB1400 codec is currently supported.


Send Feedback!