1 /** 2 ******************************************************************************************************* 3 * @file fm33lc0xx_fl_def.h 4 * @author FMSH Application Team 5 * @brief Header file of FL Driver Library Defines 6 ******************************************************************************************************* 7 * @attention 8 * 9 * Copyright (c) [2021] [Fudan Microelectronics] 10 * THIS SOFTWARE is licensed under Mulan PSL v2. 11 * You can use this software according to the terms and conditions of the Mulan PSL v2. 12 * You may obtain a copy of Mulan PSL v2 at: 13 * http://license.coscl.org.cn/MulanPSL2 14 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, 15 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, 16 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 17 * See the Mulan PSL v2 for more details. 18 * 19 ******************************************************************************************************* 20 */ 21 22 23 /* Define to prevent recursive inclusion --------------------------------------------------------------*/ 24 #ifndef __FM33LC0XX_FL_DEF_H 25 #define __FM33LC0XX_FL_DEF_H 26 27 #ifdef __cplusplus 28 extern "C" { 29 #endif 30 31 /* Includes -------------------------------------------------------------------------------------------*/ 32 #include "fm33lc0xx.h" 33 #include "fm33_assert.h" 34 #include <stddef.h> 35 #include <stdint.h> 36 #include <stdbool.h> 37 38 /* Macros ---------------------------------------------------------------------------------------------*/ 39 /** @defgroup FL_Exported_Macros FL Driver Library Private Macros 40 * @{ 41 */ 42 43 /** 44 * @brief Bit-wise operation macros used by FL driver library functions 45 */ 46 #define SET_BIT(REG, BIT) ((REG) |= (BIT)) 47 #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT)) 48 #define READ_BIT(REG, BIT) ((REG) & (BIT)) 49 #define CLEAR_REG(REG) ((REG) = (0x0)) 50 #define WRITE_REG(REG, VAL) ((REG) = (VAL)) 51 #define READ_REG(REG) ((REG)) 52 #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK))) 53 54 /** 55 * @} 56 */ 57 58 /* Types ----------------------------------------------------------------------------------------------*/ 59 /** @defgroup FL_PT_Return FL Driver Library Private Return Type Defines 60 * @{ 61 */ 62 63 typedef enum 64 { 65 FL_RESET = 0U, 66 FL_SET = !FL_RESET 67 } FL_FlagStatus, FL_ITStatus; 68 69 typedef enum 70 { 71 FL_DISABLE = 0U, 72 FL_ENABLE = !FL_DISABLE 73 } FL_FunState; 74 #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == FL_DISABLE) || ((STATE) == FL_ENABLE)) 75 76 typedef enum 77 { 78 FL_FAIL = 0U, 79 FL_PASS = !FL_FAIL 80 } FL_ErrorStatus; 81 82 /** 83 * @} 84 */ 85 86 #ifdef __cplusplus 87 } 88 #endif 89 90 #endif /* __FM33LC0XX_FL_DEF_H */ 91 92 /********************** (C) COPYRIGHT Fudan Microelectronics **** END OF FILE ***********************/ 93