[Tinyos-beta-commits] CVS: tinyos-1.x/beta/teps/txt tep101.txt, 1.9, 1.10

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/txt
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24591/beta/teps/txt

Modified Files:
	tep101.txt 
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.txt
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/teps/txt/tep101.txt,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** tep101.txt	6 Jun 2005 21:28:19 -0000	1.9
--- tep101.txt	8 Jun 2005 08:13:38 -0000	1.10
***************
*** 170,181 ****
                              ^
                              |
!                    MSP430ADC12SingleChannel[]  
                              |
!                    +---------------------+
!                    |     MSP430ADC12C    |
!     HAL1:          | (MSP430 specific    | location: tinyos-2.x/tos/chips/msp430
!                    |  implementation and | 
!                    |  representation)    |
!                    +---------------------+
                              ^
                              |
--- 170,180 ----
                              ^
                              |
!                    MSP430ADC12SingleChannel  
                              |
!                    +-----------------------+
!                    |    MSP430ADC12C       |
!     HAL1:          | (accessed via generic | location: tinyos-2.x/tos/chips/msp430
!                    |  MSP430ADC12Client)   |
!                    +-----------------------+
                              ^
                              |
***************
*** 280,288 ****
  As explained in the `Overview`_ 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.
    
  Hardware Adaptation SubLayer1 (HAL1)
--- 279,288 ----
  As explained in the `Overview`_ 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.
    
  Hardware Adaptation SubLayer1 (HAL1)
***************
*** 300,325 ****
             {
               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];
             }
  
!        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.:: 
!               
           generic configuration MSP430ADC12Client()
           {
              provides interface Resource;
              provides interface MSP430ADC12SingleChannel;
-          } implementation {
-             components MSP430ADC12C;
-             
-             Resource = MSP430ADC12C.Resource[unique(ADC_RESOURCE)];
-             MSP430ADC12SingleChannel = MSP430ADC12C.MSP430ADC12SingleChannel[unique(MSP430ADC12_CLIENT)];
           }
  
--- 300,316 ----
             {
               provides interface Init;
!              provides interface Resource[uint8_t id];
               provides interface MSP430ADC12SingleChannel as SingleChannel[uint8_t id];
             }
  
!        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.:: 
!                      
           generic configuration MSP430ADC12Client()
           {
              provides interface Resource;
              provides interface MSP430ADC12SingleChannel;
           }
  
***************
*** 343,380 ****
             {     
               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;
   
!        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.
         
         The *getData* commands use the four different conversion modes
--- 334,372 ----
             {     
               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;
+ 
   
!        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 *getData* 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.
         
         The *getData* commands use the four different conversion modes
***************
*** 461,477 ****
  
         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.
! 
         i. MSP430
         
--- 453,465 ----
  
         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.
!        
         i. MSP430
         
***************
*** 493,506 ****
           }
           implementation {
!            components ADCM, MSP430ADC12ChannelConfigM, MSP430ADC12C;
!            
             Init = MSP430ADC12C;
!            Resource = MSP430ADC12C;
             AcquireData = ADCM;
             AcquireDataNow = ADCM;
             AcquireDataBuffered = ADCM;
         
!            ADCM.SingleChannel -> MSP430ADC12C.SingleChannelADCC;
!            ADCM.MSP430ADC12ChannelConfig -> MSP430ADC12ChannelConfigM;
           }
         
--- 481,497 ----
           }
           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;
           }
         
***************
*** 551,555 ****
  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.
   
  4. Author's Address
--- 542,546 ----
  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.
   
  4. Author's Address



More information about the Tinyos-beta-commits mailing list