Temperature.h File Reference

#include <avr/pgmspace.h>
#include "../AT90USBXXX/ADC.h"
#include "../../Common/Common.h"

Defines

#define TEMP_ADC_CHANNEL   0
#define TEMP_MIN_TEMP   TEMP_TABLE_OFFSET
#define TEMP_MAX_TEMP   ((TEMP_TABLE_SIZE - 1) + TEMP_TABLE_OFFSET)
#define Temperature_Init()   ADC_SetupChannel(TEMP_ADC_CHANNEL);

Functions

int8_t Temperature_GetTemperature (void) ATTR_WARN_UNUSED_RESULT

Detailed Description

Temperature sensor board driver for the USB boards which contain a temperature sensor.

Define Documentation

#define TEMP_ADC_CHANNEL   0

ADC channel number for the temperature sensor.

#define TEMP_MAX_TEMP   ((TEMP_TABLE_SIZE - 1) + TEMP_TABLE_OFFSET)

Maximum returnable temperature from the Temperature_GetTemperature() function.

#define TEMP_MIN_TEMP   TEMP_TABLE_OFFSET

Minimum returnable temperature from the Temperature_GetTemperature() function.

 
#define Temperature_Init (  )     ADC_SetupChannel(TEMP_ADC_CHANNEL);

Initializes the temperature sensor driver, including setting up the appropriate ADC channel. This must be called before any other temperature sensor routines.

The ADC itself (not the ADC channel) must be configured seperately before calling the temperature sensor functions.


Function Documentation

int8_t Temperature_GetTemperature ( void   ) 

Performs a complete ADC on the temperature sensor channel, and converts the result into a valid temperature between TEMP_MIN_TEMP and TEMP_MAX_TEMP in degrees Celcius.

Returns:
Signed temperature in degrees Celcius


Generated on Wed Apr 1 16:39:51 2009 for LUFA Library by  doxygen 1.5.7.1