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    
    13    /*!
    14     *  ======== Clock ========
    15     *  MSP430 Master Clock
    16     */
    17    metaonly interface IClock inherits xdc.platform.IPeripheral {
    18    
    19        /*!
    20        *  ======== ForceSetDefaultRegister_t ========
    21        *  Force Set Default Register
    22        *
    23        *  Type to store if each register needs to be forced initialized
    24        *  even if the register is in default state.
    25        *
    26        *  @see #ForceSetDefaultRegister_t
    27        */
    28        struct ForceSetDefaultRegister_t {
    29            String     register;
    30            Bool       regForceSet;
    31        }
    32    
    33        /*!
    34        *  ======== AvailableClockVariations_t ========
    35        *  Available variations of clock in a device
    36        *
    37        *  Stores true/false if any of the clock variations are
    38        *  available.
    39        *
    40        *  @see #AvailableClockVariations_t
    41        */
    42        struct AvailableClockVariations_t {
    43            String     clockType;
    44            Bool       hasClock;
    45        }
    46    
    47    instance:
    48    
    49        /*!
    50         *  ======== baseAddr ========
    51         *  Address of the peripheral's control register.
    52         *
    53         *  A peripheral's registers are commonly accessed through a structure
    54         *  that defines the offsets of a particular register from the lowest
    55         *  address mapped to a peripheral. That lowest address is specified by
    56         *  this parameter.
    57         */
    58        config UInt baseAddr;
    59    
    60        /*!
    61         *  ======== hasHFXT1 ========
    62         *  Specify if HFXT1 is available on the device.
    63         *
    64         *  Not all devices have high frequency clock. This specifies if
    65         *  it is available for a particular device.
    66         */
    67        config Bool hasHFXT1 = false;
    68    
    69        /*!
    70         *  ======== hasXT2 ========
    71         *  Specify if XT2 is available on the device.
    72         *
    73         *  Not all devices have XT2 clock available. This specifies if
    74         *  it is available for a particular device.
    75         */
    76        config Bool hasXT2 = false;
    77    
    78        /*!
    79         *  ======== hasRosc ========
    80         *  Specify if Rosc is available on the device.
    81         *
    82         *  Not all devices have Rosc circuitry. This specifies if
    83         *  it is available for a particular device.
    84         */
    85        config Bool hasRosc = false;
    86    
    87        /*!
    88         *  ======== hasVLO ========
    89         *  Specify if VLO is available on the device.
    90         *
    91         *  Not all devices have very low frequency clock VLO. This specifies if
    92         *  it is available for a particular device.
    93         */
    94        config Bool hasVLO = false;
    95    
    96        /*!
    97         *  ======== hasAllCal ========
    98         *  Specify if device has all calibration constants.
    99         *
   100         *  G1 devices do not.
   101         */
   102        config Bool hasAllCal = false;
   103    
   104        /*!
   105         *  ======== maxCpuFrequency ========
   106         *  Maximum CPU frequency in Hertz
   107         */
   108        config Float maxCpuFrequency = 0;
   109    
   110        /*!
   111         *  ======== DCOCLKHz ========
   112         *  DCO clock frequency in Hertz
   113         */
   114        readonly config Float DCOCLKHz = 1000000;
   115    
   116        /*!
   117         *  ======== ACLKHz ========
   118         *  ACLK frequency in Hertz
   119         */
   120        readonly config Float ACLKHz;
   121    
   122        /*!
   123         *  ======== MCLKHz ========
   124         *  MCLK frequency in Hertz
   125         */
   126        readonly config Float MCLKHz;
   127    
   128        /*!
   129         *  ======== SMCLKHz ========
   130         *  SMCLK frequency in Hertz
   131         */
   132        readonly config Float SMCLKHz;
   133    
   134        /*!
   135         *  ======== computeDCOCLKHz ========
   136         *  Initialize to the nearest available DCO clock frequency
   137         */
   138        void computeDCOCLKHz(Float DCOCLKHz);
   139    }