]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Nuvoton_Code/Device/Nuvoton/M2351/Include/ebi_reg.h
Add Cortex M23 GCC and IAR ports. Add demo projects for Nuvoton NuMaker-PFM-2351.
[freertos] / FreeRTOS / Demo / CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC / Nuvoton_Code / Device / Nuvoton / M2351 / Include / ebi_reg.h
1 /**************************************************************************//**\r
2  * @file     ebi_reg.h\r
3  * @version  V1.00\r
4  * @brief    EBI register definition header file\r
5  *\r
6  * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved.\r
7  *****************************************************************************/\r
8 #ifndef __EBI_REG_H__\r
9 #define __EBI_REG_H__\r
10 \r
11 /** @addtogroup REGISTER Control Register\r
12 \r
13   @{\r
14 \r
15 */\r
16 \r
17 \r
18 /*---------------------- External Bus Interface Controller -------------------------*/\r
19 /**\r
20     @addtogroup EBI External Bus Interface Controller(EBI)\r
21     Memory Mapped Structure for EBI Controller\r
22 @{ */\r
23 \r
24 typedef struct\r
25 {\r
26 \r
27 \r
28     /**\r
29      * @var EBI_T::CTL0\r
30      * Offset: 0x00  External Bus Interface Control Register\r
31      * ---------------------------------------------------------------------------------------------------\r
32      * |Bits    |Field     |Descriptions\r
33      * | :----: | :----:   | :---- |\r
34      * |[0]     |EN        |EBI Enable Bit\r
35      * |        |          |This bit is the functional enable bit for EBI.\r
36      * |        |          |0 = EBI function Disabled.\r
37      * |        |          |1 = EBI function Enabled.\r
38      * |[1]     |DW16      |EBI Data Width 16-bit Select\r
39      * |        |          |This bit defines if the EBI data width is 8-bit or 16-bit.\r
40      * |        |          |0 = EBI data width is 8-bit.\r
41      * |        |          |1 = EBI data width is 16-bit.\r
42      * |[2]     |CSPOLINV  |Chip Select Pin Polar Inverse\r
43      * |        |          |This bit defines the active level of EBI chip select pin (EBI_nCS).\r
44      * |        |          |0 = Chip select pin (EBI_nCS) is active low.\r
45      * |        |          |1 = Chip select pin (EBI_nCS) is active high.\r
46      * |[3]     |ADSEPEN   |EBI Address/Data Bus Separating Mode Enable Bit\r
47      * |        |          |0 = Address/Data Bus Separating Mode Disabled.\r
48      * |        |          |1 = Address/Data Bus Separating Mode Enabled.\r
49      * |[4]     |CACCESS   |Continuous Data Access Mode\r
50      * |        |          |When continuous access mode enabled, the tASU, tALE and tLHD cycles are bypass for continuous data transfer request.\r
51      * |        |          |0 = Continuous data access mode Disabled.\r
52      * |        |          |1 = Continuous data access mode Enabled.\r
53      * |[10:8]  |MCLKDIV   |External Output Clock Divider\r
54      * |        |          |The frequency of EBI output clock (MCLK) is controlled by MCLKDIV as follow:\r
55      * |        |          |000 = HCLK/1.\r
56      * |        |          |001 = HCLK/2.\r
57      * |        |          |010 = HCLK/4.\r
58      * |        |          |011 = HCLK/8.\r
59      * |        |          |100 = HCLK/16.\r
60      * |        |          |101 = HCLK/32.\r
61      * |        |          |110 = HCLK/64.\r
62      * |        |          |111 = HCLK/128.\r
63      * |[18:16] |TALE      |Extend Time of ALE\r
64      * |        |          |The EBI_ALE high pulse period (tALE) to latch the address can be controlled by TALE.\r
65      * |        |          |tALE = (TALE+1)*EBI_MCLK.\r
66      * |        |          |Note: This field only available in EBI_CTL0 register\r
67      * @var EBI_T::TCTL0\r
68      * Offset: 0x04  External Bus Interface Timing Control Register\r
69      * ---------------------------------------------------------------------------------------------------\r
70      * |Bits    |Field     |Descriptions\r
71      * | :----: | :----:   | :---- |\r
72      * |[7:3]   |TACC      |EBI Data Access Time\r
73      * |        |          |TACC define data access time (tACC).\r
74      * |        |          |tACC = (TACC+1) * EBI_MCLK.\r
75      * |[10:8]  |TAHD      |EBI Data Access Hold Time\r
76      * |        |          |TAHD define data access hold time (tAHD).\r
77      * |        |          |tAHD = (TAHD+1) * EBI_MCLK.\r
78      * |[15:12] |W2X       |Idle Cycle After Write\r
79      * |        |          |This field defines the number of W2X idle cycle.\r
80      * |        |          |W2X idle cycle = (W2X * EBI_MCLK).\r
81      * |        |          |When write action is finish, W2X idle cycle is inserted and EBI_nCS return to idle state.\r
82      * |[22]    |RAHDOFF   |Access Hold Time Disable Control When Read\r
83      * |        |          |0 = The Data Access Hold Time (tAHD) during EBI reading is Enabled.\r
84      * |        |          |1 = The Data Access Hold Time (tAHD) during EBI reading is Disabled.\r
85      * |[23]    |WAHDOFF   |Access Hold Time Disable Control When Write\r
86      * |        |          |0 = The Data Access Hold Time (tAHD) during EBI writing is Enabled.\r
87      * |        |          |1 = The Data Access Hold Time (tAHD) during EBI writing is Disabled.\r
88      * |[27:24] |R2R       |Idle Cycle Between Read-to-read\r
89      * |        |          |This field defines the number of R2R idle cycle.\r
90      * |        |          |R2R idle cycle = (R2R * EBI_MCLK).\r
91      * |        |          |When read action is finish and next action is going to read, R2R idle cycle is inserted and EBI_nCS return to idle state.\r
92      */\r
93     __IO uint32_t CTL0;                  /*!< [0x0000] External Bus Interface Bank0 Control Register                    */\r
94     __IO uint32_t TCTL0;                 /*!< [0x0004] External Bus Interface Bank0 Timing Control Register             */\r
95     __I  uint32_t RESERVE0[2];\r
96     __IO uint32_t CTL1;                  /*!< [0x0010] External Bus Interface Bank1 Control Register                    */\r
97     __IO uint32_t TCTL1;                 /*!< [0x0014] External Bus Interface Bank1 Timing Control Register             */\r
98     __I  uint32_t RESERVE1[2];\r
99     __IO uint32_t CTL2;                  /*!< [0x0020] External Bus Interface Bank2 Control Register                    */\r
100     __IO uint32_t TCTL2;                 /*!< [0x0024] External Bus Interface Bank2 Timing Control Register             */\r
101 \r
102 } EBI_T;\r
103 \r
104 /**\r
105     @addtogroup EBI_CONST EBI Bit Field Definition\r
106     Constant Definitions for EBI Controller\r
107 @{ */\r
108 \r
109 #define EBI_CTL_EN_Pos                   (0)                                               /*!< EBI_T::CTL0: EN Position                  */\r
110 #define EBI_CTL_EN_Msk                   (0x1ul << EBI_CTL_EN_Pos)                         /*!< EBI_T::CTL0: EN Mask                      */\r
111 \r
112 #define EBI_CTL_DW16_Pos                 (1)                                               /*!< EBI_T::CTL0: DW16 Position                */\r
113 #define EBI_CTL_DW16_Msk                 (0x1ul << EBI_CTL_DW16_Pos)                       /*!< EBI_T::CTL0: DW16 Mask                    */\r
114 \r
115 #define EBI_CTL_CSPOLINV_Pos             (2)                                               /*!< EBI_T::CTL0: CSPOLINV Position            */\r
116 #define EBI_CTL_CSPOLINV_Msk             (0x1ul << EBI_CTL_CSPOLINV_Pos)                   /*!< EBI_T::CTL0: CSPOLINV Mask                */\r
117 \r
118 #define EBI_CTL_ADSEPEN_Pos              (3)                                               /*!< EBI_T::CTL0: ADSEPEN Position            */\r
119 #define EBI_CTL_ADSEPEN_Msk              (0x1ul << EBI_CTL_ADSEPEN_Pos)                    /*!< EBI_T::CTL0: ADSEPEN Mask                */\r
120 \r
121 #define EBI_CTL_CACCESS_Pos              (4)                                               /*!< EBI_T::CTL0: CACCESS Position             */\r
122 #define EBI_CTL_CACCESS_Msk              (0x1ul << EBI_CTL_CACCESS_Pos)                    /*!< EBI_T::CTL0: CACCESS Mask                 */\r
123 \r
124 #define EBI_CTL_MCLKDIV_Pos              (8)                                               /*!< EBI_T::CTL0: MCLKDIV Position             */\r
125 #define EBI_CTL_MCLKDIV_Msk              (0x7ul << EBI_CTL_MCLKDIV_Pos)                    /*!< EBI_T::CTL0: MCLKDIV Mask                 */\r
126 \r
127 #define EBI_CTL_TALE_Pos                 (16)                                              /*!< EBI_T::CTL0: TALE Position                */\r
128 #define EBI_CTL_TALE_Msk                 (0x7ul << EBI_CTL_TALE_Pos)                       /*!< EBI_T::CTL0: TALE Mask                    */\r
129 \r
130 #define EBI_TCTL_TACC_Pos                (3)                                               /*!< EBI_T::TCTL0: TACC Position               */\r
131 #define EBI_TCTL_TACC_Msk                (0x1ful << EBI_TCTL_TACC_Pos)                     /*!< EBI_T::TCTL0: TACC Mask                   */\r
132 \r
133 #define EBI_TCTL_TAHD_Pos                (8)                                               /*!< EBI_T::TCTL0: TAHD Position               */\r
134 #define EBI_TCTL_TAHD_Msk                (0x7ul << EBI_TCTL_TAHD_Pos)                      /*!< EBI_T::TCTL0: TAHD Mask                   */\r
135 \r
136 #define EBI_TCTL_W2X_Pos                 (12)                                              /*!< EBI_T::TCTL0: W2X Position                */\r
137 #define EBI_TCTL_W2X_Msk                 (0xful << EBI_TCTL_W2X_Pos)                       /*!< EBI_T::TCTL0: W2X Mask                    */\r
138 \r
139 #define EBI_TCTL_RAHDOFF_Pos             (22)                                              /*!< EBI_T::TCTL0: RAHDOFF Position            */\r
140 #define EBI_TCTL_RAHDOFF_Msk             (0x1ul << EBI_TCTL_RAHDOFF_Pos)                   /*!< EBI_T::TCTL0: RAHDOFF Mask                */\r
141 \r
142 #define EBI_TCTL_WAHDOFF_Pos             (23)                                              /*!< EBI_T::TCTL0: WAHDOFF Position            */\r
143 #define EBI_TCTL_WAHDOFF_Msk             (0x1ul << EBI_TCTL_WAHDOFF_Pos)                   /*!< EBI_T::TCTL0: WAHDOFF Mask                */\r
144 \r
145 #define EBI_TCTL_R2R_Pos                 (24)                                              /*!< EBI_T::TCTL0: R2R Position                */\r
146 #define EBI_TCTL_R2R_Msk                 (0xful << EBI_TCTL_R2R_Pos)                       /*!< EBI_T::TCTL0: R2R Mask                    */\r
147 \r
148 /**@}*/ /* EBI_CONST */\r
149 /**@}*/ /* end of EBI register group */\r
150 /**@}*/ /* end of REGISTER group */\r
151 \r
152 \r
153 #endif /* __EBI_REG_H__ */\r