xref: /btstack/port/renesas-tb-s1ja-cc256x/template/btstack_example/synergy/ssp/src/bsp/mcu/all/bsp_locking.h (revision 3b5c872a8c45689e8cc17891f01530f5aa5e911c)
1 /***********************************************************************************************************************
2  * Copyright [2015-2017] Renesas Electronics Corporation and/or its licensors. All Rights Reserved.
3  *
4  * This file is part of Renesas SynergyTM Software Package (SSP)
5  *
6  * The contents of this file (the "contents") are proprietary and confidential to Renesas Electronics Corporation
7  * and/or its licensors ("Renesas") and subject to statutory and contractual protections.
8  *
9  * This file is subject to a Renesas SSP license agreement. Unless otherwise agreed in an SSP license agreement with
10  * Renesas: 1) you may not use, copy, modify, distribute, display, or perform the contents; 2) you may not use any name
11  * or mark of Renesas for advertising or publicity purposes or in connection with your use of the contents; 3) RENESAS
12  * MAKES NO WARRANTY OR REPRESENTATIONS ABOUT THE SUITABILITY OF THE CONTENTS FOR ANY PURPOSE; THE CONTENTS ARE PROVIDED
13  * "AS IS" WITHOUT ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
14  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT; AND 4) RENESAS SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, OR
15  * CONSEQUENTIAL DAMAGES, INCLUDING DAMAGES RESULTING FROM LOSS OF USE, DATA, OR PROJECTS, WHETHER IN AN ACTION OF
16  * CONTRACT OR TORT, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE CONTENTS. Third-party contents
17  * included in this file may be subject to different terms.
18  **********************************************************************************************************************/
19 /***********************************************************************************************************************
20 * File Name    : bsp_locking.h
21 * Description  : This module implements atomic locking
22 ***********************************************************************************************************************/
23 
24 #ifndef BSP_LOCKING_H_
25 #define BSP_LOCKING_H_
26 
27 /* Common macro for SSP header files. There is also a corresponding SSP_FOOTER macro at the end of this file. */
28 SSP_HEADER
29 
30 /***********************************************************************************************************************
31 Macro definitions
32 ***********************************************************************************************************************/
33 /* Valid bsp_lock_t->lock values. */
34 #define BSP_LOCK_LOCKED             (0x01U)  ///< Lock value when lock is taken
35 #define BSP_LOCK_UNLOCKED           (0x00U)  ///< Lock value when lock is available
36 
37 /*******************************************************************************************************************//**
38  * @ingroup BSP_MCU_COMMON
39  * @defgroup BSP_MCU_LOCKING Atomic Locking
40  *
41  * This module implements atomic locking mechanisms.
42  *
43  * @{
44  **********************************************************************************************************************/
45 
46 /***********************************************************************************************************************
47 Typedef definitions
48 ***********************************************************************************************************************/
49 /** Lock structure. Passed into software locking functions such as R_BSP_SoftwareLock() and R_BSP_SoftwareUnLock. */
50 typedef struct st_bsp_lock
51 {
52     uint8_t lock; ///< A uint8_t is used instead of a enum because the size must be 8-bits.
53 } bsp_lock_t;
54 
55 /** @} (end defgroup BSP_MCU_LOCKING) */
56 
57 /***********************************************************************************************************************
58 Exported global variables
59 ***********************************************************************************************************************/
60 
61 /***********************************************************************************************************************
62 Exported global functions (to be accessed by other files)
63 ***********************************************************************************************************************/
64 void bsp_init_hardware_locks(void);
65 
66 /* Public functions defined in bsp.h */
67 
68 /* Common macro for SSP header files. There is also a corresponding SSP_HEADER macro at the top of this file. */
69 SSP_FOOTER
70 
71 #endif /* BSP_LOCKING_H_ */
72 
73 
74