From da222425624bb69f447ccaf24b3dca9dba77c530 Mon Sep 17 00:00:00 2001 From: Luke Morrison <159263818+lmorrisonnautel@users.noreply.github.com> Date: Wed, 15 May 2024 16:57:10 -0300 Subject: [PATCH] iox128a1u.h: Update bitmasks for USB clocking options The option to synchronize the 32MHz internal oscillator calibration to the USB start-of-frame bit was missing. The option to set the USB clock source to the (over-clocked) 32MHz internal oscillator was missing. The bit to enable the USB clock source was misspelled compared to the name given in the datasheet. --- include/avr/iox128a1u.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/avr/iox128a1u.h b/include/avr/iox128a1u.h index 54f460c1..74ddf46c 100644 --- a/include/avr/iox128a1u.h +++ b/include/avr/iox128a1u.h @@ -258,6 +258,7 @@ typedef enum CLK_USBPSDIV_enum typedef enum CLK_USBSRC_enum { CLK_USBSRC_PLL_gc = (0x00<<1), /* PLL */ + CLK_USBSRC_RC32M_gc = (0x01<<1), /* Internal 32 MHz RC Oscillator */ } CLK_USBSRC_t; @@ -341,6 +342,7 @@ typedef enum OSC_RC32MCREF_enum { OSC_RC32MCREF_RC32K_gc = (0x00<<1), /* Internal 32.768 kHz RC Oscillator */ OSC_RC32MCREF_XOSC32_gc = (0x01<<1), /* External 32.768 kHz Crystal Oscillator */ + OSC_RC32MCREF_USBSOF_gc = (0x02<<1), /* USB Start of Frame */ } OSC_RC32MCREF_t; @@ -4209,8 +4211,8 @@ typedef struct NVM_PROD_SIGNATURES_struct #define CLK_USBSRC1_bm (1<<2) /* Clock Source bit 1 mask. */ #define CLK_USBSRC1_bp 2 /* Clock Source bit 1 position. */ -#define CLK_USBEN_bm 0x01 /* Clock Source Enable bit mask. */ -#define CLK_USBEN_bp 0 /* Clock Source Enable bit position. */ +#define CLK_USBSEN_bm 0x01 /* Clock Source Enable bit mask. */ +#define CLK_USBSEN_bp 0 /* Clock Source Enable bit position. */ /* PR.PRGEN bit masks and bit positions */