[Tinyos-beta-commits] CVS: tinyos-1.x/beta/teps/html tep101.html,
1.7, 1.8
Jan-Hinrich Hauer
janhauer at users.sourceforge.net
Wed Jun 8 01:13:40 PDT 2005
Update of /cvsroot/tinyos/tinyos-1.x/beta/teps/html
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24591/beta/teps/html
Modified Files:
tep101.html
Log Message:
Adapted the TEP to match latest implementation of the msp430 ADC stack, fixed typos, added note about test application at tinyos-2.x/apps/TestADC.
Index: tep101.html
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/teps/html/tep101.html,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** tep101.html 6 Jun 2005 21:30:38 -0000 1.7
--- tep101.html 8 Jun 2005 08:13:38 -0000 1.8
***************
*** 4,8 ****
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
! <meta name="generator" content="Docutils 0.3.6: http://docutils.sourceforge.net/" />
<title>Analog-to-Digital Converters (ADCs)</title>
<meta name="author" content="Jan-Hinrich Hauer, Philip Levis, Vlado Handziski, David Gay" />
--- 4,8 ----
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
! <meta name="generator" content="Docutils 0.3.7: http://docutils.sourceforge.net/" />
<title>Analog-to-Digital Converters (ADCs)</title>
<meta name="author" content="Jan-Hinrich Hauer, Philip Levis, Vlado Handziski, David Gay" />
***************
*** 281,284 ****
--- 281,285 ----
</head>
<body>
+ <div class="document" id="analog-to-digital-converters-adcs">
<h1 class="title">Analog-to-Digital Converters (ADCs)</h1>
<table class="docinfo" frame="void" rules="none">
***************
*** 308,312 ****
</tbody>
</table>
- <div class="document" id="analog-to-digital-converters-adcs">
<div class="note">
<p class="first admonition-title">Note</p>
--- 309,312 ----
***************
*** 450,461 ****
^
|
! MSP430ADC12SingleChannel[]
|
! +---------------------+
! | MSP430ADC12C |
! HAL1: | (MSP430 specific | location: tinyos-2.x/tos/chips/msp430
! | implementation and |
! | representation) |
! +---------------------+
^
|
--- 450,460 ----
^
|
! MSP430ADC12SingleChannel
|
! +-----------------------+
! | MSP430ADC12C |
! HAL1: | (accessed via generic | location: tinyos-2.x/tos/chips/msp430
! | MSP430ADC12Client) |
! +-----------------------+
^
|
***************
*** 624,632 ****
<p>As explained in the <a class="reference" href="#overview">Overview</a> the HAL consists of two sublayers. To
differentiate the two Hardware Adaptation 'sub'Layers they are called
! HAL2 (for the HAL providing a parameterized AcquireData and AcquireData
! interface) and HAL1 (for the 'traditional' HAL). In the hardware stack
! for the ADC the HAL1 resides below HAL2, i.e. HAL2 uses the primitives
! of HAL1. Only chip dependent application may wire to HAL1 or HAL2 i.e.
! platform independent applications MUST NOT wire to HAL1 or HAL2.</p>
<div class="section" id="hardware-adaptation-sublayer1-hal1">
<h2><a name="hardware-adaptation-sublayer1-hal1">Hardware Adaptation SubLayer1 (HAL1)</a></h2>
--- 623,632 ----
<p>As explained in the <a class="reference" href="#overview">Overview</a> the HAL consists of two sublayers. To
differentiate the two Hardware Adaptation 'sub'Layers they are called
! HAL2 (for the HAL providing a parameterized AcquireData and
! AcquireDataNow interface) and HAL1 (for the 'traditional' HAL). In the
! hardware stack for the ADC the HAL1 resides below HAL2, i.e. HAL2 uses
! the primitives of HAL1. Only chip dependent application may wire to
! HAL1 or HAL2 i.e. platform independent applications MUST NOT wire to
! HAL1 or HAL2.</p>
<div class="section" id="hardware-adaptation-sublayer1-hal1">
<h2><a name="hardware-adaptation-sublayer1-hal1">Hardware Adaptation SubLayer1 (HAL1)</a></h2>
***************
*** 647,662 ****
{
provides interface Init;
! provides interface Resource[uint8_t client];
provides interface MSP430ADC12SingleChannel as SingleChannel[uint8_t id];
- provides interface MSP430ADC12SingleChannel as SingleChannelADCC[uint8_t id];
}
</pre>
! <p>MSP430ADC12C provides two parameterized
! MSP430ADC12SingleChannel interfaces. "SingleChannel" is
! provided to chip dependent applications, "SingleChannelADCC" is
! reserved for the ADCC component (see 'Hardware Adaptation
! SubLayer2 (HAL2)'_). An application SHOULD NOT directly wire
! to the MSP430ADC12C, but to an instantiation of the following
! generic configuration.:</p>
<pre class="literal-block">
generic configuration MSP430ADC12Client()
--- 647,658 ----
{
provides interface Init;
! provides interface Resource[uint8_t id];
provides interface MSP430ADC12SingleChannel as SingleChannel[uint8_t id];
}
</pre>
! <p>MSP430ADC12C provides a parameterized MSP430ADC12SingleChannel
! interface to access the ADC12 on a per-channel basis. However, an
! application SHOULD NOT directly wire to the MSP430ADC12C, but to
! an instantiation of the following generic configuration.:</p>
<pre class="literal-block">
generic configuration MSP430ADC12Client()
***************
*** 664,672 ****
provides interface Resource;
provides interface MSP430ADC12SingleChannel;
- } implementation {
- components MSP430ADC12C;
-
- Resource = MSP430ADC12C.Resource[unique(ADC_RESOURCE)];
- MSP430ADC12SingleChannel = MSP430ADC12C.MSP430ADC12SingleChannel[unique(MSP430ADC12_CLIENT)];
}
</pre>
--- 660,663 ----
***************
*** 689,726 ****
{
async event msp430adc12_channel_config_t getConfigurationData();
! async command msp430adc12_result_t getDataSingle();
! async command msp430adc12_result_t getDataSingleRepeat(uint16_t jiffies);
! async command msp430adc12_result_t getDataMultiple(uint16_t *buf,
uint16_t length, uint16_t jiffies);
! async command msp430adc12_result_t getDataMultipleRepeat(uint16_t *buf,
uint8_t length, uint16_t jiffies);
! async event result_t dataSingleReady(uint16_t data);
! async event uint16_t* dataMultipleReady(uint16_t *buf, uint16_t length);
}
typedef struct
{
! unsigned int refVolt2_5: 1; // reference voltage level
! unsigned int clockSourceSHT: 2; // clock source sample-hold-time
! unsigned int clockSourceSAMPCON: 2; // clock source sampcon signal
! unsigned int clockDivSAMPCON: 2; // clock divider sampcon
! unsigned int referenceVoltage: 3; // reference voltage
! unsigned int clockDivSHT: 3; // clock divider sample-hold-time
! unsigned int inputChannel: 4; // input channel
! unsigned int sampleHoldTime: 4; // sample-hold-time
} msp430adc12_channel_config_t;
</pre>
! <p>An application needs to implement an event handler for the
! MSP430ADC12SingleChannel.getConfigurationData() event. This
event handler MUST return the configuration data for the
! channel the application wants to sample. The event MAY be
! signalled multiple times by HAL1 and the application MUST
! return the same configuration data for each of these
! events. This approach (in contrast to a command) has the
! advantage that HAL1 does not need to maintain a table of
! configuration data in RAM. Instead configuration data is
! retrieved from the application at runtime whenever needed. The
! application SHOULD keep configuration data in program memory
! (flash), not in RAM.</p>
<p>The <em>getData</em> commands use the four different conversion modes
of the ADC12: A single channel converted once or repeatedly or
--- 680,717 ----
{
async event msp430adc12_channel_config_t getConfigurationData();
! async command msp430adc12_result_t getSingleData();
! async command msp430adc12_result_t getSingleDataRepeat(uint16_t jiffies);
! async command msp430adc12_result_t getMultipleData(uint16_t *buf,
uint16_t length, uint16_t jiffies);
! async command msp430adc12_result_t getMultipleDataRepeat(uint16_t *buf,
uint8_t length, uint16_t jiffies);
! async event result_t singleDataReady(uint16_t data);
! async event uint16_t* multipleDataReady(uint16_t *buf, uint16_t length);
}
typedef struct
{
! unsigned int inch: 4; // input channel
! unsigned int sref: 3; // reference voltage
! unsigned int ref2_5v: 1; // reference voltage level
! unsigned int adc12ssel: 2; // clock source sample-hold-time
! unsigned int adc12div: 3; // clock divider sample-hold-time
! unsigned int sht: 4; // sample-hold-time
! unsigned int sampcon_ssel: 2; // clock source sampcon signal
! unsigned int sampcon_id: 2; // clock divider sampcon
! unsigned int : 0; // align to a word boundary
} msp430adc12_channel_config_t;
</pre>
! <p>An application needs to implement an event handler for
! the MSP430ADC12SingleChannel.getConfigurationData() event. This
event handler MUST return the configuration data for the
! channel the application wants to sample. The event will be
! signalled by HAL1 each time a <em>getData</em> command is called to
! request the respective channel configuration settings. This
! approach (in contrast to a command) has the advantage that HAL1
! does not need to maintain a table of configuration data in RAM.
! Instead configuration data is retrieved from the application at
! runtime whenever needed. The application SHOULD keep
! configuration data in program memory (flash), not in RAM.</p>
<p>The <em>getData</em> commands use the four different conversion modes
of the ADC12: A single channel converted once or repeatedly or
***************
*** 810,825 ****
<blockquote>
<p>The HAL2 representation allows access to an ADC on a port
! basis. For ADCs that require more detailed configuration
! information than the port number an additional
! mechanism is required for the HAL2 implementation to
! determine what the actual chip-specific settings for a given
! ADC port are. For example, the HAL2 module of the
! ADC12 on MSP430 needs to know the exact configuration settings
! ADC channel (port) in order to successfully call the
! for a given MSP430ADC12SingleChannel.bind() command. What these
! settings are can only be determined on a platform or sensorboard
! level and not within the ADC hardware stack itself. The mapping of
! a channel number to its settings must be well-defined for all
! relevant ADCs.</p>
<ol class="lowerroman simple">
<li>MSP430</li>
--- 801,812 ----
<blockquote>
<p>The HAL2 representation allows access to an ADC on a port
! basis. For ADCs that require more detailed configuration
! information than the port number an additional mechanism is
! required for the HAL2 implementation to determine what the
! actual chip-specific settings for a given ADC port are. What
! these settings are can only be determined on a platform or
! sensorboard level and not within the ADC hardware stack itself.
! The mapping of a channel number to its settings must be
! well-defined for all relevant ADCs.</p>
<ol class="lowerroman simple">
<li>MSP430</li>
***************
*** 842,855 ****
}
implementation {
! components ADCM, MSP430ADC12ChannelConfigM, MSP430ADC12C;
!
Init = MSP430ADC12C;
! Resource = MSP430ADC12C;
AcquireData = ADCM;
AcquireDataNow = ADCM;
AcquireDataBuffered = ADCM;
! ADCM.SingleChannel -> MSP430ADC12C.SingleChannelADCC;
! ADCM.MSP430ADC12ChannelConfig -> MSP430ADC12ChannelConfigM;
}
</pre>
--- 829,845 ----
}
implementation {
! components ADCM, MSP430ADC12ChannelConfigM, MSP430ADC12C,
! new MSP430ADC12Client() as HAL1;
!
Init = MSP430ADC12C;
! StdControl = ADCM.StdControlNull;
! Resource = ADCM;
AcquireData = ADCM;
AcquireDataNow = ADCM;
AcquireDataBuffered = ADCM;
! ADCM.ResourceHAL1 -> HAL1.Resource;
! ADCM.SingleChannel -> HAL1.MSP430ADC12SingleChannel;
! MSP430ADC12ChannelConfigM.MSP430ADC12ChannelConfig -> ADCM.ChannelConfig;
}
</pre>
***************
*** 899,903 ****
<p>See the tinyos-2.x/tos/ tree. Interfaces are in interfaces/ and HPL,
HAL1 and HAL2 components in chips/. Arbitration service components are
! in lib/adc.</p>
</div>
<div class="section" id="author-s-address">
--- 889,893 ----
<p>See the tinyos-2.x/tos/ tree. Interfaces are in interfaces/ and HPL,
HAL1 and HAL2 components in chips/. Arbitration service components are
! in lib/adc. A test application can be found at tinyos-2.x/apps/TestADC.</p>
</div>
<div class="section" id="author-s-address">
More information about the Tinyos-beta-commits
mailing list