diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-01-10 13:36:09 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-01-10 13:36:09 +0000 |
commit | a8693baa481e1c4d91379af08bbc9f459b1b4d56 (patch) | |
tree | 190b755173b3e2159025260994a1d3208241ab4c /testhal/STM32/multi/SPI | |
parent | 0da6de11ee208137162df9206b3b5731e2980d28 (diff) | |
download | ChibiOS-a8693baa481e1c4d91379af08bbc9f459b1b4d56.tar.gz ChibiOS-a8693baa481e1c4d91379af08bbc9f459b1b4d56.tar.bz2 ChibiOS-a8693baa481e1c4d91379af08bbc9f459b1b4d56.zip |
SPIv1 and SPIv2 circular mode added. Rework of RCC files and all dependencies inside STM32 drivers. Documentation fixes in some HAL modules.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11247 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32/multi/SPI')
7 files changed, 64 insertions, 4 deletions
diff --git a/testhal/STM32/multi/SPI/cfg-stm32f091_nucleo64/portab.c b/testhal/STM32/multi/SPI/cfg-stm32f091_nucleo64/portab.c index 8c5f7426e..7b2b98439 100644 --- a/testhal/STM32/multi/SPI/cfg-stm32f091_nucleo64/portab.c +++ b/testhal/STM32/multi/SPI/cfg-stm32f091_nucleo64/portab.c @@ -34,10 +34,25 @@ /* Module exported variables. */
/*===========================================================================*/
+void spi_circular_cb(SPIDriver *spip);
+
+/*
+ * Circular SPI configuration (18MHz, CPHA=0, CPOL=0, MSb first).
+ */
+const SPIConfig c_spicfg = {
+ true,
+ spi_circular_cb,
+ GPIOB,
+ 12,
+ 0,
+ SPI_CR2_DS_2 | SPI_CR2_DS_1 | SPI_CR2_DS_0
+};
+
/*
* Maximum speed SPI configuration (18MHz, CPHA=0, CPOL=0, MSb first).
*/
const SPIConfig hs_spicfg = {
+ false,
NULL,
GPIOB,
12,
@@ -49,6 +64,7 @@ const SPIConfig hs_spicfg = { * Low speed SPI configuration (140.625kHz, CPHA=0, CPOL=0, MSb first).
*/
const SPIConfig ls_spicfg = {
+ false,
NULL,
GPIOB,
12,
diff --git a/testhal/STM32/multi/SPI/cfg-stm32f091_nucleo64/portab.h b/testhal/STM32/multi/SPI/cfg-stm32f091_nucleo64/portab.h index 3283d07a9..fee7874b7 100644 --- a/testhal/STM32/multi/SPI/cfg-stm32f091_nucleo64/portab.h +++ b/testhal/STM32/multi/SPI/cfg-stm32f091_nucleo64/portab.h @@ -33,6 +33,8 @@ //#define PORTAB_LINE_LED2
#define PORTAB_LED_OFF PAL_LOW
#define PORTAB_LED_ON PAL_HIGH
+#define PORTAB_LINE_BUTTON LINE_BUTTON
+#define PORTAB_BUTTON_PRESSED PAL_HIGH
#define PORTAB_SPI1 SPID2
@@ -56,6 +58,7 @@ /* External declarations. */
/*===========================================================================*/
+extern const SPIConfig c_spicfg;
extern const SPIConfig hs_spicfg;
extern const SPIConfig ls_spicfg;
diff --git a/testhal/STM32/multi/SPI/cfg-stm32f303_discovery/portab.c b/testhal/STM32/multi/SPI/cfg-stm32f303_discovery/portab.c index 0cc734175..e5a3687bc 100644 --- a/testhal/STM32/multi/SPI/cfg-stm32f303_discovery/portab.c +++ b/testhal/STM32/multi/SPI/cfg-stm32f303_discovery/portab.c @@ -33,10 +33,25 @@ /* Module exported variables. */
/*===========================================================================*/
+void spi_circular_cb(SPIDriver *spip);
+
+/*
+ * Circular SPI configuration (18MHz, CPHA=0, CPOL=0, MSb first).
+ */
+const SPIConfig c_spicfg = {
+ true,
+ spi_circular_cb,
+ GPIOB,
+ 12,
+ 0,
+ SPI_CR2_DS_2 | SPI_CR2_DS_1 | SPI_CR2_DS_0
+};
+
/*
* Maximum speed SPI configuration (18MHz, CPHA=0, CPOL=0, MSb first).
*/
const SPIConfig hs_spicfg = {
+ false,
NULL,
GPIOB,
12,
@@ -48,6 +63,7 @@ const SPIConfig hs_spicfg = { * Low speed SPI configuration (140.625kHz, CPHA=0, CPOL=0, MSb first).
*/
const SPIConfig ls_spicfg = {
+ false,
NULL,
GPIOB,
12,
diff --git a/testhal/STM32/multi/SPI/cfg-stm32f303_discovery/portab.h b/testhal/STM32/multi/SPI/cfg-stm32f303_discovery/portab.h index 4840cf265..01344c9d8 100644 --- a/testhal/STM32/multi/SPI/cfg-stm32f303_discovery/portab.h +++ b/testhal/STM32/multi/SPI/cfg-stm32f303_discovery/portab.h @@ -29,11 +29,14 @@ /* Module constants. */
/*===========================================================================*/
-#define PORTAB_LINE_LED1 LINE_LED10_RED
-//#define PORTAB_LINE_LED2 LINE_LED3_RED
+#define PORTAB_LINE_LED1 LINE_LED4_BLUE
+#define PORTAB_LINE_LED2 LINE_LED3_RED
#define PORTAB_LED_OFF PAL_LOW
#define PORTAB_LED_ON PAL_HIGH
+#define PORTAB_LINE_BUTTON LINE_BUTTON
+#define PORTAB_BUTTON_PRESSED PAL_HIGH
+
#define PORTAB_SPI1 SPID1
/*===========================================================================*/
@@ -56,6 +59,7 @@ /* External declarations. */
/*===========================================================================*/
+extern const SPIConfig c_spicfg;
extern const SPIConfig hs_spicfg;
extern const SPIConfig ls_spicfg;
diff --git a/testhal/STM32/multi/SPI/cfg-stm32f407_discovery/portab.c b/testhal/STM32/multi/SPI/cfg-stm32f407_discovery/portab.c index 89a3a439f..02ff7047b 100644 --- a/testhal/STM32/multi/SPI/cfg-stm32f407_discovery/portab.c +++ b/testhal/STM32/multi/SPI/cfg-stm32f407_discovery/portab.c @@ -34,10 +34,25 @@ /* Module exported variables. */
/*===========================================================================*/
+void spi_circular_cb(SPIDriver *spip);
+
+/*
+ * Circular SPI configuration (21MHz, CPHA=0, CPOL=0, MSb first).
+ */
+const SPIConfig c_spicfg = {
+ true,
+ spi_circular_cb,
+ GPIOB,
+ 12,
+ 0,
+ 0
+};
+
/*
* Maximum speed SPI configuration (21MHz, CPHA=0, CPOL=0, MSb first).
*/
const SPIConfig hs_spicfg = {
+ false,
NULL,
GPIOB,
12,
@@ -49,6 +64,7 @@ const SPIConfig hs_spicfg = { * Low speed SPI configuration (328.125kHz, CPHA=0, CPOL=0, MSb first).
*/
const SPIConfig ls_spicfg = {
+ false,
NULL,
GPIOB,
12,
diff --git a/testhal/STM32/multi/SPI/cfg-stm32f407_discovery/portab.h b/testhal/STM32/multi/SPI/cfg-stm32f407_discovery/portab.h index cb2e2d1e3..73293a0cf 100644 --- a/testhal/STM32/multi/SPI/cfg-stm32f407_discovery/portab.h +++ b/testhal/STM32/multi/SPI/cfg-stm32f407_discovery/portab.h @@ -29,11 +29,14 @@ /* Module constants. */
/*===========================================================================*/
-#define PORTAB_LINE_LED1 LINE_LED5
-//#define PORTAB_LINE_LED2
+#define PORTAB_LINE_LED1 LINE_LED3
+#define PORTAB_LINE_LED2 LINE_LED4
#define PORTAB_LED_OFF PAL_LOW
#define PORTAB_LED_ON PAL_HIGH
+#define PORTAB_LINE_BUTTON LINE_BUTTON
+#define PORTAB_BUTTON_PRESSED PAL_HIGH
+
#define PORTAB_SPI1 SPID2
/*===========================================================================*/
@@ -56,6 +59,7 @@ /* External declarations. */
/*===========================================================================*/
+extern const SPIConfig c_spicfg;
extern const SPIConfig hs_spicfg;
extern const SPIConfig ls_spicfg;
diff --git a/testhal/STM32/multi/SPI/cfg-stm32h743_nucleo144/portab.h b/testhal/STM32/multi/SPI/cfg-stm32h743_nucleo144/portab.h index b36241ad9..b60b8584e 100644 --- a/testhal/STM32/multi/SPI/cfg-stm32h743_nucleo144/portab.h +++ b/testhal/STM32/multi/SPI/cfg-stm32h743_nucleo144/portab.h @@ -35,6 +35,7 @@ #define PORTAB_LED_ON PAL_HIGH
#define PORTAB_LINE_BUTTON LINE_BUTTON
#define PORTAB_BUTTON_PRESSED PAL_HIGH
+
#define PORTAB_SPI1 SPID1
/*===========================================================================*/
|