aboutsummaryrefslogtreecommitdiffstats
path: root/testex/STM32/STM32F4xx
diff options
context:
space:
mode:
authorRocco Marco Guglielmi <roccomarco.guglielmi@gmail.com>2018-01-14 11:19:39 +0000
committerRocco Marco Guglielmi <roccomarco.guglielmi@gmail.com>2018-01-14 11:19:39 +0000
commitb28c62685d857b55dd8bc7e759a9f93ab0a51632 (patch)
treecc3285cdd4c1b4ec07340784f0c9087efa5c9a02 /testex/STM32/STM32F4xx
parentf6b807fd5a089607a1e21dbcad3c060363650fa1 (diff)
downloadChibiOS-b28c62685d857b55dd8bc7e759a9f93ab0a51632.tar.gz
ChibiOS-b28c62685d857b55dd8bc7e759a9f93ab0a51632.tar.bz2
ChibiOS-b28c62685d857b55dd8bc7e759a9f93ab0a51632.zip
Updated EX demos to be compliant with latest ChibiOS/HAL edit
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11273 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testex/STM32/STM32F4xx')
-rw-r--r--testex/STM32/STM32F4xx/I2C-BMP085/main.c26
-rw-r--r--testex/STM32/STM32F4xx/I2C-HTS221/main.c10
-rw-r--r--testex/STM32/STM32F4xx/I2C-LIS3MLD/main.c16
-rw-r--r--testex/STM32/STM32F4xx/I2C-LPS25H/main.c10
-rw-r--r--testex/STM32/STM32F4xx/I2C-LSM303DLHC/main.c10
-rw-r--r--testex/STM32/STM32F4xx/I2C-LSM6DS0/main.c20
-rw-r--r--testex/STM32/STM32F4xx/SPI-L3GD20/main.c23
-rw-r--r--testex/STM32/STM32F4xx/SPI-LIS302DL/main.c23
-rw-r--r--testex/STM32/STM32F4xx/SPI-LIS3DSH/main.c27
9 files changed, 84 insertions, 81 deletions
diff --git a/testex/STM32/STM32F4xx/I2C-BMP085/main.c b/testex/STM32/STM32F4xx/I2C-BMP085/main.c
index 5f2b657dc..1b1e0533f 100644
--- a/testex/STM32/STM32F4xx/I2C-BMP085/main.c
+++ b/testex/STM32/STM32F4xx/I2C-BMP085/main.c
@@ -46,25 +46,25 @@ static float cookeddata[BMP085_BARO_NUMBER_OF_AXES +
* @brief I2C configuration structure.
*/
static const I2CConfig i2cConfig = {
- OPMODE_I2C, /* I2C inetrface peration mode. */
- 400000, /* I2C interface clock speed. */
- FAST_DUTY_CYCLE_2, /* I2C interface duty cycle mode. */
+ OPMODE_I2C,
+ 400000,
+ FAST_DUTY_CYCLE_2,
};
/**
* @brief BMP085 configuration structure.
*/
static const BMP085Config bmp085Config = {
- &I2CD1, /* I2C Driver pointer. */
- &i2cConfig, /* I2C Driver configuration. */
- NULL, /* Sensibility. */
- NULL, /* bias. */
- NULL, /* Output data rate. */
-#if BMP085_USE_ADVANCED || defined(__DOXYGEN__)
- BMP085_BARO_CT_LOW, /* Pressure conversion time. */
- BMP085_BARO_MODE_LOW, /* BMP085 Mode. */
- BMP085_BARO_OSS_0, /* Oversempling setting. */
- BMP085_THERMO_CT_LOW, /* Temperature conversion time */
+ &I2CD1,
+ &i2cConfig,
+ NULL,
+ NULL,
+ NULL,
+#if BMP085_USE_ADVANCED
+ BMP085_BARO_CT_LOW,
+ BMP085_BARO_MODE_LOW,
+ BMP085_BARO_OSS_0,
+ BMP085_THERMO_CT_LOW,
#endif
};
diff --git a/testex/STM32/STM32F4xx/I2C-HTS221/main.c b/testex/STM32/STM32F4xx/I2C-HTS221/main.c
index 08b82fdd7..f7d2d5925 100644
--- a/testex/STM32/STM32F4xx/I2C-HTS221/main.c
+++ b/testex/STM32/STM32F4xx/I2C-HTS221/main.c
@@ -30,9 +30,9 @@
/* HTS221 Driver: This object represent an HTS221 instance */
static HTS221Driver HTS221D1;
-static int32_t rawdata[HTS221_HYGRO_NUMBER_OF_AXES +
+static int32_t rawdata[HTS221_HYGRO_NUMBER_OF_AXES +
HTS221_THERMO_NUMBER_OF_AXES];
-static float cookeddata[HTS221_HYGRO_NUMBER_OF_AXES +
+static float cookeddata[HTS221_HYGRO_NUMBER_OF_AXES +
HTS221_THERMO_NUMBER_OF_AXES];
static const I2CConfig i2ccfg = {
@@ -44,9 +44,9 @@ static const I2CConfig i2ccfg = {
static const HTS221Config hts221cfg = {
&I2CD1,
&i2ccfg,
- NULL, /* Use default sensitivity.*/
- NULL, /* Use default bias.*/
- HTS221_ODR_7HZ, /* Output data rate 7 Hz.*/
+ NULL,
+ NULL,
+ HTS221_ODR_7HZ,
#if HTS221_USE_ADVANCED || defined(__DOXYGEN__)
HTS221_BDU_CONTINUOUS,
HTS221_AVGH_256,
diff --git a/testex/STM32/STM32F4xx/I2C-LIS3MLD/main.c b/testex/STM32/STM32F4xx/I2C-LIS3MLD/main.c
index 258bf13cc..0d094a3a5 100644
--- a/testex/STM32/STM32F4xx/I2C-LIS3MLD/main.c
+++ b/testex/STM32/STM32F4xx/I2C-LIS3MLD/main.c
@@ -42,14 +42,14 @@ static const I2CConfig i2ccfg = {
};
static LIS3MDLConfig LIS3MDLcfg = {
- &I2CD1, /* Pointer to I2C Driver.*/
- &i2ccfg, /* Pointer to I2C Configuration.*/
- NULL, /* Use default sensitivity.*/
- NULL, /* Use default bias.*/
- LIS3MDL_SAD_VCC, /* Slave address.*/
- LIS3MDL_FS_4GA, /* Full scale value.*/
- LIS3MDL_ODR_40HZ, /* Output data rate.*/
-#if LIS3MDL_USE_ADVANCED || defined(__DOXYGEN__)
+ &I2CD1,
+ &i2ccfg,
+ NULL,
+ NULL,
+ LIS3MDL_SAD_VCC,
+ LIS3MDL_FS_4GA,
+ LIS3MDL_ODR_40HZ,
+#if LIS3MDL_USE_ADVANCED
LIS3MDL_LP_ENABLED,
LIS3MDL_MD_CONTINUOUS,
LIS3MDL_OMXY_LOW_POWER,
diff --git a/testex/STM32/STM32F4xx/I2C-LPS25H/main.c b/testex/STM32/STM32F4xx/I2C-LPS25H/main.c
index 4960708d2..36440e3ac 100644
--- a/testex/STM32/STM32F4xx/I2C-LPS25H/main.c
+++ b/testex/STM32/STM32F4xx/I2C-LPS25H/main.c
@@ -42,11 +42,11 @@ static const I2CConfig i2ccfg = {
static const LPS25HConfig lps25hcfg = {
&I2CD1,
&i2ccfg,
- NULL, /* Use default sensitivity.*/
- NULL, /* Use default bias.*/
- LPS25H_SAD_VCC, /* SA0 connected to VCC */
- LPS25H_ODR_7HZ, /* Output data rate 7 Hz.*/
-#if LPS25H_USE_ADVANCED || defined(__DOXYGEN__)
+ NULL,
+ NULL,
+ LPS25H_SAD_VCC,
+ LPS25H_ODR_7HZ,
+#if LPS25H_USE_ADVANCED
LPS25H_BDU_CONTINUOUS,
LPS25H_AVGP_512,
LPS25H_AVGT_512
diff --git a/testex/STM32/STM32F4xx/I2C-LSM303DLHC/main.c b/testex/STM32/STM32F4xx/I2C-LSM303DLHC/main.c
index b7fa1a455..e8e1f3eaa 100644
--- a/testex/STM32/STM32F4xx/I2C-LSM303DLHC/main.c
+++ b/testex/STM32/STM32F4xx/I2C-LSM303DLHC/main.c
@@ -46,11 +46,11 @@ static const I2CConfig i2ccfg = {
};
static const LSM303DLHCAccConfig lsm303dlhcacccfg = {
- NULL, /* Use default sensitivity.*/
- NULL, /* Use default bias.*/
- LSM303DLHC_ACC_FS_4G, /* Full scale value 2g.*/
- LSM303DLHC_ACC_ODR_100Hz, /* Output data rate 100 Hz.*/
-#if LSM303DLHC_ACC_USE_ADVANCED || defined(__DOXYGEN__)
+ NULL,
+ NULL,
+ LSM303DLHC_ACC_FS_4G,
+ LSM303DLHC_ACC_ODR_100Hz,
+#if LSM303DLHC_ACC_USE_ADVANCED
LSM303DLHC_ACC_LP_DISABLED,
LSM303DLHC_ACC_HR_DISABLED,
LSM303DLHC_ACC_BDU_BLOCK,
diff --git a/testex/STM32/STM32F4xx/I2C-LSM6DS0/main.c b/testex/STM32/STM32F4xx/I2C-LSM6DS0/main.c
index 8c010c36d..d775057ac 100644
--- a/testex/STM32/STM32F4xx/I2C-LSM6DS0/main.c
+++ b/testex/STM32/STM32F4xx/I2C-LSM6DS0/main.c
@@ -44,21 +44,21 @@ static const I2CConfig i2ccfg = {
};
static const LSM6DS0AccConfig lsm6ds0acccfg = {
- NULL, /* Use default sensitivity.*/
- NULL, /* Use default bias.*/
- LSM6DS0_ACC_FS_2G, /* Full scale value 2g.*/
- LSM6DS0_ACC_ODR_50Hz, /* Output data rate 100 Hz.*/
-#if LSM6DS0_ACC_USE_ADVANCED || defined(__DOXYGEN__)
+ NULL,
+ NULL,
+ LSM6DS0_ACC_FS_2G,
+ LSM6DS0_ACC_ODR_50Hz,
+#if LSM6DS0_ACC_USE_ADVANCED
LSM6DS0_ACC_DEC_X4,
#endif
};
static const LSM6DS0GyroConfig lsm6ds0gyrocfg = {
- NULL, /* Use default sensitivity.*/
- NULL, /* Use default bias.*/
- LSM6DS0_GYRO_FS_245DPS, /* Full scale value 245DPS.*/
- LSM6DS0_GYRO_ODR_119HZ_FC_31, /* Output data rate 119 Hz.*/
-#if LSM6DS0_GYRO_USE_ADVANCED || defined(__DOXYGEN__)
+ NULL,
+ NULL,
+ LSM6DS0_GYRO_FS_245DPS,
+ LSM6DS0_GYRO_ODR_119HZ_FC_31,
+#if LSM6DS0_GYRO_USE_ADVANCED
LSM6DS0_GYRO_LP_DISABLED,
LSM6DS0_GYRO_OUT_SEL_0,
LSM6DS0_GYRO_HP_DISABLED,
diff --git a/testex/STM32/STM32F4xx/SPI-L3GD20/main.c b/testex/STM32/STM32F4xx/SPI-L3GD20/main.c
index 2019b99a3..b3aeb583a 100644
--- a/testex/STM32/STM32F4xx/SPI-L3GD20/main.c
+++ b/testex/STM32/STM32F4xx/SPI-L3GD20/main.c
@@ -38,21 +38,22 @@ static char axisID[L3GD20_NUMBER_OF_AXES] = {'X', 'Y', 'Z'};
static uint32_t i;
static const SPIConfig spicfg = {
+ FALSE,
NULL,
- GPIOE, /* port of L3GD20 CS.*/
- GPIOE_L3GD20_CS, /* pin of L3GD20 CS.*/
- SPI_CR1_BR_0 | SPI_CR1_CPOL | SPI_CR1_CPHA,/* CR1 register.*/
- 0 /* CR2 register.*/
+ GPIOE,
+ GPIOE_L3GD20_CS,
+ SPI_CR1_BR_0 | SPI_CR1_CPOL | SPI_CR1_CPHA,
+ 0
};
static L3GD20Config l3gd20cfg = {
- &SPID1, /* Pointer to SPI Driver.*/
- &spicfg, /* Pointer to SPI Configuration.*/
- NULL, /* Use default sensitivity.*/
- NULL, /* Use default bias.*/
- L3GD20_FS_250DPS, /* Full scale value.*/
- L3GD20_ODR_760HZ, /* Output data rate.*/
-#if L3GD20_USE_ADVANCED || defined(__DOXYGEN__)
+ &SPID1,
+ &spicfg,
+ NULL,
+ NULL,
+ L3GD20_FS_250DPS,
+ L3GD20_ODR_760HZ,
+#if L3GD20_USE_ADVANCED
L3GD20_BDU_CONTINUOUS,
L3GD20_END_LITTLE,
L3GD20_BW3,
diff --git a/testex/STM32/STM32F4xx/SPI-LIS302DL/main.c b/testex/STM32/STM32F4xx/SPI-LIS302DL/main.c
index a72814c3d..a831e465d 100644
--- a/testex/STM32/STM32F4xx/SPI-LIS302DL/main.c
+++ b/testex/STM32/STM32F4xx/SPI-LIS302DL/main.c
@@ -38,22 +38,23 @@ static char axisID[LIS302DL_NUMBER_OF_AXES] = {'X', 'Y', 'Z'};
static uint32_t i;
static const SPIConfig spicfg = {
+ FALSE,
NULL,
- GPIOE, /* port of LIS302DL CS.*/
- GPIOE_CS_SPI, /* pin of LIS302DL CS.*/
- SPI_CR1_BR_0 | SPI_CR1_CPOL | SPI_CR1_CPHA,/* CR1 register.*/
- 0 /* CR2 register.*/
+ GPIOE,
+ GPIOE_CS_SPI,
+ SPI_CR1_BR_0 | SPI_CR1_CPOL | SPI_CR1_CPHA,
+ 0
};
static LIS302DLConfig l3gd20cfg = {
- &SPID1, /* Pointer to SPI Driver.*/
- &spicfg, /* Pointer to SPI Configuration.*/
- NULL, /* Use default sensitivity.*/
- NULL, /* Use default bias.*/
- LIS302DL_FS_2G, /* Full scale value.*/
- LIS302DL_ODR_100HZ, /* Output data rate.*/
+ &SPID1,
+ &spicfg,
+ NULL,
+ NULL,
+ LIS302DL_FS_2G,
+ LIS302DL_ODR_100HZ,
#if LIS302DL_USE_ADVANCED || defined(__DOXYGEN__)
- LIS302DL_HP_DISABLED, /* HP filter disabled.*/
+ LIS302DL_HP_DISABLED,
#endif
};
diff --git a/testex/STM32/STM32F4xx/SPI-LIS3DSH/main.c b/testex/STM32/STM32F4xx/SPI-LIS3DSH/main.c
index b3a818137..2bb7799ef 100644
--- a/testex/STM32/STM32F4xx/SPI-LIS3DSH/main.c
+++ b/testex/STM32/STM32F4xx/SPI-LIS3DSH/main.c
@@ -38,23 +38,24 @@ static char axisID[LIS3DSH_NUMBER_OF_AXES] = {'X', 'Y', 'Z'};
static uint32_t i;
static const SPIConfig spicfg = {
+ FALSE,
NULL,
- GPIOE, /* port of LIS3DSH CS.*/
- GPIOE_CS_SPI, /* pin of LIS3DSH CS.*/
- SPI_CR1_BR_0 | SPI_CR1_CPOL | SPI_CR1_CPHA,/* CR1 register.*/
- 0 /* CR2 register.*/
+ GPIOE,
+ GPIOE_CS_SPI,
+ SPI_CR1_BR_0 | SPI_CR1_CPOL | SPI_CR1_CPHA,
+ 0
};
static LIS3DSHConfig lis3dshcfg = {
- &SPID1, /* Pointer to SPI Driver.*/
- &spicfg, /* Pointer to SPI Configuration.*/
- NULL, /* Use default sensitivity.*/
- NULL, /* Use default bias.*/
- LIS3DSH_FS_2G, /* Full scale value.*/
- LIS3DSH_ODR_100HZ, /* Output data rate.*/
-#if LIS3DSH_USE_ADVANCED || defined(__DOXYGEN__)
- LIS3DSH_BW_400HZ, /* AA filter bandwidth.*/
- LIS3DSH_BDU_CONTINUOUS, /* Block data update continuous.*/
+ &SPID1,
+ &spicfg,
+ NULL,
+ NULL,
+ LIS3DSH_FS_2G,
+ LIS3DSH_ODR_100HZ,
+#if LIS3DSH_USE_ADVANCED
+ LIS3DSH_BW_400HZ,
+ LIS3DSH_BDU_CONTINUOUS,
#endif
};