I am using Atmel Studio and the samd21 explained board to try and build a state machine for class. I am using ASF, but I haven't added any additional modules to the project.
I know I can use the form [peripheral]->something.something.bit.something to access specific registers or bits, like the count registers for a timer.
TC3->COUNT16.COUNT.reg = 0;
but how come when I try to use this with the enable bit on TC3 I get a compiler error? The code I was trying looked like this:
TC3->COUNT16.CTRLA.bit.ENABLE == false;
The error I get is "expected identifier before numeric constant in expansion of macro 'ENABLE';
I understand that I can just set the bit using
REG_TC3_CTRLA &= ~TC_CTRLA_ENABLE;
I guess I'm just curious, since I feel the first method is easier to read than the one I ended up using. The class I'm taking is using the MSP430, but I'm trying to reproduce all the projects on the xplained board to teach myself ARM.