Page 1 of 1

Contrib: RCC controls for CRC

Posted: Sun Nov 20, 2016 1:02 pm
by kimmoli
Using Hardware CRC from Chibios-Contrib needs rcc control functions for CRC peripheral. These are missing from stm32_rcc.

< barthess> kimmoli: there is no place for RCC stuff in contrib. Create topic on forum with patch attached.


Propsed patch will add them:
https://github.com/kimmoli/ChibiOS/comm ... 7d6fcc0951

Code: Select all

diff --git a/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h b/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h
index 6f3e269..4de320c 100644
--- a/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h
+++ b/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h
@@ -1551,6 +1551,36 @@
 /** @} */

 /**
+ * @name    CRC peripheral specific RCC operations
+ * @{
+ */
+/**
+ * @brief   Enables the CRC peripheral clock.
+ *
+ * @param[in] lp        low power enable flag
+ *
+ * @api
+ */
+#define rccEnableCRC(lp) rccEnableAHB1(RCC_AHB1ENR_CRCEN, lp)
+
+/**
+ * @brief   Disables the CRC peripheral clock.
+ *
+ * @param[in] lp        low power enable flag
+ *
+ * @api
+ */
+#define rccDisableCRC(lp) rccDisableAHB1(RCC_AHB1ENR_CRCEN, lp)
+
+/**
+ * @brief   Resets the CRC peripheral.
+ *
+ * @api
+ */
+#define rccResetCRC() rccResetAHB1(RCC_AHB1RSTR_CRCRST)
+/** @} */
+
+/**
  * @name    FSMC peripherals specific RCC operations
  * @{
  */

Re: Contrib: RCC controls for CRC

Posted: Sun Nov 20, 2016 5:15 pm
by RoccoMarco
Thanks, I will take a look.

Re: Contrib: RCC controls for CRC

Posted: Wed Dec 21, 2016 10:10 pm
by RoccoMarco
Bumped

Re: Contrib: RCC controls for CRC

Posted: Mon Mar 20, 2017 1:54 pm
by kimmoli
bump

Re: Contrib: RCC controls for CRC

Posted: Mon Mar 20, 2017 3:28 pm
by Giovanni
Don't worry, posts in this forum are always considered unless marked "done" :)

Giovanni

Re: Contrib: RCC controls for CRC

Posted: Sun Apr 09, 2017 7:54 am
by Giovanni
Is this change F4-specific?

Giovanni

Re: Contrib: RCC controls for CRC

Posted: Tue Apr 25, 2017 9:17 am
by Giovanni
Added to the F4 only for the time being.

Giovanni