ADC
[Device Drivers]


Defines

#define dev_open_DEV_ADC()   mos_mutex_lock(&adc_mutex)
 gain an exclusive lock on the ADC. Any other threads calling dev_open_DEV_ADC() will block until the owner calls dev_close_DEV_ADC().
#define dev_close_DEV_ADC()   mos_mutex_unlock(&adc_mutex)
 release exclusive lock on the ADC. Any other thread blocking on dev_open_DEV_ADC() will now unblock.

Functions

uint16_t dev_read_DEV_ADC (void *buf, uint16_t count)
 read from the ADC into buf.
uint16_t dev_write_DEV_ADC (const void *buf, uint16_t count)
 not supported for the ADC.
uint8_t dev_mode_DEV_ADC (uint8_t md)
 change the status of the ADC. Accepted parameters are:
  1. DEV_MODE_OFF: Turn the device off.
  2. DEV_MODE_ON: Turn the device on.

uint8_t dev_ioctl_DEV_ADC (int8_t request,...)
 send an IO Control to the ADC. Accepted parameters are:
  1. ADC_SET_CHANNEL, [int channel]


Variables

mos_mutex_t adc_mutex

Detailed Description

This group contains functions associated with the ADC Driver. This applies to the MICAz, MICA2, and TELOSb platforms.

Function Documentation

uint8_t dev_ioctl_DEV_ADC int8_t  request,
  ...
 

Parameters:
request The requested action.
... any required arguments for the specified IOCTL.
Returns:
DEV_OK or DEV_BAD_IOCTL.

uint8_t dev_mode_DEV_ADC uint8_t  md  ) 
 

Parameters:
md The mode you wish to change to.
Returns:
the mode that the ADC is now in.

uint16_t dev_read_DEV_ADC void *  buf,
uint16_t  count
 

Parameters:
count the number of bytes to read. A value of '1' will read a single byte from the ADC. Any other value will read a 16-bit value.
buf the buffer to store the results in.
Returns:
the number of bytes read (either 1 or 2).

uint16_t dev_write_DEV_ADC const void *  buf,
uint16_t  count
 

Parameters:
count ignored.
buf ignored.
Returns:
DEV_UNSUPPORTED


Variable Documentation

mos_mutex_t adc_mutex
 

For internal use only.

Used by the dev_open and dev_close functions.


Generated on Sun Nov 22 06:26:00 2009 for MANTIS by  doxygen 1.4.6