fm33lc0xx_fl_def.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. /* Define to prevent recursive inclusion --------------------------------------------------------------*/
  22. #ifndef __FM33LC0XX_FL_DEF_H
  23. #define __FM33LC0XX_FL_DEF_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /* Includes -------------------------------------------------------------------------------------------*/
  28. #include "fm33lc0xx.h"
  29. #include "fm33_assert.h"
  30. #include <stddef.h>
  31. #include <stdint.h>
  32. #include <stdbool.h>
  33. /* Macros ---------------------------------------------------------------------------------------------*/
  34. /** @defgroup FL_Exported_Macros FL Driver Library Private Macros
  35. * @{
  36. */
  37. /**
  38. * @brief Bit-wise operation macros used by FL driver library functions
  39. */
  40. #define SET_BIT(REG, BIT) ((REG) |= (BIT))
  41. #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
  42. #define READ_BIT(REG, BIT) ((REG) & (BIT))
  43. #define CLEAR_REG(REG) ((REG) = (0x0))
  44. #define WRITE_REG(REG, VAL) ((REG) = (VAL))
  45. #define READ_REG(REG) ((REG))
  46. #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
  47. /**
  48. * @}
  49. */
  50. /* Types ----------------------------------------------------------------------------------------------*/
  51. /** @defgroup FL_PT_Return FL Driver Library Private Return Type Defines
  52. * @{
  53. */
  54. typedef enum
  55. {
  56. FL_RESET = 0U,
  57. FL_SET = !FL_RESET
  58. } FL_FlagStatus, FL_ITStatus;
  59. typedef enum
  60. {
  61. FL_DISABLE = 0U,
  62. FL_ENABLE = !FL_DISABLE
  63. } FL_FunState;
  64. #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == FL_DISABLE) || ((STATE) == FL_ENABLE))
  65. typedef enum
  66. {
  67. FL_FAIL = 0U,
  68. FL_PASS = !FL_FAIL
  69. } FL_ErrorStatus;
  70. /**
  71. * @}
  72. */
  73. #ifdef __cplusplus
  74. }
  75. #endif
  76. #endif /* __FM33LC0XX_FL_DEF_H */
  77. /********************** (C) COPYRIGHT Fudan Microelectronics **** END OF FILE ***********************/