MICA Light Sensor
[Device Drivers]


Defines

#define dev_open_DEV_MICA2_LIGHT()   mos_mutex_lock(&lt_mutex)
 gain an exclusive lock on the MICA2 Light Driver. Any other threads calling dev_open_DEV_MICA2_LIGHT() will block until the owner calls dev_close_DEV_MICA2_LIGHT(). Note that because the MICA2 Light and MICA2 Temperature drivers share the same ADC line, an exclusive lock on the light driver will also prevent other threads from gaining a lock on the temperature driver.
#define dev_close_DEV_MICA2_LIGHT()   mos_mutex_unlock(&lt_mutex)
 release exclusive lock on the MICA2 Light Driver. Any other thread blocking on dev_open_DEV_MICA2_LIGHT() will now unblock. Note that because the MICA2 Light and MICA2 Temperature drivers share the same ADC line, an exclusive lock on the light driver will also prevent other threads from gaining a lock on the temperature driver.

Functions

uint16_t dev_read_DEV_MICA2_LIGHT (void *buf, uint16_t count)
 read from the Light sensor into buf.
uint16_t dev_write_DEV_MICA2_LIGHT (const void *buf, uint16_t count)
 not supported for the MICA2 Light driver.
uint8_t dev_mode_DEV_MICA2_LIGHT (uint8_t md)
 change the status of the MICA2 Light Driver. Accepted parameters are:
  1. DEV_MODE_OFF: Turn the device off.
  2. DEV_MODE_ON: Turn the device on.

uint8_t dev_ioctl_DEV_MICA2_LIGHT (int8_t request,...)
 not supported for the MICA2 Light driver.

Variables

mos_mutex_t lt_mutex

Detailed Description

This group contains functions associated with the MICA Light Sensor. This applies to the MICAz and MICA2 platforms.

Function Documentation

uint8_t dev_ioctl_DEV_MICA2_LIGHT int8_t  request,
  ...
 

Parameters:
request ignored.
... ignored.
Returns:
DEV_BAD_IOCTL

uint8_t dev_mode_DEV_MICA2_LIGHT uint8_t  md  ) 
 

Parameters:
md The mode you wish to change to.
Returns:
DEV_OK or DEV_UNSUPPORTED.

uint16_t dev_read_DEV_MICA2_LIGHT void *  buf,
uint16_t  count
 

Parameters:
count the number of bytes to read. A value of '1' will read an 8-bit value; a value of '2' will read a 16-bit value. any other value will return DEV_UNSUPPORTED.
buf the buffer to store the result in.
Returns:
the number of bytes read. Must be either '1' or '2'.

uint16_t dev_write_DEV_MICA2_LIGHT const void *  buf,
uint16_t  count
 

Parameters:
buf ignored.
count ignored.
Returns:
DEV_UNSUPPORTED


Variable Documentation

mos_mutex_t lt_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