1 //*****************************************************************************
2 //
3 //  am_reg_m4.h
4 //! @file
5 //!
6 //! @brief A collection of a few CMSIS-style macros that are not automatically
7 //!        generated in their respective core files.
8 //
9 //*****************************************************************************
10 
11 //*****************************************************************************
12 //
13 // Copyright (c) 2024, Ambiq Micro, Inc.
14 // All rights reserved.
15 //
16 // Redistribution and use in source and binary forms, with or without
17 // modification, are permitted provided that the following conditions are met:
18 //
19 // 1. Redistributions of source code must retain the above copyright notice,
20 // this list of conditions and the following disclaimer.
21 //
22 // 2. Redistributions in binary form must reproduce the above copyright
23 // notice, this list of conditions and the following disclaimer in the
24 // documentation and/or other materials provided with the distribution.
25 //
26 // 3. Neither the name of the copyright holder nor the names of its
27 // contributors may be used to endorse or promote products derived from this
28 // software without specific prior written permission.
29 //
30 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
31 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
34 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
35 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
36 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
37 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
38 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
39 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
40 // POSSIBILITY OF SUCH DAMAGE.
41 //
42 // This is part of revision release_sdk_3_2_0-dd5f40c14b of the AmbiqSuite Development Package.
43 //
44 //*****************************************************************************
45 
46 #ifndef AM_REG_CM4_H
47 #define AM_REG_CM4_H
48 
49 //*****************************************************************************
50 //
51 // am_reg_itm.h
52 // CMSIS-style defines.
53 //
54 //*****************************************************************************
55 #define ITM_LAR_KEYVAL      0xC5ACCE55
56 
57 //*****************************************************************************
58 //
59 // am_reg_sysctrl.h
60 // CMSIS-style defines.
61 //
62 //*****************************************************************************
63 #define SCB_CPACR_CP11_Pos                  22
64 #define SCB_CPACR_CP11_Msk                  0x00C00000
65 #define SCB_CPACR_CP10_Pos                  20
66 #define SCB_CPACR_CP10_Msk                  0x00300000
67 
68 //*****************************************************************************
69 //
70 // am_reg_tpiu.h
71 // CMSIS-style defines.
72 //
73 //*****************************************************************************
74 #define TPI_CSPSR_CWIDTH_1BIT      1
75 #define TPI_SPPR_TXMODE_UART       2
76 #define TPI_ITCTRL_Mode_NORMAL     0
77 
78 #ifndef TPI_ACPR_SWOSCALER_Pos
79 //
80 // In the CMSIS 5.6.0 version of core_cm4.h, the SWOSCALER field was no longer
81 // defined, while the PRESCALER field was left intact even though previous CMSIS
82 // versions PRESCALER as deprecated.  On the off chance that future versions
83 // make a correction and remove PRESCALER, define SWOSCALER here (per 5.3.0).
84 //
85 #define TPI_ACPR_SWOSCALER_Pos              0U                                         /*!< TPI ACPR: SWOSCALER Position */
86 #define TPI_ACPR_SWOSCALER_Msk             (0xFFFFUL /*<< TPI_ACPR_SWOSCALER_Pos*/)    /*!< TPI ACPR: SWOSCALER Mask */
87 #endif
88 
89 #endif // AM_REG_CM4_H
90