]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_MPU_M23_Nuvoton_NuMaker_PFM_M2351_IAR_GCC/Nuvoton_Code/Device/Nuvoton/M2351/Include/hdiv_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 / hdiv_reg.h
1 /**************************************************************************//**\r
2  * @file     hdiv_reg.h\r
3  * @version  V1.00\r
4  * @brief    HDIV register definition header file\r
5  *\r
6  * @copyright (C) 2017 Nuvoton Technology Corp. All rights reserved.\r
7  *****************************************************************************/\r
8 #ifndef __HDIV_REG_H__\r
9 #define __HDIV_REG_H__\r
10 \r
11 /** @addtogroup REGISTER Control Register\r
12 \r
13   @{\r
14 \r
15 */\r
16 \r
17 /*---------------------- Hardware Divider --------------------------------*/\r
18 /**\r
19     @addtogroup HDIV Hardware Divider(HDIV)\r
20     Memory Mapped Structure for HDIV Controller\r
21 @{ */\r
22 \r
23 typedef struct\r
24 {\r
25 \r
26 \r
27     /**\r
28      * @var HDIV_T::DIVIDEND\r
29      * Offset: 0x00  Dividend Source Register\r
30      * ---------------------------------------------------------------------------------------------------\r
31      * |Bits    |Field     |Descriptions\r
32      * | :----: | :----:   | :---- |\r
33      * |[31:0]  |DIVIDEND  |Dividend Source\r
34      * |        |          |This register is given the dividend of divider before calculation starting.\r
35      * @var HDIV_T::DIVISOR\r
36      * Offset: 0x04  Divisor Source Resister\r
37      * ---------------------------------------------------------------------------------------------------\r
38      * |Bits    |Field     |Descriptions\r
39      * | :----: | :----:   | :---- |\r
40      * |[15:0]  |DIVISOR   |Divisor Source\r
41      * |        |          |This register is given the divisor of divider before calculation starts.\r
42      * |        |          |Note: When this register is written, hardware divider will start calculate.\r
43      * @var HDIV_T::DIVQUO\r
44      * Offset: 0x08  Quotient Result Resister\r
45      * ---------------------------------------------------------------------------------------------------\r
46      * |Bits    |Field     |Descriptions\r
47      * | :----: | :----:   | :---- |\r
48      * |[31:0]  |QUOTIENT  |Quotient Result\r
49      * |        |          |This register holds the quotient result of divider after calculation complete.\r
50      * @var HDIV_T::DIVREM\r
51      * Offset: 0x0C  Remainder Result Register\r
52      * ---------------------------------------------------------------------------------------------------\r
53      * |Bits    |Field     |Descriptions\r
54      * | :----: | :----:   | :---- |\r
55      * |[31:0]  |REMAINDER |Remainder Result\r
56      * |        |          |The remainder of hardware divider is 16-bit sign integer (REMAINDER[15:0]), which holds the remainder result of divider after calculation complete.\r
57      * |        |          |The remainder of hardware divider with sign extension (REMAINDER[31:16]) to 32-bit integer.\r
58      * |        |          |This register holds the remainder result of divider after calculation complete.\r
59      * @var HDIV_T::DIVSTS\r
60      * Offset: 0x10  Divider Status Register\r
61      * ---------------------------------------------------------------------------------------------------\r
62      * |Bits    |Field     |Descriptions\r
63      * | :----: | :----:   | :---- |\r
64      * |[0]     |FINISH    |Division Finish Flag\r
65      * |        |          |0 = Under Calculation.\r
66      * |        |          |1 = Calculation finished.\r
67      * |        |          |The flag will become low when the divider is in calculation.\r
68      * |        |          |The flag will go back to high once the calculation finished.\r
69      * |[1]     |DIV0      |Divisor Zero Warning\r
70      * |        |          |0 = The divisor is not 0.\r
71      * |        |          |1 = The divisor is 0.\r
72      * |        |          |Note: The DIV0 flag is used to indicate divide-by-zero situation and updated whenever DIVISOR is written\r
73      * |        |          |This register is read only.\r
74      */\r
75     __IO uint32_t DIVIDEND;              /*!< [0x0000] Dividend Source Register                                         */\r
76     __IO uint32_t DIVISOR;               /*!< [0x0004] Divisor Source Resister                                          */\r
77     __IO uint32_t DIVQUO;                /*!< [0x0008] Quotient Result Resister                                         */\r
78     __IO uint32_t DIVREM;                /*!< [0x000c] Remainder Result Register                                        */\r
79     __I  uint32_t DIVSTS;                /*!< [0x0010] Divider Status Register                                          */\r
80 \r
81 } HDIV_T;\r
82 \r
83 /**\r
84     @addtogroup HDIV_CONST HDIV Bit Field Definition\r
85     Constant Definitions for HDIV Controller\r
86 @{ */\r
87 \r
88 #define HDIV_DIVIDEND_DIVIDEND_Pos       (0)                                               /*!< HDIV_T::DIVIDEND: DIVIDEND Position    */\r
89 #define HDIV_DIVIDEND_DIVIDEND_Msk       (0xfffffffful << HDIV_DIVIDEND_DIVIDEND_Pos)      /*!< HDIV_T::DIVIDEND: DIVIDEND Mask        */\r
90 \r
91 #define HDIV_DIVISOR_DIVISOR_Pos         (0)                                               /*!< HDIV_T::DIVISOR: DIVISOR Position      */\r
92 #define HDIV_DIVISOR_DIVISOR_Msk         (0xfffful << HDIV_DIVISOR_DIVISOR_Pos)            /*!< HDIV_T::DIVISOR: DIVISOR Mask          */\r
93 \r
94 #define HDIV_DIVQUO_QUOTIENT_Pos         (0)                                               /*!< HDIV_T::DIVQUO: QUOTIENT Position      */\r
95 #define HDIV_DIVQUO_QUOTIENT_Msk         (0xfffffffful << HDIV_DIVQUO_QUOTIENT_Pos)        /*!< HDIV_T::DIVQUO: QUOTIENT Mask          */\r
96 \r
97 #define HDIV_DIVREM_REMAINDER_Pos        (0)                                               /*!< HDIV_T::DIVREM: REMAINDER Position     */\r
98 #define HDIV_DIVREM_REMAINDER_Msk        (0xfffffffful << HDIV_DIVREM_REMAINDER_Pos)       /*!< HDIV_T::DIVREM: REMAINDER Mask         */\r
99 \r
100 #define HDIV_DIVSTS_FINISH_Pos           (0)                                               /*!< HDIV_T::DIVSTS: FINISH Position        */\r
101 #define HDIV_DIVSTS_FINISH_Msk           (0x1ul << HDIV_DIVSTS_FINISH_Pos)                 /*!< HDIV_T::DIVSTS: FINISH Mask            */\r
102 \r
103 #define HDIV_DIVSTS_DIV0_Pos             (1)                                               /*!< HDIV_T::DIVSTS: DIV0 Position          */\r
104 #define HDIV_DIVSTS_DIV0_Msk             (0x1ul << HDIV_DIVSTS_DIV0_Pos)                   /*!< HDIV_T::DIVSTS: DIV0 Mask              */\r
105 \r
106 /**@}*/ /* HDIV_CONST */\r
107 /**@}*/ /* end of HDIV register group */\r
108 /**@}*/ /* end of REGISTER group */\r
109 \r
110 \r
111 #endif /* __HDIV_REG_H__ */\r