PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
4.2KB

  1. #ifndef __CM3_REGS
  2. #define __CM3_REGS
  3. #include <stdint.h>
  4. #ifdef __cplusplus
  5. #define __I volatile /*!< Defines 'read only' permissions */
  6. #else
  7. #define __I volatile const /*!< Defines 'read only' permissions */
  8. #endif
  9. #define __O volatile /*!< Defines 'write only' permissions */
  10. #define __IO volatile /*!< Defines 'read / write' permissions */
  11. typedef struct
  12. {
  13. __IO uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */
  14. __O uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */
  15. __IO uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */
  16. __IO uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */
  17. } CoreDebug_Type;
  18. #define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */
  19. #define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */
  20. #define CoreDebug_DEMCR_TRCENA_Pos 24 /*!< CoreDebug DEMCR: TRCENA Position */
  21. #define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */
  22. typedef struct
  23. {
  24. __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */
  25. __IO uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */
  26. __IO uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */
  27. __IO uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */
  28. __IO uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */
  29. __IO uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */
  30. __IO uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */
  31. __I uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */
  32. __IO uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */
  33. __IO uint32_t MASK0; /*!< Offset: 0x024 (R/W) Mask Register 0 */
  34. __IO uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */
  35. uint32_t RESERVED0[1];
  36. __IO uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */
  37. __IO uint32_t MASK1; /*!< Offset: 0x034 (R/W) Mask Register 1 */
  38. __IO uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */
  39. uint32_t RESERVED1[1];
  40. __IO uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */
  41. __IO uint32_t MASK2; /*!< Offset: 0x044 (R/W) Mask Register 2 */
  42. __IO uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */
  43. uint32_t RESERVED2[1];
  44. __IO uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */
  45. __IO uint32_t MASK3; /*!< Offset: 0x054 (R/W) Mask Register 3 */
  46. __IO uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */
  47. } DWT_Type;
  48. #define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */
  49. #define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */
  50. #define DWT_CTRL_CYCCNTENA_Pos 0 /*!< DWT CTRL: CYCCNTENA Position */
  51. #define DWT_CTRL_CYCCNTENA_Msk (0x1UL << DWT_CTRL_CYCCNTENA_Pos) /*!< DWT CTRL: CYCCNTENA Mask */
  52. #endif // __CM3_REGS