1    /* --COPYRIGHT--,EPL
     2     *  Copyright (c) 2008 Texas Instruments and others.
     3     *  All rights reserved. This program and the accompanying materials
     4     *  are made available under the terms of the Eclipse Public License v1.0
     5     *  which accompanies this distribution, and is available at
     6     *  http://www.eclipse.org/legal/epl-v10.html
     7     *
     8     *  Contributors:
     9     *      Texas Instruments - initial implementation
    10     *
    11     * --/COPYRIGHT--*/
    12    import ti.catalog.msp430.peripherals.clock.IClock;
    13    
    14    /*!
    15     *  ======== ITimer ========
    16     *  MSP430 ITimer interface
    17     */
    18    metaonly interface ITimer inherits xdc.platform.IPeripheral {
    19    
    20       /*!
    21        *  ======== regIntVect_t ========
    22        *  Interrupt vector description
    23        *
    24        *  Type to describe a single interrupt vector pin and all its possible
    25        *  configurations.
    26        *
    27        *  @see #regIntVect_t
    28        */
    29        struct regIntVect_t {
    30            String                    registerName;
    31            String                    registerDescription;
    32            String                    isrToggleString;
    33            String                    priorityName;
    34            Bool                      interruptEnable;
    35            Bool                      interruptHandler;
    36            Int                       priority;
    37        }
    38    
    39        /*!
    40        *  ======== ForceSetDefaultRegister_t ========
    41        *  Force Set Default Register
    42        *
    43        *  Type to store if each register needs to be forced initialized
    44        *  even if the register is in default state.
    45        *
    46        *  @see #ForceSetDefaultRegister_t
    47        */
    48        struct ForceSetDefaultRegister_t {
    49            String     register;
    50            Bool       regForceSet;
    51        }
    52    
    53        create(IClock.Instance clock);
    54    
    55    instance:
    56        /*!
    57         *  ======== baseAddr ========
    58         *  Address of the peripheral's control register.
    59         *
    60         *  A peripheral's registers are commonly accessed through a structure
    61         *  that defines the offsets of a particular register from the lowest
    62         *  address mapped to a peripheral. That lowest address is specified by
    63         *  this parameter.
    64         */
    65        config UInt baseAddr;
    66    
    67        /*!
    68         *  ======== intNum ========
    69         *  Interrupt source number
    70         *
    71         */
    72        config UInt intNum;
    73    
    74        /*!
    75         *  ======== numberOfTimers ========
    76         *  Stores the number of available timer capture compare blocks
    77         *
    78         */
    79        config UChar numberOfTimers;
    80    
    81        /*!
    82        *  ======== setTxxCCRx ========
    83        *  Sets TxxCCRx register value based on which CCR register
    84        *
    85        *  @see #setTxxCCRx
    86        */
    87        void setTxxCCRx(UChar ccrNumber , Bits16 value);
    88    
    89       /*!
    90        *  ======== getTxxCCRx ========
    91        *  Returns TxxCCRx register value based on which CCR register
    92        *
    93        *  @see #getTxxCCRx
    94        */
    95        Bits16 getTxxCCRx(UChar ccrNumber);
    96    
    97       /*!
    98        *  ======== isInternal ========
    99        *  Boolean that is true if a Timer is internal, meaning
   100        *  it has no external inputs or outputs
   101        *
   102        */
   103        config Bool isInternal = false;
   104    
   105        /*! @_nodoc */
   106        config IClock.Instance clock;
   107    }