Hello,
In Atmel Studio7 with an Attiny 1614 project, i have found that this:
TCA0_SINGLE.INTFLAGS
is not recognized as being declared.
When changed to using underscores, there is no compiler error.
TCA0_SINGLE_INTFLAGS
The Attiny1614 header file shows
typedef struct TCA_SINGLE_struct { register8_t CTRLA; /* Control A */ register8_t CTRLB; /* Control B */ register8_t CTRLC; /* Control C */ register8_t CTRLD; /* Control D */ register8_t CTRLECLR; /* Control E Clear */ register8_t CTRLESET; /* Control E Set */ register8_t CTRLFCLR; /* Control F Clear */ register8_t CTRLFSET; /* Control F Set */ register8_t reserved_0x08; register8_t EVCTRL; /* Event Control */ register8_t INTCTRL; /* Interrupt Control */ register8_t INTFLAGS; //////AND/// /* TCA_SINGLE.INTCTRL bit masks and bit positions */ #define TCA_SINGLE_OVF_bm 0x01 /* Overflow Interrupt bit mask. */ #define TCA_SINGLE_OVF_bp 0 /* Overflow Interrupt bit position. */ #define TCA_SINGLE_CMP0_bm 0x10 /* Compare 0 Interrupt bit mask. */ #define TCA_SINGLE_CMP0_bp 4 /* Compare 0 Interrupt bit position. */ #define TCA_SINGLE_CMP1_bm 0x20 /* Compare 1 Interrupt bit mask. */ #define TCA_SINGLE_CMP1_bp 5 /* Compare 1 Interrupt bit position. */ #define TCA_SINGLE_CMP2_bm 0x40 /* Compare 2 Interrupt bit mask. */ #define TCA_SINGLE_CMP2_bp 6 /* Compare 2 Interrupt bit position. */ /* TCA_SINGLE.INTFLAGS bit masks and bit positions */ /* TCA_SINGLE_OVF is already defined. */ /* TCA_SINGLE_CMP0 is already defined. */ /* TCA_SINGLE_CMP1 is already defined. */ /* TCA_SINGLE_CMP2 is already defined. */
Other parts of my code with using periods '.' instead of underscores '_' in the register names appear to be recognized just fine.
/* TCA0 used for button pressing, led control and 20 minutes on timer. Clk/1024*/ TCA0_SINGLE.CTRLA |= TCA_SINGLE_CLKSEL_gm;//TCA0 cpu-clk divide by 1024. 7812.5hz counter TCA0_SINGLE.CTRLA |= TCA_SINGLE_ENABLE_bm;// Timer/Counter A is enabled by (1<<0) TCA0_SINGLE.CMP2 = FIVE_MS;// Every 5ms(200hz) button scanning (manual flag check) TCA0_SINGLE.CMP0 = 256;// Slow counter @ 30.5hz //// /* TCB0-1 used in 16bit no-prescale counter(8mhz), default Periodic update mode */ TCB0.CTRLA |= TCB_ENABLE_bm;// Timer counter B0-1 enabled. TCB1.CTRLA |= TCB_ENABLE_bm;// TCB0.CCMP |= 2841;// 11Mhz 8bit dac clock count compare match TCB1.CCMP |= 2373;// 13.17hz TCB0.INTCTRL |= TCB_CAPT_bm;//Interrupts enabled TCB1.INTCTRL |= TCB_CAPT_bm;
For now ill just use underscores even though i do like:
TCB0.CTRLA /*vs*/ TCB0_CTRLA
For registry names to stand out from registry bits.