1 /**
2  * @file    sema_regs.h
3  * @brief   Registers, Bit Masks and Bit Positions for the SEMA Peripheral Module.
4  * @note    This file is @generated.
5  */
6 
7 /******************************************************************************
8  *
9  * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
10  * Analog Devices, Inc.),
11  * Copyright (C) 2023-2024 Analog Devices, Inc.
12  *
13  * Licensed under the Apache License, Version 2.0 (the "License");
14  * you may not use this file except in compliance with the License.
15  * You may obtain a copy of the License at
16  *
17  *     http://www.apache.org/licenses/LICENSE-2.0
18  *
19  * Unless required by applicable law or agreed to in writing, software
20  * distributed under the License is distributed on an "AS IS" BASIS,
21  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22  * See the License for the specific language governing permissions and
23  * limitations under the License.
24  *
25  ******************************************************************************/
26 
27 #ifndef LIBRARIES_CMSIS_DEVICE_MAXIM_MAX32570_INCLUDE_SEMA_REGS_H_
28 #define LIBRARIES_CMSIS_DEVICE_MAXIM_MAX32570_INCLUDE_SEMA_REGS_H_
29 
30 /* **** Includes **** */
31 #include <stdint.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 #if defined (__ICCARM__)
38   #pragma system_include
39 #endif
40 
41 #if defined (__CC_ARM)
42   #pragma anon_unions
43 #endif
44 /// @cond
45 /*
46     If types are not defined elsewhere (CMSIS) define them here
47 */
48 #ifndef __IO
49 #define __IO volatile
50 #endif
51 #ifndef __I
52 #define __I  volatile const
53 #endif
54 #ifndef __O
55 #define __O  volatile
56 #endif
57 #ifndef __R
58 #define __R  volatile const
59 #endif
60 /// @endcond
61 
62 /* **** Definitions **** */
63 
64 /**
65  * @ingroup     sema
66  * @defgroup    sema_registers SEMA_Registers
67  * @brief       Registers, Bit Masks and Bit Positions for the SEMA Peripheral Module.
68  * @details     The Semaphore peripheral allows multiple cores in a system to cooperate when accessing shred resources.
69                                      The peripheral contains eight semaphores that can be atomically set and cleared. It is left to the discretion of the software
70                                      architect to decide how and when the semaphores are used and how they are allocated. Existing hardware does not have to be
71 
72                                      modified for this type of cooperative sharing, and the use of semaphores is exclusively within the software domain.
73  */
74 
75 /**
76  * @ingroup sema_registers
77  * Structure type to access the SEMA Registers.
78  */
79 typedef struct {
80     __IO uint32_t semaphores[8];        /**< <tt>\b 0x000:</tt> SEMA SEMAPHORES Register */
81     __R  uint32_t rsv_0x20_0xff[56];
82     __IO uint32_t status;               /**< <tt>\b 0x100:</tt> SEMA STATUS Register */
83 } mxc_sema_regs_t;
84 
85 /* Register offsets for module SEMA */
86 /**
87  * @ingroup    sema_registers
88  * @defgroup   SEMA_Register_Offsets Register Offsets
89  * @brief      SEMA Peripheral Register Offsets from the SEMA Base Peripheral Address.
90  * @{
91  */
92 #define MXC_R_SEMA_SEMAPHORES              ((uint32_t)0x00000000UL) /**< Offset from SEMA Base Address: <tt> 0x0000</tt> */
93 #define MXC_R_SEMA_STATUS                  ((uint32_t)0x00000100UL) /**< Offset from SEMA Base Address: <tt> 0x0100</tt> */
94 /**@} end of group sema_registers */
95 
96 /**
97  * @ingroup  sema_registers
98  * @defgroup SEMA_SEMAPHORES SEMA_SEMAPHORES
99  * @brief    Read to test and set, returns prior value. Write 0 to clear semaphore.
100  * @{
101  */
102 #define MXC_F_SEMA_SEMAPHORES_SEMA_POS                 0 /**< SEMAPHORES_SEMA Position */
103 #define MXC_F_SEMA_SEMAPHORES_SEMA                     ((uint32_t)(0x1UL << MXC_F_SEMA_SEMAPHORES_SEMA_POS)) /**< SEMAPHORES_SEMA Mask */
104 
105 /**@} end of group SEMA_SEMAPHORES_Register */
106 
107 /**
108  * @ingroup  sema_registers
109  * @defgroup SEMA_STATUS SEMA_STATUS
110  * @brief    Semaphore status bits. 0 indicates the semaphore is free, 1 indicates taken.
111  * @{
112  */
113 #define MXC_F_SEMA_STATUS_STATUS_POS                   0 /**< STATUS_STATUS Position */
114 #define MXC_F_SEMA_STATUS_STATUS                       ((uint32_t)(0xFFUL << MXC_F_SEMA_STATUS_STATUS_POS)) /**< STATUS_STATUS Mask */
115 
116 /**@} end of group SEMA_STATUS_Register */
117 
118 #ifdef __cplusplus
119 }
120 #endif
121 
122 #endif // LIBRARIES_CMSIS_DEVICE_MAXIM_MAX32570_INCLUDE_SEMA_REGS_H_
123