xref: /btstack/port/msp432p401lp-cc256x/ti/devices/msp432p4xx/driverlib/sysctl_a.h (revision 5fd0122a3e19d95e11e1f3eb8a08a2b2acb2557e)
1*5fd0122aSMatthias Ringwald /* --COPYRIGHT--,BSD
2*5fd0122aSMatthias Ringwald  * Copyright (c) 2017, Texas Instruments Incorporated
3*5fd0122aSMatthias Ringwald  * All rights reserved.
4*5fd0122aSMatthias Ringwald  *
5*5fd0122aSMatthias Ringwald  * Redistribution and use in source and binary forms, with or without
6*5fd0122aSMatthias Ringwald  * modification, are permitted provided that the following conditions
7*5fd0122aSMatthias Ringwald  * are met:
8*5fd0122aSMatthias Ringwald  *
9*5fd0122aSMatthias Ringwald  * *  Redistributions of source code must retain the above copyright
10*5fd0122aSMatthias Ringwald  *    notice, this list of conditions and the following disclaimer.
11*5fd0122aSMatthias Ringwald  *
12*5fd0122aSMatthias Ringwald  * *  Redistributions in binary form must reproduce the above copyright
13*5fd0122aSMatthias Ringwald  *    notice, this list of conditions and the following disclaimer in the
14*5fd0122aSMatthias Ringwald  *    documentation and/or other materials provided with the distribution.
15*5fd0122aSMatthias Ringwald  *
16*5fd0122aSMatthias Ringwald  * *  Neither the name of Texas Instruments Incorporated nor the names of
17*5fd0122aSMatthias Ringwald  *    its contributors may be used to endorse or promote products derived
18*5fd0122aSMatthias Ringwald  *    from this software without specific prior written permission.
19*5fd0122aSMatthias Ringwald  *
20*5fd0122aSMatthias Ringwald  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21*5fd0122aSMatthias Ringwald  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22*5fd0122aSMatthias Ringwald  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23*5fd0122aSMatthias Ringwald  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24*5fd0122aSMatthias Ringwald  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25*5fd0122aSMatthias Ringwald  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26*5fd0122aSMatthias Ringwald  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27*5fd0122aSMatthias Ringwald  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28*5fd0122aSMatthias Ringwald  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29*5fd0122aSMatthias Ringwald  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30*5fd0122aSMatthias Ringwald  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31*5fd0122aSMatthias Ringwald  * --/COPYRIGHT--*/
32*5fd0122aSMatthias Ringwald #ifndef __SYSCTL_A_H__
33*5fd0122aSMatthias Ringwald #define __SYSCTL_A_H__
34*5fd0122aSMatthias Ringwald 
35*5fd0122aSMatthias Ringwald #include <stdint.h>
36*5fd0122aSMatthias Ringwald #include <stdbool.h>
37*5fd0122aSMatthias Ringwald #include <ti/devices/msp432p4xx/inc/msp.h>
38*5fd0122aSMatthias Ringwald 
39*5fd0122aSMatthias Ringwald /* Define to ensure that our current MSP432 has the SYSCTL_A module. This
40*5fd0122aSMatthias Ringwald     definition is included in the device specific header file */
41*5fd0122aSMatthias Ringwald #ifdef __MCU_HAS_SYSCTL_A__
42*5fd0122aSMatthias Ringwald 
43*5fd0122aSMatthias Ringwald //*****************************************************************************
44*5fd0122aSMatthias Ringwald //
45*5fd0122aSMatthias Ringwald //! \addtogroup sysctl_a_api
46*5fd0122aSMatthias Ringwald //! @{
47*5fd0122aSMatthias Ringwald //
48*5fd0122aSMatthias Ringwald //*****************************************************************************
49*5fd0122aSMatthias Ringwald 
50*5fd0122aSMatthias Ringwald //*****************************************************************************
51*5fd0122aSMatthias Ringwald //
52*5fd0122aSMatthias Ringwald // If building with a C++ compiler, make all of the definitions in this header
53*5fd0122aSMatthias Ringwald // have a C binding.
54*5fd0122aSMatthias Ringwald //
55*5fd0122aSMatthias Ringwald //*****************************************************************************
56*5fd0122aSMatthias Ringwald #ifdef __cplusplus
57*5fd0122aSMatthias Ringwald extern "C"
58*5fd0122aSMatthias Ringwald {
59*5fd0122aSMatthias Ringwald #endif
60*5fd0122aSMatthias Ringwald 
61*5fd0122aSMatthias Ringwald //*****************************************************************************
62*5fd0122aSMatthias Ringwald //
63*5fd0122aSMatthias Ringwald // Control specific variables
64*5fd0122aSMatthias Ringwald //
65*5fd0122aSMatthias Ringwald //*****************************************************************************
66*5fd0122aSMatthias Ringwald #define SYSCTL_A_HARD_RESET 1
67*5fd0122aSMatthias Ringwald #define SYSCTL_A_SOFT_RESET 0
68*5fd0122aSMatthias Ringwald 
69*5fd0122aSMatthias Ringwald #define SYSCTL_A_PERIPH_LCD SYSCTL_A_PERIHALT_CTL_HALT_LCD
70*5fd0122aSMatthias Ringwald #define SYSCTL_A_PERIPH_DMA SYSCTL_A_PERIHALT_CTL_HALT_DMA
71*5fd0122aSMatthias Ringwald #define SYSCTL_A_PERIPH_WDT SYSCTL_A_PERIHALT_CTL_HALT_WDT
72*5fd0122aSMatthias Ringwald #define SYSCTL_A_PERIPH_ADC SYSCTL_A_PERIHALT_CTL_HALT_ADC
73*5fd0122aSMatthias Ringwald #define SYSCTL_A_PERIPH_EUSCIB3 SYSCTL_A_PERIHALT_CTL_HALT_EUB3
74*5fd0122aSMatthias Ringwald #define SYSCTL_A_PERIPH_EUSCIB2 SYSCTL_A_PERIHALT_CTL_HALT_EUB2
75*5fd0122aSMatthias Ringwald #define SYSCTL_A_PERIPH_EUSCIB1 SYSCTL_A_PERIHALT_CTL_HALT_EUB1
76*5fd0122aSMatthias Ringwald #define SYSCTL_A_PERIPH_EUSCIB0 SYSCTL_A_PERIHALT_CTL_HALT_EUB0
77*5fd0122aSMatthias Ringwald #define SYSCTL_A_PERIPH_EUSCIA3 SYSCTL_A_PERIHALT_CTL_HALT_EUA3
78*5fd0122aSMatthias Ringwald #define SYSCTL_A_PERIPH_EUSCIA2 SYSCTL_A_PERIHALT_CTL_HALT_EUA2
79*5fd0122aSMatthias Ringwald #define SYSCTL_A_PERIPH_EUSCIA1 SYSCTL_A_PERIHALT_CTL_HALT_EUA1
80*5fd0122aSMatthias Ringwald #define SYSCTL_A_PERIPH_EUSCIA0 SYSCTL_A_PERIHALT_CTL_HALT_EUA0
81*5fd0122aSMatthias Ringwald #define SYSCTL_A_PERIPH_TIMER32_0_MODULE SYSCTL_A_PERIHALT_CTL_HALT_T32_0
82*5fd0122aSMatthias Ringwald #define SYSCTL_A_PERIPH_TIMER16_3 SYSCTL_A_PERIHALT_CTL_HALT_T16_3
83*5fd0122aSMatthias Ringwald #define SYSCTL_A_PERIPH_TIMER16_2 SYSCTL_A_PERIHALT_CTL_HALT_T16_2
84*5fd0122aSMatthias Ringwald #define SYSCTL_A_PERIPH_TIMER16_1 SYSCTL_A_PERIHALT_CTL_HALT_T16_1
85*5fd0122aSMatthias Ringwald #define SYSCTL_A_PERIPH_TIMER16_0 SYSCTL_A_PERIHALT_CTL_HALT_T16_0
86*5fd0122aSMatthias Ringwald 
87*5fd0122aSMatthias Ringwald #define SYSCTL_A_NMIPIN_SRC SYSCTL_A_NMI_CTLSTAT_PIN_SRC
88*5fd0122aSMatthias Ringwald #define SYSCTL_A_PCM_SRC SYSCTL_A_NMI_CTLSTAT_PCM_SRC
89*5fd0122aSMatthias Ringwald #define SYSCTL_A_PSS_SRC SYSCTL_A_NMI_CTLSTAT_PSS_SRC
90*5fd0122aSMatthias Ringwald #define SYSCTL_A_CS_SRC SYSCTL_A_NMI_CTLSTAT_CS_SRC
91*5fd0122aSMatthias Ringwald 
92*5fd0122aSMatthias Ringwald #define SYSCTL_A_REBOOT_KEY   0x6900
93*5fd0122aSMatthias Ringwald 
94*5fd0122aSMatthias Ringwald #define SYSCTL_A_1_2V_REF        (uint32_t)&TLV->ADC14_REF1P2V_TS30C - (uint32_t)TLV_BASE
95*5fd0122aSMatthias Ringwald #define SYSCTL_A_1_45V_REF       (uint32_t)&TLV->ADC14_REF1P45V_TS30C - (uint32_t)TLV_BASE
96*5fd0122aSMatthias Ringwald #define SYSCTL_A_2_5V_REF        (uint32_t)&TLV->ADC14_REF2P5V_TS30C - (uint32_t)TLV_BASE
97*5fd0122aSMatthias Ringwald 
98*5fd0122aSMatthias Ringwald #define SYSCTL_A_85_DEGREES_C    4
99*5fd0122aSMatthias Ringwald #define SYSCTL_A_30_DEGREES_C    0
100*5fd0122aSMatthias Ringwald 
101*5fd0122aSMatthias Ringwald #define SYSCTL_A_BANKMASK       0x80000000
102*5fd0122aSMatthias Ringwald #define SRAMCTL_CTL0_BANK       0x10000000
103*5fd0122aSMatthias Ringwald #define SRAMCTL_CTL1_BANK       0x20000000
104*5fd0122aSMatthias Ringwald #define SRAMCTL_CTL2_BANK       0x30000000
105*5fd0122aSMatthias Ringwald #define SRAMCTL_CTL3_BANK       0x40000000
106*5fd0122aSMatthias Ringwald 
107*5fd0122aSMatthias Ringwald 
108*5fd0122aSMatthias Ringwald #define TLV_START               0x00201004
109*5fd0122aSMatthias Ringwald #define TLV_TAG_RESERVED1      1
110*5fd0122aSMatthias Ringwald #define TLV_TAG_RESERVED2      2
111*5fd0122aSMatthias Ringwald #define TLV_TAG_CS             3
112*5fd0122aSMatthias Ringwald #define TLV_TAG_FLASHCTL       4
113*5fd0122aSMatthias Ringwald #define TLV_TAG_ADC14          5
114*5fd0122aSMatthias Ringwald #define TLV_TAG_RESERVED6      6
115*5fd0122aSMatthias Ringwald #define TLV_TAG_RESERVED7      7
116*5fd0122aSMatthias Ringwald #define TLV_TAG_REF            8
117*5fd0122aSMatthias Ringwald #define TLV_TAG_RESERVED9      9
118*5fd0122aSMatthias Ringwald #define TLV_TAG_RESERVED10     10
119*5fd0122aSMatthias Ringwald #define TLV_TAG_DEVINFO        11
120*5fd0122aSMatthias Ringwald #define TLV_TAG_DIEREC         12
121*5fd0122aSMatthias Ringwald #define TLV_TAG_RANDNUM        13
122*5fd0122aSMatthias Ringwald #define TLV_TAG_RESERVED14     14
123*5fd0122aSMatthias Ringwald #define TLV_TAG_BSL            15
124*5fd0122aSMatthias Ringwald #define TLV_TAGEND             0x0BD0E11D
125*5fd0122aSMatthias Ringwald 
126*5fd0122aSMatthias Ringwald //*****************************************************************************
127*5fd0122aSMatthias Ringwald //
128*5fd0122aSMatthias Ringwald // Structures for TLV definitions
129*5fd0122aSMatthias Ringwald //
130*5fd0122aSMatthias Ringwald //*****************************************************************************
131*5fd0122aSMatthias Ringwald typedef struct
132*5fd0122aSMatthias Ringwald {
133*5fd0122aSMatthias Ringwald     uint32_t    maxProgramPulses;
134*5fd0122aSMatthias Ringwald     uint32_t    maxErasePulses;
135*5fd0122aSMatthias Ringwald } SysCtl_A_FlashTLV_Info;
136*5fd0122aSMatthias Ringwald 
137*5fd0122aSMatthias Ringwald typedef struct
138*5fd0122aSMatthias Ringwald {
139*5fd0122aSMatthias Ringwald     uint32_t rDCOIR_FCAL_RSEL04;
140*5fd0122aSMatthias Ringwald     uint32_t rDCOIR_FCAL_RSEL5;
141*5fd0122aSMatthias Ringwald     uint32_t rDCOIR_MAXPOSTUNE_RSEL04;
142*5fd0122aSMatthias Ringwald     uint32_t rDCOIR_MAXNEGTUNE_RSEL04;
143*5fd0122aSMatthias Ringwald     uint32_t rDCOIR_MAXPOSTUNE_RSEL5;
144*5fd0122aSMatthias Ringwald     uint32_t rDCOIR_MAXNEGTUNE_RSEL5;
145*5fd0122aSMatthias Ringwald     uint32_t rDCOIR_CONSTK_RSEL04;
146*5fd0122aSMatthias Ringwald     uint32_t rDCOIR_CONSTK_RSEL5;
147*5fd0122aSMatthias Ringwald     uint32_t rDCOER_FCAL_RSEL04;
148*5fd0122aSMatthias Ringwald     uint32_t rDCOER_FCAL_RSEL5;
149*5fd0122aSMatthias Ringwald     uint32_t rDCOER_MAXPOSTUNE_RSEL04;
150*5fd0122aSMatthias Ringwald     uint32_t rDCOER_MAXNEGTUNE_RSEL04;
151*5fd0122aSMatthias Ringwald     uint32_t rDCOER_MAXPOSTUNE_RSEL5;
152*5fd0122aSMatthias Ringwald     uint32_t rDCOER_MAXNEGTUNE_RSEL5;
153*5fd0122aSMatthias Ringwald     uint32_t rDCOER_CONSTK_RSEL04;
154*5fd0122aSMatthias Ringwald     uint32_t rDCOER_CONSTK_RSEL5;
155*5fd0122aSMatthias Ringwald 
156*5fd0122aSMatthias Ringwald } SysCtl_A_CSCalTLV_Info;
157*5fd0122aSMatthias Ringwald 
158*5fd0122aSMatthias Ringwald //*****************************************************************************
159*5fd0122aSMatthias Ringwald //
160*5fd0122aSMatthias Ringwald // Prototypes for the APIs.
161*5fd0122aSMatthias Ringwald //
162*5fd0122aSMatthias Ringwald //*****************************************************************************
163*5fd0122aSMatthias Ringwald 
164*5fd0122aSMatthias Ringwald //*****************************************************************************
165*5fd0122aSMatthias Ringwald //
166*5fd0122aSMatthias Ringwald //! Gets the size of the SRAM.
167*5fd0122aSMatthias Ringwald //!
168*5fd0122aSMatthias Ringwald //! \return The total number of bytes of SRAM.
169*5fd0122aSMatthias Ringwald //
170*5fd0122aSMatthias Ringwald //*****************************************************************************
171*5fd0122aSMatthias Ringwald extern uint_least32_t SysCtl_A_getSRAMSize(void);
172*5fd0122aSMatthias Ringwald 
173*5fd0122aSMatthias Ringwald //*****************************************************************************
174*5fd0122aSMatthias Ringwald //
175*5fd0122aSMatthias Ringwald //! Gets the size of the flash.
176*5fd0122aSMatthias Ringwald //!
177*5fd0122aSMatthias Ringwald //! \return The total number of bytes of main flash memory.
178*5fd0122aSMatthias Ringwald //!
179*5fd0122aSMatthias Ringwald //! \note This returns the total amount of main memory flash. To find how much
180*5fd0122aSMatthias Ringwald //!        INFO memory is available, use the \link SysCtl_A_getInfoFlashSize
181*5fd0122aSMatthias Ringwald //!         \endlink function.
182*5fd0122aSMatthias Ringwald //
183*5fd0122aSMatthias Ringwald //*****************************************************************************
184*5fd0122aSMatthias Ringwald extern uint_least32_t SysCtl_A_getFlashSize(void);
185*5fd0122aSMatthias Ringwald 
186*5fd0122aSMatthias Ringwald //*****************************************************************************
187*5fd0122aSMatthias Ringwald //
188*5fd0122aSMatthias Ringwald //! Gets the size of the flash.
189*5fd0122aSMatthias Ringwald //!
190*5fd0122aSMatthias Ringwald //! \return The total number of bytes of flash of INFO flash memory.
191*5fd0122aSMatthias Ringwald //!
192*5fd0122aSMatthias Ringwald //! \note This returns the total amount of INFO memory flash. To find how much
193*5fd0122aSMatthias Ringwald //!        main  memory is available, use the \link SysCtl_A_getFlashSize
194*5fd0122aSMatthias Ringwald //!         \endlink function.
195*5fd0122aSMatthias Ringwald //
196*5fd0122aSMatthias Ringwald //*****************************************************************************
197*5fd0122aSMatthias Ringwald extern uint_least32_t SysCtl_A_getInfoFlashSize(void);
198*5fd0122aSMatthias Ringwald 
199*5fd0122aSMatthias Ringwald //*****************************************************************************
200*5fd0122aSMatthias Ringwald //
201*5fd0122aSMatthias Ringwald //! Reboots the device and causes the device to re-initialize itself.
202*5fd0122aSMatthias Ringwald //!
203*5fd0122aSMatthias Ringwald //! \return This function does not return.
204*5fd0122aSMatthias Ringwald //
205*5fd0122aSMatthias Ringwald //*****************************************************************************
206*5fd0122aSMatthias Ringwald extern void SysCtl_A_rebootDevice(void);
207*5fd0122aSMatthias Ringwald 
208*5fd0122aSMatthias Ringwald //*****************************************************************************
209*5fd0122aSMatthias Ringwald //
210*5fd0122aSMatthias Ringwald //! The TLV structure uses a tag or base address to identify segments of the
211*5fd0122aSMatthias Ringwald //! table where information is stored. Some examples of TLV tags are Peripheral
212*5fd0122aSMatthias Ringwald //! Descriptor, Interrupts, Info Block and Die Record. This function retrieves
213*5fd0122aSMatthias Ringwald //! the value of a tag and the length of the tag.
214*5fd0122aSMatthias Ringwald //!
215*5fd0122aSMatthias Ringwald //! \param tag represents the tag for which the information needs to be
216*5fd0122aSMatthias Ringwald //!        retrieved.
217*5fd0122aSMatthias Ringwald //!        Valid values are:
218*5fd0122aSMatthias Ringwald //!        - \b TLV_TAG_RESERVED1
219*5fd0122aSMatthias Ringwald //!        - \b TLV_TAG_RESERVED2
220*5fd0122aSMatthias Ringwald //!        - \b TLV_TAG_CS
221*5fd0122aSMatthias Ringwald //!        - \b TLV_TAG_FLASHCTL
222*5fd0122aSMatthias Ringwald //!        - \b TLV_TAG_ADC14
223*5fd0122aSMatthias Ringwald //!        - \b TLV_TAG_RESERVED6
224*5fd0122aSMatthias Ringwald //!        - \b TLV_TAG_RESERVED7
225*5fd0122aSMatthias Ringwald //!        - \b TLV_TAG_REF
226*5fd0122aSMatthias Ringwald //!        - \b TLV_TAG_RESERVED9
227*5fd0122aSMatthias Ringwald //!        - \b TLV_TAG_RESERVED10
228*5fd0122aSMatthias Ringwald //!        - \b TLV_TAG_DEVINFO
229*5fd0122aSMatthias Ringwald //!        - \b TLV_TAG_DIEREC
230*5fd0122aSMatthias Ringwald //!        - \b TLV_TAG_RANDNUM
231*5fd0122aSMatthias Ringwald //!        - \b TLV_TAG_RESERVED14
232*5fd0122aSMatthias Ringwald //! \param instance In some cases a specific tag may have more than one
233*5fd0122aSMatthias Ringwald //!        instance. For example there may be multiple instances of timer
234*5fd0122aSMatthias Ringwald //!        calibration data present under a single Timer Cal tag. This variable
235*5fd0122aSMatthias Ringwald //!        specifies the instance for which information is to be retrieved (0,
236*5fd0122aSMatthias Ringwald //!        1, etc.). When only one instance exists; 0 is passed.
237*5fd0122aSMatthias Ringwald //! \param length Acts as a return through indirect reference. The function
238*5fd0122aSMatthias Ringwald //!        retrieves the value of the TLV tag length. This value is pointed to
239*5fd0122aSMatthias Ringwald //!        by *length and can be used by the application level once the
240*5fd0122aSMatthias Ringwald //!        function is called. If the specified tag is not found then the
241*5fd0122aSMatthias Ringwald //!        pointer is null 0.
242*5fd0122aSMatthias Ringwald //! \param data_address acts as a return through indirect reference. Once the
243*5fd0122aSMatthias Ringwald //!        function is called data_address points to the pointer that holds the
244*5fd0122aSMatthias Ringwald //!        value retrieved from the specified TLV tag. If the specified tag is
245*5fd0122aSMatthias Ringwald //!        not found then the pointer is null 0.
246*5fd0122aSMatthias Ringwald //!
247*5fd0122aSMatthias Ringwald //! \return None
248*5fd0122aSMatthias Ringwald //
249*5fd0122aSMatthias Ringwald //*****************************************************************************
250*5fd0122aSMatthias Ringwald extern void SysCtl_A_getTLVInfo(uint_fast8_t tag, uint_fast8_t instance,
251*5fd0122aSMatthias Ringwald         uint_fast8_t *length, uint32_t **data_address);
252*5fd0122aSMatthias Ringwald 
253*5fd0122aSMatthias Ringwald //*****************************************************************************
254*5fd0122aSMatthias Ringwald //
255*5fd0122aSMatthias Ringwald //! Enables areas of SRAM memory. This can be used to optimize power
256*5fd0122aSMatthias Ringwald //! consumption when every SRAM bank isn't needed.
257*5fd0122aSMatthias Ringwald //! This function takes in a 32-bit address to the area in SRAM to to enable.
258*5fd0122aSMatthias Ringwald //! It will convert this address into the corresponding register settings and
259*5fd0122aSMatthias Ringwald //! set them in the register accordingly. Note that passing an address to an
260*5fd0122aSMatthias Ringwald //! area other than SRAM will result in unreliable behavior. Addresses should
261*5fd0122aSMatthias Ringwald //! be given with reference to the SRAM_DATA area of SRAM (usually starting at
262*5fd0122aSMatthias Ringwald //! 0x20000000).
263*5fd0122aSMatthias Ringwald //!
264*5fd0122aSMatthias Ringwald //! \param addr Break address of SRAM to enable. All SRAM below this address
265*5fd0122aSMatthias Ringwald //!     will also be enabled. If an unaligned address is given the appropriate
266*5fd0122aSMatthias Ringwald //!     aligned address will be calculated.
267*5fd0122aSMatthias Ringwald //!
268*5fd0122aSMatthias Ringwald //! \note The first bank of SRAM is reserved and always enabled.
269*5fd0122aSMatthias Ringwald //!
270*5fd0122aSMatthias Ringwald //! \return true if banks were set, false otherwise. If the BNKEN_RDY bit is
271*5fd0122aSMatthias Ringwald //!               not set in the STAT register, this function will return false.
272*5fd0122aSMatthias Ringwald //
273*5fd0122aSMatthias Ringwald //*****************************************************************************
274*5fd0122aSMatthias Ringwald extern bool SysCtl_A_enableSRAM(uint32_t addr);
275*5fd0122aSMatthias Ringwald 
276*5fd0122aSMatthias Ringwald //*****************************************************************************
277*5fd0122aSMatthias Ringwald //
278*5fd0122aSMatthias Ringwald //! Disables areas of SRAM memory. This can be used to optimize power
279*5fd0122aSMatthias Ringwald //! consumption when every SRAM bank isn't needed. It is important to note
280*5fd0122aSMatthias Ringwald //! that when a  higher bank is disabled, all of the SRAM banks above that bank
281*5fd0122aSMatthias Ringwald //! are also disabled. For example, if the address of 0x2001FA0 is given, all
282*5fd0122aSMatthias Ringwald //! SRAM banks from 0x2001FA0 to the top of SRAM will be disabled.
283*5fd0122aSMatthias Ringwald //! This function takes in a 32-bit address to the area in SRAM to to disable.
284*5fd0122aSMatthias Ringwald //! It will convert this address into the corresponding register settings and
285*5fd0122aSMatthias Ringwald //! set them in the register accordingly. Note that passing an address to an
286*5fd0122aSMatthias Ringwald //! area other than SRAM will result in unreliable behavior. Addresses should
287*5fd0122aSMatthias Ringwald //! be given with reference to the SRAM_DATA area of SRAM (usually starting at
288*5fd0122aSMatthias Ringwald //! 0x20000000).
289*5fd0122aSMatthias Ringwald //!
290*5fd0122aSMatthias Ringwald //! \param addr Break address of SRAM to disable. All SRAM above this address
291*5fd0122aSMatthias Ringwald //!     will also be disabled. If an unaligned address is given the appropriate
292*5fd0122aSMatthias Ringwald //!     aligned address will be calculated.
293*5fd0122aSMatthias Ringwald //!
294*5fd0122aSMatthias Ringwald //! \note The first bank of SRAM is reserved and always enabled.
295*5fd0122aSMatthias Ringwald //!
296*5fd0122aSMatthias Ringwald //! \return true if banks were set, false otherwise. If the BNKEN_RDY bit is
297*5fd0122aSMatthias Ringwald //!               not set in the STAT register, this function will return false.
298*5fd0122aSMatthias Ringwald //
299*5fd0122aSMatthias Ringwald //*****************************************************************************
300*5fd0122aSMatthias Ringwald extern bool SysCtl_A_disableSRAM(uint32_t addr);
301*5fd0122aSMatthias Ringwald 
302*5fd0122aSMatthias Ringwald //*****************************************************************************
303*5fd0122aSMatthias Ringwald //
304*5fd0122aSMatthias Ringwald //! Enables retention of the specified SRAM block address range when the device
305*5fd0122aSMatthias Ringwald //! goes into LPM3 mode. When the system is placed in LPM3 mode, the SRAM
306*5fd0122aSMatthias Ringwald //! banks specified with this function will be placed into retention mode.
307*5fd0122aSMatthias Ringwald //! Retention of individual blocks can be set without the restrictions of the
308*5fd0122aSMatthias Ringwald //! enable/disable functions. Note that any memory range given outside of SRAM
309*5fd0122aSMatthias Ringwald //! will result in unreliable behavior. Also note that any unaligned addresses
310*5fd0122aSMatthias Ringwald //! will be truncated to the closest aligned address before the address given.
311*5fd0122aSMatthias Ringwald //! Addresses should be given with reference to the SRAM_DATA area of SRAM
312*5fd0122aSMatthias Ringwald //! (usually starting at 0x20000000).
313*5fd0122aSMatthias Ringwald //!
314*5fd0122aSMatthias Ringwald //! \param startAddr Start address to enable retention
315*5fd0122aSMatthias Ringwald //!
316*5fd0122aSMatthias Ringwald //! \param endtAddr End address to enable retention
317*5fd0122aSMatthias Ringwald //!
318*5fd0122aSMatthias Ringwald //! \note  Block 0 is reserved and retention is always enabled.
319*5fd0122aSMatthias Ringwald //!
320*5fd0122aSMatthias Ringwald //! \return true if banks were set, false otherwise. If the BLKEN_RDY bit is
321*5fd0122aSMatthias Ringwald //!               not set in the STAT register, this function will return false.
322*5fd0122aSMatthias Ringwald //
323*5fd0122aSMatthias Ringwald //*****************************************************************************
324*5fd0122aSMatthias Ringwald extern bool SysCtl_A_enableSRAMRetention(uint32_t startAddr,
325*5fd0122aSMatthias Ringwald         uint32_t endAddr);
326*5fd0122aSMatthias Ringwald 
327*5fd0122aSMatthias Ringwald //*****************************************************************************
328*5fd0122aSMatthias Ringwald //
329*5fd0122aSMatthias Ringwald //! Disables retention of the specified SRAM block address range when the device
330*5fd0122aSMatthias Ringwald //! goes into LPM3 mode. When the system is placed in LPM3 mode, the SRAM
331*5fd0122aSMatthias Ringwald //! banks specified with this function will be placed into retention mode.
332*5fd0122aSMatthias Ringwald //! Retention of individual blocks can be set without the restrictions of the
333*5fd0122aSMatthias Ringwald //! enable/disable functions. Note that any memory range given outside of SRAM
334*5fd0122aSMatthias Ringwald //! will result in unreliable behavior. Also note that any unaligned addresses
335*5fd0122aSMatthias Ringwald //! will be truncated to the closest aligned address before the address given.
336*5fd0122aSMatthias Ringwald //! Addresses should be given with reference to the SRAM_DATA area of SRAM
337*5fd0122aSMatthias Ringwald //! (usually starting at 0x20000000).
338*5fd0122aSMatthias Ringwald //!
339*5fd0122aSMatthias Ringwald //! \param startAddr Start address to disable retention
340*5fd0122aSMatthias Ringwald //!
341*5fd0122aSMatthias Ringwald //! \param endtAddr End address to disable retention
342*5fd0122aSMatthias Ringwald //!
343*5fd0122aSMatthias Ringwald //! \note  Block 0 is reserved and retention is always enabled.
344*5fd0122aSMatthias Ringwald //!
345*5fd0122aSMatthias Ringwald //! \return true if banks were set, false otherwise. If the BLKEN_RDY bit is
346*5fd0122aSMatthias Ringwald //!               not set in the STAT register, this function will return false.
347*5fd0122aSMatthias Ringwald //
348*5fd0122aSMatthias Ringwald //*****************************************************************************
349*5fd0122aSMatthias Ringwald extern bool SysCtl_A_disableSRAMRetention(uint32_t startAddr,
350*5fd0122aSMatthias Ringwald         uint32_t endAddr);
351*5fd0122aSMatthias Ringwald 
352*5fd0122aSMatthias Ringwald //*****************************************************************************
353*5fd0122aSMatthias Ringwald //
354*5fd0122aSMatthias Ringwald //! Makes it so that the provided peripherals will either halt execution after
355*5fd0122aSMatthias Ringwald //! a CPU HALT. Parameters in this function can be combined to account for
356*5fd0122aSMatthias Ringwald //! multiple peripherals. By default, all peripherals keep running after a
357*5fd0122aSMatthias Ringwald //! CPU HALT.
358*5fd0122aSMatthias Ringwald //!
359*5fd0122aSMatthias Ringwald //! \param devices The peripherals to continue running after a CPU HALT
360*5fd0122aSMatthias Ringwald //!         This can be a bitwise OR of the following values:
361*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_LCD,
362*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_DMA,
363*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_WDT,
364*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_ADC,
365*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_EUSCIB3,
366*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_EUSCIB2,
367*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_EUSCIB1
368*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_EUSCIB0,
369*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_EUSCIA3,
370*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_EUSCIA2
371*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_EUSCIA1,
372*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_EUSCIA0,
373*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_TIMER32_0_MODULE,
374*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_TIMER16_3,
375*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_TIMER16_2,
376*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_TIMER16_1,
377*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_TIMER16_0
378*5fd0122aSMatthias Ringwald //!
379*5fd0122aSMatthias Ringwald //! \return None.
380*5fd0122aSMatthias Ringwald //
381*5fd0122aSMatthias Ringwald //
382*5fd0122aSMatthias Ringwald //*****************************************************************************
383*5fd0122aSMatthias Ringwald extern void SysCtl_A_enablePeripheralAtCPUHalt(uint_fast16_t devices);
384*5fd0122aSMatthias Ringwald 
385*5fd0122aSMatthias Ringwald //*****************************************************************************
386*5fd0122aSMatthias Ringwald //
387*5fd0122aSMatthias Ringwald //! Makes it so that the provided peripherals will either halt execution after
388*5fd0122aSMatthias Ringwald //! a CPU HALT. Parameters in this function can be combined to account for
389*5fd0122aSMatthias Ringwald //! multiple peripherals. By default, all peripherals keep running after a
390*5fd0122aSMatthias Ringwald //! CPU HALT.
391*5fd0122aSMatthias Ringwald //!
392*5fd0122aSMatthias Ringwald //! \param devices The peripherals to disable after a CPU HALT
393*5fd0122aSMatthias Ringwald //!
394*5fd0122aSMatthias Ringwald //! The \e devices parameter can be a bitwise OR of the following values:
395*5fd0122aSMatthias Ringwald //!         This can be a bitwise OR of the following values:
396*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_LCD,
397*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_DMA,
398*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_WDT,
399*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_ADC,
400*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_EUSCIB3,
401*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_EUSCIB2,
402*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_EUSCIB1
403*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_EUSCIB0,
404*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_EUSCIA3,
405*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_EUSCIA2
406*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_EUSCIA1,
407*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_EUSCIA0,
408*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_TIMER32_0_MODULE,
409*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_TIMER16_3,
410*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_TIMER16_2,
411*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_TIMER16_1,
412*5fd0122aSMatthias Ringwald //!                 - \b SYSCTL_A_PERIPH_TIMER16_0
413*5fd0122aSMatthias Ringwald //!
414*5fd0122aSMatthias Ringwald //! \return None.
415*5fd0122aSMatthias Ringwald //
416*5fd0122aSMatthias Ringwald //
417*5fd0122aSMatthias Ringwald //*****************************************************************************
418*5fd0122aSMatthias Ringwald extern void SysCtl_A_disablePeripheralAtCPUHalt(uint_fast16_t devices);
419*5fd0122aSMatthias Ringwald 
420*5fd0122aSMatthias Ringwald //*****************************************************************************
421*5fd0122aSMatthias Ringwald //
422*5fd0122aSMatthias Ringwald //! Sets the type of RESET that happens when a watchdog timeout occurs.
423*5fd0122aSMatthias Ringwald //!
424*5fd0122aSMatthias Ringwald //! \param resetType The type of reset to set
425*5fd0122aSMatthias Ringwald //!
426*5fd0122aSMatthias Ringwald //! The \e resetType parameter must be only one of the following values:
427*5fd0122aSMatthias Ringwald //!         - \b SYSCTL_A_HARD_RESET,
428*5fd0122aSMatthias Ringwald //!         - \b SYSCTL_A_SOFT_RESET
429*5fd0122aSMatthias Ringwald //!
430*5fd0122aSMatthias Ringwald //! \return None.
431*5fd0122aSMatthias Ringwald //
432*5fd0122aSMatthias Ringwald //
433*5fd0122aSMatthias Ringwald //*****************************************************************************
434*5fd0122aSMatthias Ringwald extern void SysCtl_A_setWDTTimeoutResetType(uint_fast8_t resetType);
435*5fd0122aSMatthias Ringwald 
436*5fd0122aSMatthias Ringwald //*****************************************************************************
437*5fd0122aSMatthias Ringwald //
438*5fd0122aSMatthias Ringwald //! Sets the type of RESET that happens when a watchdog password violation
439*5fd0122aSMatthias Ringwald //! occurs.
440*5fd0122aSMatthias Ringwald //!
441*5fd0122aSMatthias Ringwald //! \param resetType The type of reset to set
442*5fd0122aSMatthias Ringwald //!
443*5fd0122aSMatthias Ringwald //! The \e resetType parameter must be only one of the following values:
444*5fd0122aSMatthias Ringwald //!         - \b SYSCTL_A_HARD_RESET,
445*5fd0122aSMatthias Ringwald //!         - \b SYSCTL_A_SOFT_RESET
446*5fd0122aSMatthias Ringwald //!
447*5fd0122aSMatthias Ringwald //! \return None.
448*5fd0122aSMatthias Ringwald //
449*5fd0122aSMatthias Ringwald //
450*5fd0122aSMatthias Ringwald //*****************************************************************************
451*5fd0122aSMatthias Ringwald extern void SysCtl_A_setWDTPasswordViolationResetType(uint_fast8_t resetType);
452*5fd0122aSMatthias Ringwald 
453*5fd0122aSMatthias Ringwald //*****************************************************************************
454*5fd0122aSMatthias Ringwald //
455*5fd0122aSMatthias Ringwald //! Disables NMIs for the provided modules. When disabled, a NMI flag will not
456*5fd0122aSMatthias Ringwald //! occur when a fault condition comes from the corresponding modules.
457*5fd0122aSMatthias Ringwald //!
458*5fd0122aSMatthias Ringwald //! \param flags The NMI sources to disable
459*5fd0122aSMatthias Ringwald //! Can be a bitwise OR of the following parameters:
460*5fd0122aSMatthias Ringwald //!         - \b SYSCTL_A_NMIPIN_SRC,
461*5fd0122aSMatthias Ringwald //!         - \b SYSCTL_A_PCM_SRC,
462*5fd0122aSMatthias Ringwald //!         - \b SYSCTL_A_PSS_SRC,
463*5fd0122aSMatthias Ringwald //!         - \b SYSCTL_A_CS_SRC
464*5fd0122aSMatthias Ringwald //!
465*5fd0122aSMatthias Ringwald //
466*5fd0122aSMatthias Ringwald //*****************************************************************************
467*5fd0122aSMatthias Ringwald extern void SysCtl_A_disableNMISource(uint_fast8_t flags);
468*5fd0122aSMatthias Ringwald 
469*5fd0122aSMatthias Ringwald //*****************************************************************************
470*5fd0122aSMatthias Ringwald //
471*5fd0122aSMatthias Ringwald //! Enables NMIs for the provided modules. When enabled, a NMI flag will
472*5fd0122aSMatthias Ringwald //! occur when a fault condition comes from the corresponding modules.
473*5fd0122aSMatthias Ringwald //!
474*5fd0122aSMatthias Ringwald //! \param flags The NMI sources to enable
475*5fd0122aSMatthias Ringwald //! Can be a bitwise OR of the following parameters:
476*5fd0122aSMatthias Ringwald //!         - \b SYSCTL_A_NMIPIN_SRC,
477*5fd0122aSMatthias Ringwald //!         - \b SYSCTL_A_PCM_SRC,
478*5fd0122aSMatthias Ringwald //!         - \b SYSCTL_A_PSS_SRC,
479*5fd0122aSMatthias Ringwald //!         - \b SYSCTL_A_CS_SRC
480*5fd0122aSMatthias Ringwald //!
481*5fd0122aSMatthias Ringwald //
482*5fd0122aSMatthias Ringwald //*****************************************************************************
483*5fd0122aSMatthias Ringwald extern void SysCtl_A_enableNMISource(uint_fast8_t flags);
484*5fd0122aSMatthias Ringwald 
485*5fd0122aSMatthias Ringwald //*****************************************************************************
486*5fd0122aSMatthias Ringwald //
487*5fd0122aSMatthias Ringwald //! Returns the current sources of NMIs that are enabled
488*5fd0122aSMatthias Ringwald //!
489*5fd0122aSMatthias Ringwald //! \return NMI source status
490*5fd0122aSMatthias Ringwald //
491*5fd0122aSMatthias Ringwald //*****************************************************************************
492*5fd0122aSMatthias Ringwald extern uint_fast8_t SysCtl_A_getNMISourceStatus(void);
493*5fd0122aSMatthias Ringwald 
494*5fd0122aSMatthias Ringwald //*****************************************************************************
495*5fd0122aSMatthias Ringwald //
496*5fd0122aSMatthias Ringwald //! Enables glitch suppression on the reset pin of the device. Refer to the
497*5fd0122aSMatthias Ringwald //! device data sheet for specific information about glitch suppression
498*5fd0122aSMatthias Ringwald //!
499*5fd0122aSMatthias Ringwald //! \return None.
500*5fd0122aSMatthias Ringwald //
501*5fd0122aSMatthias Ringwald //
502*5fd0122aSMatthias Ringwald //*****************************************************************************
503*5fd0122aSMatthias Ringwald extern void SysCtl_A_enableGlitchFilter(void);
504*5fd0122aSMatthias Ringwald 
505*5fd0122aSMatthias Ringwald //*****************************************************************************
506*5fd0122aSMatthias Ringwald //
507*5fd0122aSMatthias Ringwald //! Disables glitch suppression on the reset pin of the device. Refer to the
508*5fd0122aSMatthias Ringwald //! device data sheet for specific information about glitch suppression
509*5fd0122aSMatthias Ringwald //!
510*5fd0122aSMatthias Ringwald //! \return None.
511*5fd0122aSMatthias Ringwald //
512*5fd0122aSMatthias Ringwald //
513*5fd0122aSMatthias Ringwald //*****************************************************************************
514*5fd0122aSMatthias Ringwald extern void SysCtl_A_disableGlitchFilter(void);
515*5fd0122aSMatthias Ringwald 
516*5fd0122aSMatthias Ringwald //*****************************************************************************
517*5fd0122aSMatthias Ringwald //
518*5fd0122aSMatthias Ringwald //! Retrieves the calibration constant of the temperature sensor to be used
519*5fd0122aSMatthias Ringwald //! in temperature calculation.
520*5fd0122aSMatthias Ringwald //!
521*5fd0122aSMatthias Ringwald //! \param refVoltage Reference voltage being used.
522*5fd0122aSMatthias Ringwald //!
523*5fd0122aSMatthias Ringwald //! The \e refVoltage parameter must be only one of the following values:
524*5fd0122aSMatthias Ringwald //!         - \b SYSCTL_A_1_2V_REF
525*5fd0122aSMatthias Ringwald //!         - \b SYSCTL_A_1_45V_REF
526*5fd0122aSMatthias Ringwald //!         - \b SYSCTL_A_2_5V_REF
527*5fd0122aSMatthias Ringwald //!
528*5fd0122aSMatthias Ringwald //! \param temperature is the calibration temperature that the user wants to be
529*5fd0122aSMatthias Ringwald //!     returned.
530*5fd0122aSMatthias Ringwald //!
531*5fd0122aSMatthias Ringwald //! The \e temperature parameter must be only one of the following values:
532*5fd0122aSMatthias Ringwald //!         - \b SYSCTL_A_30_DEGREES_C
533*5fd0122aSMatthias Ringwald //!         - \b SYSCTL_A_85_DEGREES_C
534*5fd0122aSMatthias Ringwald //!
535*5fd0122aSMatthias Ringwald //! \return None.
536*5fd0122aSMatthias Ringwald //
537*5fd0122aSMatthias Ringwald //
538*5fd0122aSMatthias Ringwald //*****************************************************************************
539*5fd0122aSMatthias Ringwald extern uint_fast16_t SysCtl_A_getTempCalibrationConstant(uint32_t refVoltage,
540*5fd0122aSMatthias Ringwald         uint32_t temperature);
541*5fd0122aSMatthias Ringwald 
542*5fd0122aSMatthias Ringwald //*****************************************************************************
543*5fd0122aSMatthias Ringwald //
544*5fd0122aSMatthias Ringwald // Mark the end of the C bindings section for C++ compilers.
545*5fd0122aSMatthias Ringwald //
546*5fd0122aSMatthias Ringwald //*****************************************************************************
547*5fd0122aSMatthias Ringwald #ifdef __cplusplus
548*5fd0122aSMatthias Ringwald }
549*5fd0122aSMatthias Ringwald #endif
550*5fd0122aSMatthias Ringwald 
551*5fd0122aSMatthias Ringwald //*****************************************************************************
552*5fd0122aSMatthias Ringwald //
553*5fd0122aSMatthias Ringwald // Close the Doxygen group.
554*5fd0122aSMatthias Ringwald //! @}
555*5fd0122aSMatthias Ringwald //
556*5fd0122aSMatthias Ringwald //*****************************************************************************
557*5fd0122aSMatthias Ringwald 
558*5fd0122aSMatthias Ringwald #endif /* __MCU_HAS_SYSCTL_A__ */
559*5fd0122aSMatthias Ringwald 
560*5fd0122aSMatthias Ringwald #endif // __SYSCTL_A_H__
561