aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/STM32L0xx
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/STM32/STM32L0xx')
-rw-r--r--os/hal/ports/STM32/STM32L0xx/hal_lld.c2
-rw-r--r--os/hal/ports/STM32/STM32L0xx/stm32_rcc.h40
2 files changed, 41 insertions, 1 deletions
diff --git a/os/hal/ports/STM32/STM32L0xx/hal_lld.c b/os/hal/ports/STM32/STM32L0xx/hal_lld.c
index a0766c9a0..d4d625aad 100644
--- a/os/hal/ports/STM32/STM32L0xx/hal_lld.c
+++ b/os/hal/ports/STM32/STM32L0xx/hal_lld.c
@@ -150,7 +150,7 @@ OSAL_IRQ_HANDLER(STM32_DMA1_CH4567_HANDLER) {
*/
void hal_lld_init(void) {
- /* Reset of all peripherals.*/
+ /* Reset of all peripherals except those on IOP.*/
rccResetAHB(~RCC_AHBRSTR_MIFRST);
rccResetAPB1(~RCC_APB1RSTR_PWRRST);
rccResetAPB2(~0);
diff --git a/os/hal/ports/STM32/STM32L0xx/stm32_rcc.h b/os/hal/ports/STM32/STM32L0xx/stm32_rcc.h
index 5396fe1b1..ff76739dd 100644
--- a/os/hal/ports/STM32/STM32L0xx/stm32_rcc.h
+++ b/os/hal/ports/STM32/STM32L0xx/stm32_rcc.h
@@ -170,6 +170,46 @@
RCC->AHBRSTR |= (mask); \
RCC->AHBRSTR = 0; \
}
+
+/**
+ * @brief Enables the clock of one or more peripheral on the IOP bus.
+ *
+ * @param[in] mask IOP peripherals mask
+ * @param[in] lp low power enable flag
+ *
+ * @api
+ */
+#define rccEnableIOP(mask, lp) { \
+ RCC->IOPENR |= (mask); \
+ if (lp) \
+ RCC->IOPSMENR |= (mask); \
+}
+
+/**
+ * @brief Disables the clock of one or more peripheral on the IOP bus.
+ *
+ * @param[in] mask IOP peripherals mask
+ * @param[in] lp low power enable flag
+ *
+ * @api
+ */
+#define rccDisableIOP(mask, lp) { \
+ RCC->IOPENR &= ~(mask); \
+ if (lp) \
+ RCC->IOPSMENR &= ~(mask); \
+}
+
+/**
+ * @brief Resets one or more peripheral on the IOP bus.
+ *
+ * @param[in] mask IOP peripherals mask
+ *
+ * @api
+ */
+#define rccResetIOP(mask) { \
+ RCC->IOPRSTR |= (mask); \
+ RCC->IOPRSTR = 0; \
+}
/** @} */
/**