SZS ez430-RF2480 1.0

ZigBee Sensor Network with synchronized time and time-stamped measurements.
adc.c File Reference

ADC10 sensors reading implementation. More...

#include <msp430.h>
#include "adc.h"
+ Include dependency graph for adc.c:

Go to the source code of this file.

Macros

#define ADC_FLAGTEMPDONE   BIT0
 Flag to indicate temperature reading done.
 
#define ADC_FLAGVOLTDONE   BIT1
 Flag to indicate voltage reading done.
 
#define ADC_FLAGLUXDONE   BIT2
 Flag to indicate luminance reading done.
 
#define ADC_LUXSENSFEEDBIT   BIT1
 Feed bit of the luminance sensor, on port 2 (P2.1).
 

Typedefs

typedef enum adc_state adc_state
 States of the ADC10.
 

Enumerations

enum  adc_state {
  ADC_S_IDLE, ADC_S_CHARGING_T, ADC_S_READING_T, ADC_S_CHARGING_V,
  ADC_S_READING_V, ADC_S_CHARGING_L, ADC_S_READING_L
}
 States of the ADC10. More...
 

Functions

void adc_init ()
 This function initializes the ADC variables. More...
 
UInt16 adc_proccess ()
 This function processes the tasks of the ADC. More...
 
void adc_getTemp (UInt16 *temp, clock_timeStamp *tempTime)
 This function get current stored temperature. More...
 
void adc_getVolt (UInt16 *volt, clock_timeStamp *voltTime)
 This function get current stored voltage. More...
 
void adc_getLux (UInt16 *lux, clock_timeStamp *luxTime)
 This function get current stored luminescence. More...
 
void ADC10_ISR ()
 ADC10 Interrupt Service Request. More...
 

Variables

adc_state adc_currentState
 Current state of the ADC10. More...
 
UInt16 adc_temp
 Value of last temperature reading.
 
clock_timeStamp adc_tempTime
 Time of last temperature reading.
 
UInt16 adc_voltage
 Value of last voltage reading.
 
clock_timeStamp adc_voltageTime
 Time of last voltage reading.
 
UInt16 adc_lux
 Value of last luminance reading.
 
clock_timeStamp adc_luxTime
 Time of last luminance reading.
 
UInt8 adc_flags
 Internal flags for controlling ADC10.
 

Detailed Description

ADC10 sensors reading implementation.

Makes measurements of the sensors connected to the ADC10.

Definition in file adc.c.

Enumeration Type Documentation

enum adc_state

States of the ADC10.

Enumerator
ADC_S_IDLE 

Waiting for next time of measurements.

ADC_S_CHARGING_T 

Charging ADC for temperature reading.

ADC_S_READING_T 

Reading temperature value.

ADC_S_CHARGING_V 

Charging ADC for voltage reading.

ADC_S_READING_V 

Reading voltage value.

ADC_S_CHARGING_L 

Charging ADC for luminance reading.

ADC_S_READING_L 

Reading luminance value.

Definition at line 79 of file adc.c.

Variable Documentation

adc_state adc_currentState

Current state of the ADC10.

Definition at line 124 of file adc.c.

Referenced by ADC10_ISR(), adc_init(), and adc_proccess().