Skip to content

Commit

Permalink
samd21: Name all anonymous bit-fields with qualifiers.
Browse files Browse the repository at this point in the history
This conforms to CWG2229 and enables compilation with clang++.

Signed-off-by: Thomas Schranz <[email protected]>
  • Loading branch information
Thomas Schranz authored and nandojve committed Feb 6, 2025
1 parent cf5be88 commit d697369
Show file tree
Hide file tree
Showing 17 changed files with 91 additions and 52 deletions.
39 changes: 39 additions & 0 deletions asf/sam0/include/samd21/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Atmel SAM D21
##############

Origin:
Microchip Packs Repository
http://packs.download.atmel.com/

Atmel SAMD21 Series Device Support (1.2.276)
http://packs.download.atmel.com/Atmel.SAMD21_DFP.1.2.276.atpack

Status:
version 1.2.276

Purpose:
Official package for SAM D21.

Description:
Atmel Software Framework (ASF) provides a set of low-level
header files that give access to different hardware
peripherals of Atmel's ICs.

URL:
http://packs.download.atmel.com/
http://packs.download.atmel.com/Atmel.SAMD21_DFP.1.2.276.atpack

commit:
n/a

Maintained-by:
External

License:
Apache-2.0

License Link:
https://www.apache.org/licenses/LICENSE-2.0

Patch List:
* Fix anonymous bit-fields with qualifiers.
8 changes: 4 additions & 4 deletions asf/sam0/include/samd21/component/ac.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,15 @@ typedef union { // __I to avoid read-modify-write on write-to-clear register
struct {
__I uint8_t COMP0:1; /*!< bit: 0 Comparator 0 */
__I uint8_t COMP1:1; /*!< bit: 1 Comparator 1 */
__I uint8_t :2; /*!< bit: 2.. 3 Reserved */
__I uint8_t Reserved1:2; /*!< bit: 2.. 3 Reserved */
__I uint8_t WIN0:1; /*!< bit: 4 Window 0 */
__I uint8_t :3; /*!< bit: 5.. 7 Reserved */
__I uint8_t Reserved2:3; /*!< bit: 5.. 7 Reserved */
} bit; /*!< Structure used for bit access */
struct {
__I uint8_t COMP:2; /*!< bit: 0.. 1 Comparator x */
__I uint8_t :2; /*!< bit: 2.. 3 Reserved */
__I uint8_t Reserved1:2; /*!< bit: 2.. 3 Reserved */
__I uint8_t WIN:1; /*!< bit: 4 Window x */
__I uint8_t :3; /*!< bit: 5.. 7 Reserved */
__I uint8_t Reserved2:3; /*!< bit: 5.. 7 Reserved */
} vec; /*!< Structure used for vec access */
uint8_t reg; /*!< Type used for register access */
} AC_INTFLAG_Type;
Expand Down
2 changes: 1 addition & 1 deletion asf/sam0/include/samd21/component/adc.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ typedef union { // __I to avoid read-modify-write on write-to-clear register
__I uint8_t OVERRUN:1; /*!< bit: 1 Overrun */
__I uint8_t WINMON:1; /*!< bit: 2 Window Monitor */
__I uint8_t SYNCRDY:1; /*!< bit: 3 Synchronization Ready */
__I uint8_t :4; /*!< bit: 4.. 7 Reserved */
__I uint8_t Reserved1:4; /*!< bit: 4.. 7 Reserved */
} bit; /*!< Structure used for bit access */
uint8_t reg; /*!< Type used for register access */
} ADC_INTFLAG_Type;
Expand Down
2 changes: 1 addition & 1 deletion asf/sam0/include/samd21/component/dac.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ typedef union { // __I to avoid read-modify-write on write-to-clear register
__I uint8_t UNDERRUN:1; /*!< bit: 0 Underrun */
__I uint8_t EMPTY:1; /*!< bit: 1 Data Buffer Empty */
__I uint8_t SYNCRDY:1; /*!< bit: 2 Synchronization Ready */
__I uint8_t :5; /*!< bit: 3.. 7 Reserved */
__I uint8_t Reserved1:5; /*!< bit: 3.. 7 Reserved */
} bit; /*!< Structure used for bit access */
uint8_t reg; /*!< Type used for register access */
} DAC_INTFLAG_Type;
Expand Down
2 changes: 1 addition & 1 deletion asf/sam0/include/samd21/component/dmac.h
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ typedef union { // __I to avoid read-modify-write on write-to-clear register
__I uint8_t TERR:1; /*!< bit: 0 Channel Transfer Error */
__I uint8_t TCMPL:1; /*!< bit: 1 Channel Transfer Complete */
__I uint8_t SUSP:1; /*!< bit: 2 Channel Suspend */
__I uint8_t :5; /*!< bit: 3.. 7 Reserved */
__I uint8_t Reserved1:5; /*!< bit: 3.. 7 Reserved */
} bit; /*!< Structure used for bit access */
uint8_t reg; /*!< Type used for register access */
} DMAC_CHINTFLAG_Type;
Expand Down
4 changes: 2 additions & 2 deletions asf/sam0/include/samd21/component/eic.h
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,11 @@ typedef union { // __I to avoid read-modify-write on write-to-clear register
__I uint32_t EXTINT13:1; /*!< bit: 13 External Interrupt 13 */
__I uint32_t EXTINT14:1; /*!< bit: 14 External Interrupt 14 */
__I uint32_t EXTINT15:1; /*!< bit: 15 External Interrupt 15 */
__I uint32_t :16; /*!< bit: 16..31 Reserved */
__I uint32_t Reserved1:16; /*!< bit: 16..31 Reserved */
} bit; /*!< Structure used for bit access */
struct {
__I uint32_t EXTINT:16; /*!< bit: 0..15 External Interrupt x */
__I uint32_t :16; /*!< bit: 16..31 Reserved */
__I uint32_t Reserved1:16; /*!< bit: 16..31 Reserved */
} vec; /*!< Structure used for vec access */
uint32_t reg; /*!< Type used for register access */
} EIC_INTFLAG_Type;
Expand Down
8 changes: 4 additions & 4 deletions asf/sam0/include/samd21/component/evsys.h
Original file line number Diff line number Diff line change
Expand Up @@ -485,20 +485,20 @@ typedef union { // __I to avoid read-modify-write on write-to-clear register
__I uint32_t OVR9:1; /*!< bit: 17 Channel 9 Overrun */
__I uint32_t OVR10:1; /*!< bit: 18 Channel 10 Overrun */
__I uint32_t OVR11:1; /*!< bit: 19 Channel 11 Overrun */
__I uint32_t :4; /*!< bit: 20..23 Reserved */
__I uint32_t Reserved1:4; /*!< bit: 20..23 Reserved */
__I uint32_t EVD8:1; /*!< bit: 24 Channel 8 Event Detection */
__I uint32_t EVD9:1; /*!< bit: 25 Channel 9 Event Detection */
__I uint32_t EVD10:1; /*!< bit: 26 Channel 10 Event Detection */
__I uint32_t EVD11:1; /*!< bit: 27 Channel 11 Event Detection */
__I uint32_t :4; /*!< bit: 28..31 Reserved */
__I uint32_t Reserved2:4; /*!< bit: 28..31 Reserved */
} bit; /*!< Structure used for bit access */
struct {
__I uint32_t OVR:8; /*!< bit: 0.. 7 Channel x Overrun */
__I uint32_t EVD:8; /*!< bit: 8..15 Channel x Event Detection */
__I uint32_t OVRp8:4; /*!< bit: 16..19 Channel x+8 Overrun */
__I uint32_t :4; /*!< bit: 20..23 Reserved */
__I uint32_t Reserved1:4; /*!< bit: 20..23 Reserved */
__I uint32_t EVDp8:4; /*!< bit: 24..27 Channel x+8 Event Detection */
__I uint32_t :4; /*!< bit: 28..31 Reserved */
__I uint32_t Reserved2:4; /*!< bit: 28..31 Reserved */
} vec; /*!< Structure used for vec access */
uint32_t reg; /*!< Type used for register access */
} EVSYS_INTFLAG_Type;
Expand Down
16 changes: 8 additions & 8 deletions asf/sam0/include/samd21/component/i2s.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,26 +313,26 @@ typedef union { // __I to avoid read-modify-write on write-to-clear register
struct {
__I uint16_t RXRDY0:1; /*!< bit: 0 Receive Ready 0 */
__I uint16_t RXRDY1:1; /*!< bit: 1 Receive Ready 1 */
__I uint16_t :2; /*!< bit: 2.. 3 Reserved */
__I uint16_t Reserved1:2; /*!< bit: 2.. 3 Reserved */
__I uint16_t RXOR0:1; /*!< bit: 4 Receive Overrun 0 */
__I uint16_t RXOR1:1; /*!< bit: 5 Receive Overrun 1 */
__I uint16_t :2; /*!< bit: 6.. 7 Reserved */
__I uint16_t Reserved2:2; /*!< bit: 6.. 7 Reserved */
__I uint16_t TXRDY0:1; /*!< bit: 8 Transmit Ready 0 */
__I uint16_t TXRDY1:1; /*!< bit: 9 Transmit Ready 1 */
__I uint16_t :2; /*!< bit: 10..11 Reserved */
__I uint16_t Reserved3:2; /*!< bit: 10..11 Reserved */
__I uint16_t TXUR0:1; /*!< bit: 12 Transmit Underrun 0 */
__I uint16_t TXUR1:1; /*!< bit: 13 Transmit Underrun 1 */
__I uint16_t :2; /*!< bit: 14..15 Reserved */
__I uint16_t Reserved4:2; /*!< bit: 14..15 Reserved */
} bit; /*!< Structure used for bit access */
struct {
__I uint16_t RXRDY:2; /*!< bit: 0.. 1 Receive Ready x */
__I uint16_t :2; /*!< bit: 2.. 3 Reserved */
__I uint16_t Reserved1:2; /*!< bit: 2.. 3 Reserved */
__I uint16_t RXOR:2; /*!< bit: 4.. 5 Receive Overrun x */
__I uint16_t :2; /*!< bit: 6.. 7 Reserved */
__I uint16_t Reserved2:2; /*!< bit: 6.. 7 Reserved */
__I uint16_t TXRDY:2; /*!< bit: 8.. 9 Transmit Ready x */
__I uint16_t :2; /*!< bit: 10..11 Reserved */
__I uint16_t Reserved3:2; /*!< bit: 10..11 Reserved */
__I uint16_t TXUR:2; /*!< bit: 12..13 Transmit Underrun x */
__I uint16_t :2; /*!< bit: 14..15 Reserved */
__I uint16_t Reserved4:2; /*!< bit: 14..15 Reserved */
} vec; /*!< Structure used for vec access */
uint16_t reg; /*!< Type used for register access */
} I2S_INTFLAG_Type;
Expand Down
2 changes: 1 addition & 1 deletion asf/sam0/include/samd21/component/nvmctrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ typedef union { // __I to avoid read-modify-write on write-to-clear register
struct {
__I uint8_t READY:1; /*!< bit: 0 NVM Ready */
__I uint8_t ERROR:1; /*!< bit: 1 Error */
__I uint8_t :6; /*!< bit: 2.. 7 Reserved */
__I uint8_t Reserved1:6; /*!< bit: 2.. 7 Reserved */
} bit; /*!< Structure used for bit access */
uint8_t reg; /*!< Type used for register access */
} NVMCTRL_INTFLAG_Type;
Expand Down
2 changes: 1 addition & 1 deletion asf/sam0/include/samd21/component/pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ typedef union {
typedef union { // __I to avoid read-modify-write on write-to-clear register
struct {
__I uint8_t CKRDY:1; /*!< bit: 0 Clock Ready */
__I uint8_t :7; /*!< bit: 1.. 7 Reserved */
__I uint8_t Reserved1:7; /*!< bit: 1.. 7 Reserved */
} bit; /*!< Structure used for bit access */
uint8_t reg; /*!< Type used for register access */
} PM_INTFLAG_Type;
Expand Down
12 changes: 6 additions & 6 deletions asf/sam0/include/samd21/component/rtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -614,13 +614,13 @@ typedef union {
typedef union { // __I to avoid read-modify-write on write-to-clear register
struct {
__I uint8_t CMP0:1; /*!< bit: 0 Compare 0 */
__I uint8_t :5; /*!< bit: 1.. 5 Reserved */
__I uint8_t Reserved1:5; /*!< bit: 1.. 5 Reserved */
__I uint8_t SYNCRDY:1; /*!< bit: 6 Synchronization Ready */
__I uint8_t OVF:1; /*!< bit: 7 Overflow */
} bit; /*!< Structure used for bit access */
struct {
__I uint8_t CMP:1; /*!< bit: 0 Compare x */
__I uint8_t :7; /*!< bit: 1.. 7 Reserved */
__I uint8_t Reserved1:7; /*!< bit: 1.. 7 Reserved */
} vec; /*!< Structure used for vec access */
uint8_t reg; /*!< Type used for register access */
} RTC_MODE0_INTFLAG_Type;
Expand All @@ -646,13 +646,13 @@ typedef union { // __I to avoid read-modify-write on write-to-clear register
struct {
__I uint8_t CMP0:1; /*!< bit: 0 Compare 0 */
__I uint8_t CMP1:1; /*!< bit: 1 Compare 1 */
__I uint8_t :4; /*!< bit: 2.. 5 Reserved */
__I uint8_t Reserved1:4; /*!< bit: 2.. 5 Reserved */
__I uint8_t SYNCRDY:1; /*!< bit: 6 Synchronization Ready */
__I uint8_t OVF:1; /*!< bit: 7 Overflow */
} bit; /*!< Structure used for bit access */
struct {
__I uint8_t CMP:2; /*!< bit: 0.. 1 Compare x */
__I uint8_t :6; /*!< bit: 2.. 7 Reserved */
__I uint8_t Reserved1:6; /*!< bit: 2.. 7 Reserved */
} vec; /*!< Structure used for vec access */
uint8_t reg; /*!< Type used for register access */
} RTC_MODE1_INTFLAG_Type;
Expand All @@ -679,13 +679,13 @@ typedef union { // __I to avoid read-modify-write on write-to-clear register
typedef union { // __I to avoid read-modify-write on write-to-clear register
struct {
__I uint8_t ALARM0:1; /*!< bit: 0 Alarm 0 */
__I uint8_t :5; /*!< bit: 1.. 5 Reserved */
__I uint8_t Reserved1:5; /*!< bit: 1.. 5 Reserved */
__I uint8_t SYNCRDY:1; /*!< bit: 6 Synchronization Ready */
__I uint8_t OVF:1; /*!< bit: 7 Overflow */
} bit; /*!< Structure used for bit access */
struct {
__I uint8_t ALARM:1; /*!< bit: 0 Alarm x */
__I uint8_t :7; /*!< bit: 1.. 7 Reserved */
__I uint8_t Reserved1:7; /*!< bit: 1.. 7 Reserved */
} vec; /*!< Structure used for vec access */
uint8_t reg; /*!< Type used for register access */
} RTC_MODE2_INTFLAG_Type;
Expand Down
8 changes: 4 additions & 4 deletions asf/sam0/include/samd21/component/sercom.h
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ typedef union { // __I to avoid read-modify-write on write-to-clear register
struct {
__I uint8_t MB:1; /*!< bit: 0 Master On Bus Interrupt */
__I uint8_t SB:1; /*!< bit: 1 Slave On Bus Interrupt */
__I uint8_t :5; /*!< bit: 2.. 6 Reserved */
__I uint8_t Reserved1:5; /*!< bit: 2.. 6 Reserved */
__I uint8_t ERROR:1; /*!< bit: 7 Combined Error Interrupt */
} bit; /*!< Structure used for bit access */
uint8_t reg; /*!< Type used for register access */
Expand All @@ -852,7 +852,7 @@ typedef union { // __I to avoid read-modify-write on write-to-clear register
__I uint8_t PREC:1; /*!< bit: 0 Stop Received Interrupt */
__I uint8_t AMATCH:1; /*!< bit: 1 Address Match Interrupt */
__I uint8_t DRDY:1; /*!< bit: 2 Data Interrupt */
__I uint8_t :4; /*!< bit: 3.. 6 Reserved */
__I uint8_t Reserved1:4; /*!< bit: 3.. 6 Reserved */
__I uint8_t ERROR:1; /*!< bit: 7 Combined Error Interrupt */
} bit; /*!< Structure used for bit access */
uint8_t reg; /*!< Type used for register access */
Expand Down Expand Up @@ -880,7 +880,7 @@ typedef union { // __I to avoid read-modify-write on write-to-clear register
__I uint8_t TXC:1; /*!< bit: 1 Transmit Complete Interrupt */
__I uint8_t RXC:1; /*!< bit: 2 Receive Complete Interrupt */
__I uint8_t SSL:1; /*!< bit: 3 Slave Select Low Interrupt Flag */
__I uint8_t :3; /*!< bit: 4.. 6 Reserved */
__I uint8_t Reserved1:3; /*!< bit: 4.. 6 Reserved */
__I uint8_t ERROR:1; /*!< bit: 7 Combined Error Interrupt */
} bit; /*!< Structure used for bit access */
uint8_t reg; /*!< Type used for register access */
Expand Down Expand Up @@ -912,7 +912,7 @@ typedef union { // __I to avoid read-modify-write on write-to-clear register
__I uint8_t RXS:1; /*!< bit: 3 Receive Start Interrupt */
__I uint8_t CTSIC:1; /*!< bit: 4 Clear To Send Input Change Interrupt */
__I uint8_t RXBRK:1; /*!< bit: 5 Break Received Interrupt */
__I uint8_t :1; /*!< bit: 6 Reserved */
__I uint8_t Reserved1:1; /*!< bit: 6 Reserved */
__I uint8_t ERROR:1; /*!< bit: 7 Combined Error Interrupt */
} bit; /*!< Structure used for bit access */
uint8_t reg; /*!< Type used for register access */
Expand Down
4 changes: 2 additions & 2 deletions asf/sam0/include/samd21/component/sysctrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@ typedef union { // __I to avoid read-modify-write on write-to-clear register
__I uint32_t BOD33RDY:1; /*!< bit: 9 BOD33 Ready */
__I uint32_t BOD33DET:1; /*!< bit: 10 BOD33 Detection */
__I uint32_t B33SRDY:1; /*!< bit: 11 BOD33 Synchronization Ready */
__I uint32_t :3; /*!< bit: 12..14 Reserved */
__I uint32_t Reserved1:3; /*!< bit: 12..14 Reserved */
__I uint32_t DPLLLCKR:1; /*!< bit: 15 DPLL Lock Rise */
__I uint32_t DPLLLCKF:1; /*!< bit: 16 DPLL Lock Fall */
__I uint32_t DPLLLTO:1; /*!< bit: 17 DPLL Lock Timeout */
__I uint32_t :14; /*!< bit: 18..31 Reserved */
__I uint32_t Reserved2:14; /*!< bit: 18..31 Reserved */
} bit; /*!< Structure used for bit access */
uint32_t reg; /*!< Type used for register access */
} SYSCTRL_INTFLAG_Type;
Expand Down
Loading

0 comments on commit d697369

Please sign in to comment.