sensors.h File Reference

The header file describes the sensors interface. More...

Go to the source code of this file.

Functions

result_t BSP_OpenTemperatureSensor (void)
 Opens temperature sensor.
result_t BSP_CloseTemperatureSensor (void)
 Closes the temperature sensor.
result_t BSP_ReadTemperatureData (void(*f)(bool result, int16_t data))
 Reads data from the temperature sensor.
result_t BSP_OpenLightSensor (void)
 Opens the light sensor.
result_t BSP_CloseLightSensor (void)
 Closes the light sensor.
result_t BSP_ReadLightData (void(*f)(bool result, int16_t data))
 Reads data from the light sensor.
result_t BSP_OpenBatterySensor (void)
 Opens the battery sensor.
result_t BSP_CloseBatterySensor (void)
 Closes the battery sensor.
result_t BSP_ReadBatteryData (void(*callback)(uint8_t data))
 Reads data from battery sensor.


Detailed Description

The header file describes the sensors interface.

Author:
Atmel Corporation: http://www.atmel.com
Support email: avr@atmel.com
Copyright (c) 2008 , Atmel Corporation. All rights reserved. Licensed under Atmel's Limited License Agreement (BitCloudTM).

Definition in file sensors.h.


Function Documentation

result_t BSP_OpenTemperatureSensor ( void   ) 

Opens temperature sensor.

Returns:
FAIL - sensor has been already open.
SUCCESS - otherwise.

result_t BSP_CloseTemperatureSensor ( void   ) 

Closes the temperature sensor.

Returns:
FAIL - if a hardware error has occured or there is uncompleted ReadData request.
SUCCESS - otherwise.

result_t BSP_ReadTemperatureData ( void(*)(bool result, int16_t data)  f  ) 

Reads data from the temperature sensor.

Parameters:
[in] f - callback. result - the result of the requested operation. true - operation finished successfully, false - some error has occured. data - sensor data.
Returns:
FAIL - previous request was not completed.
SUCCESS - otherwise.

result_t BSP_OpenLightSensor ( void   ) 

Opens the light sensor.

Returns:
FAIL - sensor has been already open.
SUCCESS - otherwise.

result_t BSP_CloseLightSensor ( void   ) 

Closes the light sensor.

Returns:
FAIL - if a hardware error has occured or there is uncompleted ReadData request.
SUCCESS - otherwise.

result_t BSP_ReadLightData ( void(*)(bool result, int16_t data)  f  ) 

Reads data from the light sensor.

Parameters:
[in] f - callback. result - the result of the requested operation. true - operation finished successfully, false - some error has occured. data - sensor data.
Returns:
FAIL - previous request was not completed.
SUCCESS - otherwise.

result_t BSP_OpenBatterySensor ( void   ) 

Opens the battery sensor.

Returns:
FAIL - sensor has been already open.
SUCCESS - otherwise.

result_t BSP_CloseBatterySensor ( void   ) 

Closes the battery sensor.

Returns:
FAIL - sensor was not opened.
SUCCESS - otherwise.

result_t BSP_ReadBatteryData ( void(*)(uint8_t data)  callback  ) 

Reads data from battery sensor.

Parameters:
[in] callback - callback function. data - sensor data. Can use (4ul * data * 125ul * 3ul) / (1024ul * 100ul) formula to count
battery data in Volts (for avr).
Returns:
FAIL - previous request was not completed, or sensor was not opened.
SUCCESS - otherwise.


Generated on Mon Feb 16 17:53:40 2009 for BitCloud Stack Documentation by  doxygen 1.5.1-p1