• Ready for review
  • ADC_Sample

    The function ADC_Sample gets samples of the analog voltage-value measured by the UCB1400-Controller on the Trizeps-Module.

    int ADC_Sample( unsigned short * sample, unsigned short axis, int samples ); int sampleADC( unsigned short * sample, unsigned short axis, int samples );

    Parameters

    sample
    Pointer of the variable, that receives the measured sample.

    axis
    Allowed values:

    Value

    Description

    Value

    Description

    ADC_INPUT_AD0

    First ADC-Channel

    ADC_INPUT_AD1

    Second ADC-Channel

    ADC_INPUT_AD2

    Third ADC-Channel

    ADC_INPUT_AD3

    Fourth ADC-Channel

    ADC_INPUT_TSPX

    Touch: X-Axis P

    ADC_INPUT_TSMX

    Touch: X-Axis M

    ADC_INPUT_TSPY

    Touch: Y-Axis P

    ADC_INPUT_TSMY

    Touch: Y-Axis M

    samples
    Number of samples to get.

    Return Values

    If the function succeeds, the return value is 1.

    If the function fails, the return value is -1.

    Remarks

    This function uses the AC97-Link functions. So you have to use AC97_Alloc before calling this function. Keep in mind you must protect the access to the AC97-Link! If you just want to read the ADC-values from AD0 to AD3, it is recommend to use ADC_Read. View UCB1400-Datasheet for details.

    Requirements

    OS Versions: Windows CE 4.2 and later.
    Header: drvlib_app.h
    Link Library: drvlib_app.lib

    See Also

    AC97_Alloc, ADC_Read