diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2016-06-30 16:16:39 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2016-06-30 16:16:39 +0900 |
commit | e7bd234a0daeff4c16ef80f1529aa1f9dd500697 (patch) | |
tree | 2430db3ff1a03eb62d61e0b64a99389e1a2c6a7d /mcu | |
parent | c71a24ddcb22b8ba5d1fb45d1393838d1110b1b5 (diff) |
Update for MKL27Z
Diffstat (limited to 'mcu')
-rw-r--r-- | mcu/clk_gpio_init-mkl27z.c | 6 | ||||
-rw-r--r-- | mcu/mkl27z.h | 15 | ||||
-rw-r--r-- | mcu/sys-mkl27z.c | 4 | ||||
-rw-r--r-- | mcu/usb-mkl27z.c | 12 |
4 files changed, 19 insertions, 18 deletions
diff --git a/mcu/clk_gpio_init-mkl27z.c b/mcu/clk_gpio_init-mkl27z.c index 894a8ad..d126d94 100644 --- a/mcu/clk_gpio_init-mkl27z.c +++ b/mcu/clk_gpio_init-mkl27z.c @@ -38,7 +38,7 @@ struct MCG { uint8_t reserved2[15]; /* */ volatile uint8_t MC; /* MCG Miscellaneous Control Register */ }; -static struct MCG *const MCG = (struct MCG *const)0x40064000; +static struct MCG *const MCG = (struct MCG *)0x40064000; struct USB_CLK_RECOVER { volatile uint8_t CTRL; /* USB Clock */ @@ -51,7 +51,7 @@ struct USB_CLK_RECOVER { /* interrupt status */ }; static struct USB_CLK_RECOVER *const USB_CLK_RECOVER = - (struct USB_CLK_RECOVER *const)0x40072140; + (struct USB_CLK_RECOVER *)0x40072140; static void __attribute__((used)) clock_init (void) @@ -71,7 +71,7 @@ clock_init (void) SIM->SCGC4 = (1 << 18); /* Enable USB FS clock */ SIM->SCGC5 = (1 << 10); /* Enable Port B clock */ - SIM->SCGC6 = (1 << 25); /* Enable TPM1 clock */ + SIM->SCGC6 = (1 << 25)|1; /* Enable TPM1 clock */ SIM->COPC = 0; /* COP disabled */ /* Crystal-less USB setup. */ diff --git a/mcu/mkl27z.h b/mcu/mkl27z.h index ad3c54c..1ede77f 100644 --- a/mcu/mkl27z.h +++ b/mcu/mkl27z.h @@ -28,7 +28,6 @@ struct SIM { volatile uint32_t COPC; /* COP Control Register */ volatile uint32_t SRVCOP; /* Service COP */ }; -static struct SIM *const SIM = (struct SIM *const)0x40047000; /* Port control. */ struct PORT { @@ -52,9 +51,6 @@ struct PORT { uint32_t reserved[6]; volatile uint32_t ISFR; }; -static struct PORT *const PORTB = (struct PORT *const)0x4004A000; -static struct PORT *const PORTD = (struct PORT *const)0x4004C000; -static struct PORT *const PORTE = (struct PORT *const)0x4004D000; struct GPIO { volatile uint32_t PDOR; /* Port Data Output Register */ @@ -64,6 +60,11 @@ struct GPIO { volatile uint32_t PDIR; /* Port Data Input Register */ volatile uint32_t PDDR; /* Port Data Direction Register */ }; -static struct GPIO *const GPIOB = (struct GPIO *const)0x400FF040; -static struct GPIO *const GPIOD = (struct GPIO *const)0x400FF0C0; -static struct GPIO *const GPIOE = (struct GPIO *const)0x400FF100; + +static struct SIM *const SIM = (struct SIM *)0x40047000; +static struct PORT *const PORTB = (struct PORT *)0x4004A000; +static struct PORT *const PORTD = (struct PORT *)0x4004C000; +static struct PORT *const PORTE = (struct PORT *)0x4004D000; +static struct GPIO *const GPIOB = (struct GPIO *)0x400FF040; +static struct GPIO *const GPIOD = (struct GPIO *)0x400FF0C0; +static struct GPIO *const GPIOE = (struct GPIO *)0x400FF100; diff --git a/mcu/sys-mkl27z.c b/mcu/sys-mkl27z.c index e44e0c2..84b38ab 100644 --- a/mcu/sys-mkl27z.c +++ b/mcu/sys-mkl27z.c @@ -118,7 +118,7 @@ struct FTFA { /* Note: addressing (3,2,1,0). Use Bx macro. */ volatile uint8_t FPROT[4]; }; -static struct FTFA *const FTFA = (struct FTFA *const)0x40020000; +static struct FTFA *const FTFA = (struct FTFA *)0x40020000; #define FSTAT_CCIF 0x80 #define B3 0 @@ -297,7 +297,7 @@ crc32_init (unsigned int *p) } #ifdef ORIGINAL_IN_C -const unsigned int *const crc32_table= (const unsigned int *const)0x00000500; +const unsigned int *const crc32_table= (const unsigned int *)0x00000500; #endif void __attribute__ ((naked,section(".fixed_function.crc32_u8"))) diff --git a/mcu/usb-mkl27z.c b/mcu/usb-mkl27z.c index ae7e8af..2d35385 100644 --- a/mcu/usb-mkl27z.c +++ b/mcu/usb-mkl27z.c @@ -50,12 +50,12 @@ struct USB_CONF { uint8_t rsvd2[3]; /* */ volatile uint8_t ADDINFO; /* Peripheral Additional Info register */ }; -static struct USB_CONF *const USB_CONF = (struct USB_CONF *const) 0x40072000; +static struct USB_CONF *const USB_CONF = (struct USB_CONF *) 0x40072000; struct USB_CTRL0 { volatile uint8_t OTGCTL; /* OTG Control register */ }; -static struct USB_CTRL0 *const USB_CTRL0 = (struct USB_CTRL0 *const)0x4007201c; +static struct USB_CTRL0 *const USB_CTRL0 = (struct USB_CTRL0 *)0x4007201c; struct USB_CTRL1 { volatile uint8_t ISTAT; /* Interrupt Status register */ @@ -82,7 +82,7 @@ struct USB_CTRL1 { uint8_t rsvd15[3]; /* */ volatile uint8_t BDTPAGE3; /* BDT Page Register 3 */ }; -static struct USB_CTRL1 *const USB_CTRL1 = (struct USB_CTRL1 *const)0x40072080; +static struct USB_CTRL1 *const USB_CTRL1 = (struct USB_CTRL1 *)0x40072080; /* Interrupt source bits */ #define USB_IS_STALL (1 << 7) @@ -98,7 +98,7 @@ struct USB_ENDPT { volatile uint8_t EP; /* Endpoint Control register */ uint8_t rsvd17[3]; }; -static struct USB_ENDPT *const USB_ENDPT = (struct USB_ENDPT *const)0x400720c0; +static struct USB_ENDPT *const USB_ENDPT = (struct USB_ENDPT *)0x400720c0; struct USB_CTRL2 { volatile uint8_t USBCTRL; /* USB Control register */ @@ -111,7 +111,7 @@ struct USB_CTRL2 { uint8_t rsvd36[7]; /* */ volatile uint8_t USBFRMADJUST; /* Frame Adjut Register */ }; -static struct USB_CTRL2 *const USB_CTRL2 = (struct USB_CTRL2 *const)0x40072100; +static struct USB_CTRL2 *const USB_CTRL2 = (struct USB_CTRL2 *)0x40072100; /* Buffer Descriptor */ struct BD { @@ -136,7 +136,7 @@ struct BD { extern uint8_t __usb_bdt__; -static struct BD *const BD_table = (struct BD *const)&__usb_bdt__; +static struct BD *const BD_table = (struct BD *)&__usb_bdt__; static void kl27z_usb_init (void) |