Analog


Defines

#define AN0   0x00
 Analog port 0.
#define AN1   0x01
 Analog port 1.
#define AN2   0x02
 Analog port 2.
#define AN3   0x03
 Analog port 3.
#define AN4   0x04
 Analog port 4.
#define AN5   0x05
 Analog port 5.
#define AN6   0x06
 Analog port 6.
#define AN7   0x07
 Analog port 7.
#define AN8   0x08
 Analog port 8.
#define AN9   0x09
 Analog port 9.
#define AN10   0x0a
 Analog port 10.
#define AN11   0x0b
 Analog port 11.
#define AN12   0x0c
 Analog port 12.
#define AN13   0x0d
 Analog port 13.
#define AN14   0x0e
 Analog port 14.
#define AN15   0x0f
 Analog port 15.
#define EXT_MUX   AN7
 EXT_MUX analog port.
#define WHEEL_PORT   AN10
 Analog port for the wheel.
#define BATT_PORT   AN11
 Analog port for the battery voltage detector.

Functions

void analog_init (void)
 Initialize analog ports.
unsigned int analog8 (int which)
 Read an 8-bit number from an analog port.
unsigned int analog10 (int which)
 Read a 10-bit number from an analog port.
int wheel (void)
 Read the position of the wheel.

Detailed Description

Functions for manipulation the ADC on the dragonfly board. All definitions may be found in analog.h.

Function Documentation

unsigned int analog10 int  which  ) 
 

Read a 10-bit number from an analog port.

Reads a ten bit number from the specified port. analog_init must be called before using this function.

Parameters:
which the analog port to read from. Typically a constant, one of AN0 - AN7.
Returns:
the ten bit number input to the specified port
See also:
analog_init, analog8

unsigned int analog8 int  which  ) 
 

Read an 8-bit number from an analog port.

Reads an eight bit number from an analog port. analog_init must be called before using this function.

Parameters:
which the analog port to read from. One of the constants AN0 - AN7.
Returns:
the eight bit input to the specified port
See also:
analog_init, analog10

void analog_init void   ) 
 

Initialize analog ports.

Initializes the ADC. Call analog_init before reading from the analog ports.

See also:
analog8, analog10

int wheel void   ) 
 

Read the position of the wheel.

Returns the current position of the wheel, as an integer in the range 0 - 255. analog_init must be called before using this function.

Returns:
the orientation of the wheel, as an integer in the range 0 - 255.
See also:
analog_init


Generated on Wed Sep 5 16:33:32 2007 for libdragonfly by  doxygen 1.4.6