Interface: moteiv.tos.platform.msp430.adc.RefVolt
interface RefVolt
Interface for the msp430 reference voltage generator. This
interface treats the reference voltage generator like a semaphore:
Components can request that they need the generator be switched on
at a certain voltage level (1.5V or 2.5V). Once a level has been
set (signalled by an event) these settings remain fixed until every
component that has successfully requested these settings has
released them. This implies that every component that called the
get
must call release
after it is done.
- Author::
-
Jan Hauer (hauer@tkn.tu-berlin.de)
Commands
command result_t get(RefVolt_t vref)
command RefVolt_t getState()
command result_t release()
Events
event void isStable(RefVolt_t vref)
Commands - Details
get
command result_t get(RefVolt_t vref)
- Parameters:
-
REFERENCE_1_5V
- set vref to 1.5 V.
REFERENCE_2_5V set vref to 2.5 V.
- Returns:
-
SUCCESS if command was accepted, use
getState
to find out if vref is stable. Always call
release
after you dont need vref anymore.
FAIL if reference voltage generator is
already in use at a different voltage level or
ADC is busy doing a conversion (during that time
the reference voltage generator may not be switched
on).
getState
command RefVolt_t getState()
- Returns:
-
REFERENCE_1_5V if vref is 1.5 V (stable)
REFERENCE_2_5V if vref is 2.5 V (stable)
UNSTABLE if reference voltage generator is off or vref is unstable.
release
command result_t release()
- Returns:
-
FAIL if the semaphore-counter is 0 already
SUCCESS else
Events - Details
isStable
event void isStable(RefVolt_t vref)
- Parameters:
-
REFERENCE_1_5V
- if vref is 1.5 V (stable)
REFERENCE_2_5V if vref is 2.5 V (stable)