• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2   ******************************************************************************
3   * @file    stm32mp1xx.h
4   * @author  MCD Application Team
5   * @brief   CMSIS STM32MP1xx Device Peripheral Access Layer Header File.
6   *
7   *          The file is the unique include file that the application programmer
8   *          is using in the C source code, usually in main.c. This file contains:
9   *           - Configuration section that allows to select:
10   *              - The STM32MP1xx device used in the target application
11   *              - To use or not the peripheral�s drivers in application code(i.e.
12   *                code will be based on direct access to peripheral�s registers
13   *                rather than drivers API), this option is controlled by
14   *                "#define USE_HAL_DRIVER"
15   *
16   ******************************************************************************
17   * @attention
18   *
19   * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
20   * All rights reserved.</center></h2>
21   *
22   * This software component is licensed by ST under BSD 3-Clause license,
23   * the "License"; You may not use this file except in compliance with the
24   * License. You may obtain a copy of the License at:
25   *                        opensource.org/licenses/BSD-3-Clause
26   *
27   ******************************************************************************
28   */
29 
30 #ifndef __STM32MP1xx_H
31 #define __STM32MP1xx_H
32 
33 #ifdef __cplusplus
34  extern "C" {
35 #endif /* __cplusplus */
36 
37 #include "stm32mp157axx_ca7.h"
38 
39 typedef enum
40 {
41   RESET = 0,
42   SET = !RESET
43 } FlagStatus, ITStatus;
44 
45 typedef enum
46 {
47   DISABLE = 0,
48   ENABLE = !DISABLE
49 } FunctionalState;
50 #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
51 
52 typedef enum
53 {
54   ERROR = 0,
55   SUCCESS = !ERROR
56 } ErrorStatus;
57 
58 #define SET_BIT(REG, BIT)     ((REG) |= (BIT))
59 
60 #define CLEAR_BIT(REG, BIT)   ((REG) &= ~(BIT))
61 
62 #define READ_BIT(REG, BIT)    ((REG) & (BIT))
63 
64 #define CLEAR_REG(REG)        ((REG) = (0x0))
65 
66 #define WRITE_REG(REG, VAL)   ((REG) = (VAL))
67 
68 #define READ_REG(REG)         ((REG))
69 
70 #define MODIFY_REG(REG, CLEARMASK, SETMASK)  WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
71 
72 #define POSITION_VAL(VAL)     (__CLZ(__RBIT(VAL)))
73 
74 #ifdef __cplusplus
75 }
76 #endif /* __cplusplus */
77 
78 #endif /* __STM32MP1xx_H */
79