sysctl_a.h
Go to the documentation of this file.
1 /* --COPYRIGHT--,BSD
2  * Copyright (c) 2017, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  * --/COPYRIGHT--*/
32 #ifndef __SYSCTL_A_H__
33 #define __SYSCTL_A_H__
34 
35 #include <stdint.h>
36 #include <stdbool.h>
37 #include <ti/devices/msp432p4xx/inc/msp.h>
38 
39 /* Define to ensure that our current MSP432 has the SYSCTL_A module. This
40  definition is included in the device specific header file */
41 #ifdef __MCU_HAS_SYSCTL_A__
42 
43 //*****************************************************************************
44 //
47 //
48 //*****************************************************************************
49 
50 //*****************************************************************************
51 //
52 // If building with a C++ compiler, make all of the definitions in this header
53 // have a C binding.
54 //
55 //*****************************************************************************
56 #ifdef __cplusplus
57 extern "C"
58 {
59 #endif
60 
61 //*****************************************************************************
62 //
63 // Control specific variables
64 //
65 //*****************************************************************************
66 #define SYSCTL_A_HARD_RESET 1
67 #define SYSCTL_A_SOFT_RESET 0
68 
69 #define SYSCTL_A_PERIPH_LCD SYSCTL_A_PERIHALT_CTL_HALT_LCD
70 #define SYSCTL_A_PERIPH_DMA SYSCTL_A_PERIHALT_CTL_HALT_DMA
71 #define SYSCTL_A_PERIPH_WDT SYSCTL_A_PERIHALT_CTL_HALT_WDT
72 #define SYSCTL_A_PERIPH_ADC SYSCTL_A_PERIHALT_CTL_HALT_ADC
73 #define SYSCTL_A_PERIPH_EUSCIB3 SYSCTL_A_PERIHALT_CTL_HALT_EUB3
74 #define SYSCTL_A_PERIPH_EUSCIB2 SYSCTL_A_PERIHALT_CTL_HALT_EUB2
75 #define SYSCTL_A_PERIPH_EUSCIB1 SYSCTL_A_PERIHALT_CTL_HALT_EUB1
76 #define SYSCTL_A_PERIPH_EUSCIB0 SYSCTL_A_PERIHALT_CTL_HALT_EUB0
77 #define SYSCTL_A_PERIPH_EUSCIA3 SYSCTL_A_PERIHALT_CTL_HALT_EUA3
78 #define SYSCTL_A_PERIPH_EUSCIA2 SYSCTL_A_PERIHALT_CTL_HALT_EUA2
79 #define SYSCTL_A_PERIPH_EUSCIA1 SYSCTL_A_PERIHALT_CTL_HALT_EUA1
80 #define SYSCTL_A_PERIPH_EUSCIA0 SYSCTL_A_PERIHALT_CTL_HALT_EUA0
81 #define SYSCTL_A_PERIPH_TIMER32_0_MODULE SYSCTL_A_PERIHALT_CTL_HALT_T32_0
82 #define SYSCTL_A_PERIPH_TIMER16_3 SYSCTL_A_PERIHALT_CTL_HALT_T16_3
83 #define SYSCTL_A_PERIPH_TIMER16_2 SYSCTL_A_PERIHALT_CTL_HALT_T16_2
84 #define SYSCTL_A_PERIPH_TIMER16_1 SYSCTL_A_PERIHALT_CTL_HALT_T16_1
85 #define SYSCTL_A_PERIPH_TIMER16_0 SYSCTL_A_PERIHALT_CTL_HALT_T16_0
86 
87 #define SYSCTL_A_NMIPIN_SRC SYSCTL_A_NMI_CTLSTAT_PIN_SRC
88 #define SYSCTL_A_PCM_SRC SYSCTL_A_NMI_CTLSTAT_PCM_SRC
89 #define SYSCTL_A_PSS_SRC SYSCTL_A_NMI_CTLSTAT_PSS_SRC
90 #define SYSCTL_A_CS_SRC SYSCTL_A_NMI_CTLSTAT_CS_SRC
91 
92 #define SYSCTL_A_REBOOT_KEY 0x6900
93 
94 #define SYSCTL_A_1_2V_REF (uint32_t)&TLV->ADC14_REF1P2V_TS30C - (uint32_t)TLV_BASE
95 #define SYSCTL_A_1_45V_REF (uint32_t)&TLV->ADC14_REF1P45V_TS30C - (uint32_t)TLV_BASE
96 #define SYSCTL_A_2_5V_REF (uint32_t)&TLV->ADC14_REF2P5V_TS30C - (uint32_t)TLV_BASE
97 
98 #define SYSCTL_A_85_DEGREES_C 4
99 #define SYSCTL_A_30_DEGREES_C 0
100 
101 #define SYSCTL_A_BANKMASK 0x80000000
102 #define SRAMCTL_CTL0_BANK 0x10000000
103 #define SRAMCTL_CTL1_BANK 0x20000000
104 #define SRAMCTL_CTL2_BANK 0x30000000
105 #define SRAMCTL_CTL3_BANK 0x40000000
106 
107 
108 #define TLV_START 0x00201004
109 #define TLV_TAG_RESERVED1 1
110 #define TLV_TAG_RESERVED2 2
111 #define TLV_TAG_CS 3
112 #define TLV_TAG_FLASHCTL 4
113 #define TLV_TAG_ADC14 5
114 #define TLV_TAG_RESERVED6 6
115 #define TLV_TAG_RESERVED7 7
116 #define TLV_TAG_REF 8
117 #define TLV_TAG_RESERVED9 9
118 #define TLV_TAG_RESERVED10 10
119 #define TLV_TAG_DEVINFO 11
120 #define TLV_TAG_DIEREC 12
121 #define TLV_TAG_RANDNUM 13
122 #define TLV_TAG_RESERVED14 14
123 #define TLV_TAG_BSL 15
124 #define TLV_TAGEND 0x0BD0E11D
125 
126 //*****************************************************************************
127 //
128 // Structures for TLV definitions
129 //
130 //*****************************************************************************
131 typedef struct
132 {
134  uint32_t maxErasePulses;
136 
137 typedef struct
138 {
155 
157 
158 //*****************************************************************************
159 //
160 // Prototypes for the APIs.
161 //
162 //*****************************************************************************
163 
164 //*****************************************************************************
165 //
169 //
170 //*****************************************************************************
171 extern uint_least32_t SysCtl_A_getSRAMSize(void);
172 
173 //*****************************************************************************
174 //
182 //
183 //*****************************************************************************
184 extern uint_least32_t SysCtl_A_getFlashSize(void);
185 
186 //*****************************************************************************
187 //
195 //
196 //*****************************************************************************
197 extern uint_least32_t SysCtl_A_getInfoFlashSize(void);
198 
199 //*****************************************************************************
200 //
204 //
205 //*****************************************************************************
206 extern void SysCtl_A_rebootDevice(void);
207 
208 //*****************************************************************************
209 //
248 //
249 //*****************************************************************************
250 extern void SysCtl_A_getTLVInfo(uint_fast8_t tag, uint_fast8_t instance,
251  uint_fast8_t *length, uint32_t **data_address);
252 
253 //*****************************************************************************
254 //
272 //
273 //*****************************************************************************
274 extern bool SysCtl_A_enableSRAM(uint32_t addr);
275 
276 //*****************************************************************************
277 //
298 //
299 //*****************************************************************************
300 extern bool SysCtl_A_disableSRAM(uint32_t addr);
301 
302 //*****************************************************************************
303 //
322 //
323 //*****************************************************************************
324 extern bool SysCtl_A_enableSRAMRetention(uint32_t startAddr,
325  uint32_t endAddr);
326 
327 //*****************************************************************************
328 //
347 //
348 //*****************************************************************************
349 extern bool SysCtl_A_disableSRAMRetention(uint32_t startAddr,
350  uint32_t endAddr);
351 
352 //*****************************************************************************
353 //
380 //
381 //
382 //*****************************************************************************
383 extern void SysCtl_A_enablePeripheralAtCPUHalt(uint_fast16_t devices);
384 
385 //*****************************************************************************
386 //
415 //
416 //
417 //*****************************************************************************
418 extern void SysCtl_A_disablePeripheralAtCPUHalt(uint_fast16_t devices);
419 
420 //*****************************************************************************
421 //
431 //
432 //
433 //*****************************************************************************
434 extern void SysCtl_A_setWDTTimeoutResetType(uint_fast8_t resetType);
435 
436 //*****************************************************************************
437 //
448 //
449 //
450 //*****************************************************************************
451 extern void SysCtl_A_setWDTPasswordViolationResetType(uint_fast8_t resetType);
452 
453 //*****************************************************************************
454 //
465 //
466 //*****************************************************************************
467 extern void SysCtl_A_disableNMISource(uint_fast8_t flags);
468 
469 //*****************************************************************************
470 //
481 //
482 //*****************************************************************************
483 extern void SysCtl_A_enableNMISource(uint_fast8_t flags);
484 
485 //*****************************************************************************
486 //
490 //
491 //*****************************************************************************
492 extern uint_fast8_t SysCtl_A_getNMISourceStatus(void);
493 
494 //*****************************************************************************
495 //
500 //
501 //
502 //*****************************************************************************
503 extern void SysCtl_A_enableGlitchFilter(void);
504 
505 //*****************************************************************************
506 //
511 //
512 //
513 //*****************************************************************************
514 extern void SysCtl_A_disableGlitchFilter(void);
515 
516 //*****************************************************************************
517 //
536 //
537 //
538 //*****************************************************************************
539 extern uint_fast16_t SysCtl_A_getTempCalibrationConstant(uint32_t refVoltage,
540  uint32_t temperature);
541 
542 //*****************************************************************************
543 //
544 // Mark the end of the C bindings section for C++ compilers.
545 //
546 //*****************************************************************************
547 #ifdef __cplusplus
548 }
549 #endif
550 
551 //*****************************************************************************
552 //
553 // Close the Doxygen group.
555 //
556 //*****************************************************************************
557 
558 #endif /* __MCU_HAS_SYSCTL_A__ */
559 
560 #endif // __SYSCTL_A_H__
bool SysCtl_A_disableSRAM(uint32_t addr)
Definition: sysctl_a.c:203
uint32_t rDCOER_FCAL_RSEL5
Definition: sysctl_a.h:148
void SysCtl_A_disableNMISource(uint_fast8_t flags)
Definition: sysctl_a.c:108
void SysCtl_A_setWDTTimeoutResetType(uint_fast8_t resetType)
Definition: sysctl_a.c:141
uint32_t rDCOER_MAXPOSTUNE_RSEL5
Definition: sysctl_a.h:151
uint_fast16_t SysCtl_A_getTempCalibrationConstant(uint32_t refVoltage, uint32_t temperature)
Definition: sysctl_a.c:167
uint_fast8_t SysCtl_A_getNMISourceStatus(void)
Definition: sysctl_a.c:118
void SysCtl_A_disablePeripheralAtCPUHalt(uint_fast16_t devices)
Definition: sysctl_a.c:136
uint_least32_t SysCtl_A_getInfoFlashSize(void)
Definition: sysctl_a.c:103
void SysCtl_A_rebootDevice(void)
Definition: sysctl_a.c:126
uint32_t rDCOER_CONSTK_RSEL04
Definition: sysctl_a.h:153
uint32_t rDCOIR_FCAL_RSEL5
Definition: sysctl_a.h:140
bool SysCtl_A_disableSRAMRetention(uint32_t startAddr, uint32_t endAddr)
Definition: sysctl_a.c:323
uint32_t rDCOIR_CONSTK_RSEL5
Definition: sysctl_a.h:146
uint32_t rDCOIR_MAXNEGTUNE_RSEL04
Definition: sysctl_a.h:142
void SysCtl_A_disableGlitchFilter(void)
Definition: sysctl_a.c:162
Definition: sysctl_a.h:137
void SysCtl_A_getTLVInfo(uint_fast8_t tag, uint_fast8_t instance, uint_fast8_t *length, uint32_t **data_address)
Definition: sysctl_a.c:44
bool SysCtl_A_enableSRAMRetention(uint32_t startAddr, uint32_t endAddr)
Definition: sysctl_a.c:233
uint_least32_t SysCtl_A_getSRAMSize(void)
Definition: sysctl_a.c:93
uint32_t rDCOER_MAXNEGTUNE_RSEL04
Definition: sysctl_a.h:150
Definition: sysctl_a.h:131
uint32_t rDCOIR_CONSTK_RSEL04
Definition: sysctl_a.h:145
void SysCtl_A_enableGlitchFilter(void)
Definition: sysctl_a.c:157
void SysCtl_A_setWDTPasswordViolationResetType(uint_fast8_t resetType)
Definition: sysctl_a.c:149
uint32_t rDCOIR_FCAL_RSEL04
Definition: sysctl_a.h:139
uint32_t maxErasePulses
Definition: sysctl_a.h:134
uint32_t rDCOIR_MAXPOSTUNE_RSEL04
Definition: sysctl_a.h:141
uint32_t rDCOER_FCAL_RSEL04
Definition: sysctl_a.h:147
uint32_t rDCOIR_MAXNEGTUNE_RSEL5
Definition: sysctl_a.h:144
uint32_t rDCOER_MAXNEGTUNE_RSEL5
Definition: sysctl_a.h:152
void SysCtl_A_enablePeripheralAtCPUHalt(uint_fast16_t devices)
Definition: sysctl_a.c:131
uint32_t rDCOER_MAXPOSTUNE_RSEL04
Definition: sysctl_a.h:149
uint32_t rDCOER_CONSTK_RSEL5
Definition: sysctl_a.h:154
uint_least32_t SysCtl_A_getFlashSize(void)
Definition: sysctl_a.c:98
uint32_t rDCOIR_MAXPOSTUNE_RSEL5
Definition: sysctl_a.h:143
uint32_t maxProgramPulses
Definition: sysctl_a.h:133
bool SysCtl_A_enableSRAM(uint32_t addr)
Definition: sysctl_a.c:173
void SysCtl_A_enableNMISource(uint_fast8_t flags)
Definition: sysctl_a.c:113

Copyright 2018, Texas Instruments Incorporated