diff options
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/platforms/SPC563Mxx/hal_lld.c | 3 | ||||
-rw-r--r-- | os/hal/platforms/SPC563Mxx/hal_lld.h | 16 | ||||
-rw-r--r-- | os/hal/platforms/SPC564Axx/hal_lld.c | 3 | ||||
-rw-r--r-- | os/hal/platforms/SPC564Axx/hal_lld.h | 16 |
4 files changed, 38 insertions, 0 deletions
diff --git a/os/hal/platforms/SPC563Mxx/hal_lld.c b/os/hal/platforms/SPC563Mxx/hal_lld.c index 22979e61b..5eb36bdd4 100644 --- a/os/hal/platforms/SPC563Mxx/hal_lld.c +++ b/os/hal/platforms/SPC563Mxx/hal_lld.c @@ -95,6 +95,9 @@ void hal_lld_init(void) { INTC.CPR.R = 0;
INTC.IACKR.R = (uint32_t)_vectors;
+ /* eMIOS initialization.*/
+ EMIOS.MCR.R = (1U << 26) | SPC5_EMIOS_GPRE; /* GPREN and GPRE. */
+
/* EDMA initialization.*/
edmaInit();
}
diff --git a/os/hal/platforms/SPC563Mxx/hal_lld.h b/os/hal/platforms/SPC563Mxx/hal_lld.h index eec53fd5a..705b94201 100644 --- a/os/hal/platforms/SPC563Mxx/hal_lld.h +++ b/os/hal/platforms/SPC563Mxx/hal_lld.h @@ -169,6 +169,13 @@ BIUCR_BFEN)
#endif
+/**
+ * @brief eMIOS global prescaler value.
+ */
+#if !defined(SPC5_EMIOS_GPRE_VALUE) || defined(__DOXYGEN__)
+#define SPC5_EMIOS_GPRE_VALUE 20
+#endif
+
/*===========================================================================*/
/* Derived constants and error checks. */
/*===========================================================================*/
@@ -193,6 +200,10 @@ #error "invalid SPC5_CLK_RFD value specified"
#endif
+#if (SPC5_EMIOS_GPRE_VALUE < 1) || (SPC5_EMIOS_GPRE_VALUE > 256)
+#error "invalid SPC5_EMIOS_GPRE_VALUE value specified"
+#endif
+
/**
* @brief PLL input divider.
*/
@@ -239,6 +250,11 @@ #define SPC5_FLASH_WS (BIUCR_APC_3 | BIUCR_RWSC_3 | BIUCR_WWSC_1)
#endif
+/**
+ * @brief eMIOS global prescaler setting.
+ */
+#define SPC5_EMIOS_GPRE (SPC5_EMIOS_GPRE_VALUE << 8)
+
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/
diff --git a/os/hal/platforms/SPC564Axx/hal_lld.c b/os/hal/platforms/SPC564Axx/hal_lld.c index f6b220c85..4c665ee25 100644 --- a/os/hal/platforms/SPC564Axx/hal_lld.c +++ b/os/hal/platforms/SPC564Axx/hal_lld.c @@ -107,6 +107,9 @@ void hal_lld_init(void) { INTC.CPR.R = 0;
INTC.IACKR.R = (uint32_t)_vectors;
+ /* eMIOS initialization.*/
+ EMIOS.MCR.R = (1U << 26) | SPC5_EMIOS_GPRE; /* GPREN and GPRE. */
+
/* EDMA initialization.*/
edmaInit();
}
diff --git a/os/hal/platforms/SPC564Axx/hal_lld.h b/os/hal/platforms/SPC564Axx/hal_lld.h index 62df1df45..093400f7b 100644 --- a/os/hal/platforms/SPC564Axx/hal_lld.h +++ b/os/hal/platforms/SPC564Axx/hal_lld.h @@ -169,6 +169,13 @@ BIUCR_BFEN)
#endif
+/**
+ * @brief eMIOS global prescaler value.
+ */
+#if !defined(SPC5_EMIOS_GPRE_VALUE) || defined(__DOXYGEN__)
+#define SPC5_EMIOS_GPRE_VALUE 20
+#endif
+
/*===========================================================================*/
/* Derived constants and error checks. */
/*===========================================================================*/
@@ -193,6 +200,10 @@ #error "invalid SPC5_CLK_RFD value specified"
#endif
+#if (SPC5_EMIOS_GPRE_VALUE < 1) || (SPC5_EMIOS_GPRE_VALUE > 256)
+#error "invalid SPC5_EMIOS_GPRE_VALUE value specified"
+#endif
+
/**
* @brief PLL input divider.
*/
@@ -250,6 +261,11 @@ #define SPC5_RAM_WS 0x40000000
#endif
+/**
+ * @brief eMIOS global prescaler setting.
+ */
+#define SPC5_EMIOS_GPRE (SPC5_EMIOS_GPRE_VALUE << 8)
+
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/
|