/** * @copyright 2022 indie Semiconductor * * This file is proprietary to indie Semiconductor. * All rights reserved. Reproduction or distribution, in whole * or in part, is forbidden except by express written permission * of indie Semiconductor. * * @file gtimer_sfr.h */ #ifndef GTIMER_SFR_H__ #define GTIMER_SFR_H__ #include /* ------- Start of section using anonymous unions and disabling warnings ------- */ #if defined (__CC_ARM) #pragma push #pragma anon_unions #elif defined (__ICCARM__) #pragma language=extended #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wc11-extensions" #pragma clang diagnostic ignored "-Wreserved-id-macro" #elif defined (__GNUC__) /* anonymous unions are enabled by default */ #elif defined (__TMS470__) /* anonymous unions are enabled by default */ #elif defined (__TASKING__) #pragma warning 586 #elif defined (__CSMC__) /* anonymous unions are enabled by default */ #else #warning Not supported compiler type #endif typedef struct { union { struct { uint8_t GTDCEN : 1; /*!< GT1 Direction Control Enable */ uint8_t GTPRES : 4; /*!< Prescaler select */ uint8_t GTEDGE : 1; /*!< GT1 Edge select in capture mode/reload mode */ uint8_t GTHRSEL : 2; /*!< GT1 hardware run selection */ uint8_t GTCAPEN : 1; /*!< GT1 Capture Enable */ uint8_t GTCNTEN : 1; /*!< GT1 Counter Mode Enable */ uint8_t GTR : 1; /*!< Timer GT1 run bit */ uint8_t GTEXTEN : 1; /*!< GT1 external enable control */ uint8_t GTSSE : 1; /*!< GT1 single shot enable */ uint8_t : 1; /* (reserved) */ uint8_t GTEXTF : 1; /*!< GT1 external flag */ uint8_t GTTF : 1; /*!< GT1 overflow/underflow flag */ uint16_t : 16; /* (reserved) */ }; uint32_t WORD; } GTCTRLR; /* +0x000 */ union { struct { uint8_t : 6; /* (reserved) */ uint8_t GTEXTFIE : 1; /*!< External interrupt enable */ uint8_t GTTFIE : 1; /*!< Overflow/underflow interrupt enable */ uint8_t : 6; /* (reserved) */ uint8_t GTEXTFC : 1; /*!< GT1EXTF Clear */ uint8_t GTTFC : 1; /*!< GT1TF Clear */ uint16_t : 16; /* (reserved) */ }; uint32_t WORD; } GTINTCTRLR; /* +0x004 */ uint16_t GTRCV; /*GT1 Reload/Capture Value +0x008 */ uint8_t _RESERVED_0A[2]; /* +0x00A */ uint16_t GTCV; /* +0x00C */ uint8_t _RESERVED_0E[2]; /* +0x00E */ }GTimer_t; /** * @brief A structure to represent Special Function Registers for GTIMER. */ typedef struct { GTimer_t TIMER[5]; } GTIMER_SFRS_t; /* -------- End of section using anonymous unions and disabling warnings -------- */ #if defined (__CC_ARM) #pragma pop #elif defined (__ICCARM__) /* leave anonymous unions enabled */ #elif (__ARMCC_VERSION >= 6010050) #pragma clang diagnostic pop #elif defined (__GNUC__) /* anonymous unions are enabled by default */ #elif defined (__TMS470__) /* anonymous unions are enabled by default */ #elif defined (__TASKING__) #pragma warning restore #elif defined (__CSMC__) /* anonymous unions are enabled by default */ #else #warning Not supported compiler type #endif /** * @brief The starting address of GTIMER SFRS. */ #define GTIMER_SFRS ((__IO GTIMER_SFRS_t *)0x40010c00) #endif /* end of __GTIMER_SFR_H__ section */