Updated L3GD20 demos in testex demos to be close to the pattern used in testhal demos. Minor changes to field names in L3GD20.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15434 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
Rocco Marco Guglielmi 2022-02-07 10:40:22 +00:00
parent 558d2f4395
commit 501fa46740
5 changed files with 44 additions and 44 deletions

View File

@ -501,7 +501,7 @@ void l3gd20Start(L3GD20Driver *devp, const L3GD20Config *config) {
{ {
cr[0] = L3GD20_CTRL_REG1_XEN | L3GD20_CTRL_REG1_YEN | cr[0] = L3GD20_CTRL_REG1_XEN | L3GD20_CTRL_REG1_YEN |
L3GD20_CTRL_REG1_ZEN | L3GD20_CTRL_REG1_PD | L3GD20_CTRL_REG1_ZEN | L3GD20_CTRL_REG1_PD |
devp->config->gyrooutputdatarate; devp->config->gyroodr;
#if L3GD20_USE_ADVANCED || defined(__DOXYGEN__) #if L3GD20_USE_ADVANCED || defined(__DOXYGEN__)
cr[0] |= devp->config->gyrobandwidth; cr[0] |= devp->config->gyrobandwidth;
#endif #endif
@ -511,7 +511,7 @@ void l3gd20Start(L3GD20Driver *devp, const L3GD20Config *config) {
{ {
#if L3GD20_USE_ADVANCED || defined(__DOXYGEN__) #if L3GD20_USE_ADVANCED || defined(__DOXYGEN__)
if(devp->config->gyrohpmode != L3GD20_HPM_BYPASSED) if(devp->config->gyrohpmode != L3GD20_HPM_BYPASSED)
cr[1] = devp->config->gyrohpmode | devp->config->gyrohpconfiguration; cr[1] = devp->config->gyrohpmode | devp->config->gyrohpcfg;
#endif #endif
} }
@ -519,7 +519,7 @@ void l3gd20Start(L3GD20Driver *devp, const L3GD20Config *config) {
{ {
cr[3] = devp->config->gyrofullscale; cr[3] = devp->config->gyrofullscale;
#if L3GD20_USE_ADVANCED || defined(__DOXYGEN__) #if L3GD20_USE_ADVANCED || defined(__DOXYGEN__)
cr[3] |= devp->config->gyroblockdataupdate | cr[3] |= devp->config->gyrobdu |
devp->config->gyroendianness; devp->config->gyroendianness;
#endif #endif
} }

View File

@ -42,7 +42,7 @@
/** /**
* @brief L3GD20 driver version string. * @brief L3GD20 driver version string.
*/ */
#define EX_L3GD20_VERSION "1.1.2" #define EX_L3GD20_VERSION "1.1.3"
/** /**
* @brief L3GD20 driver version major number. * @brief L3GD20 driver version major number.
@ -57,7 +57,7 @@
/** /**
* @brief L3GD20 driver version patch number. * @brief L3GD20 driver version patch number.
*/ */
#define EX_L3GD20_PATCH 2 #define EX_L3GD20_PATCH 3
/** @} */ /** @} */
/** /**
@ -470,12 +470,12 @@ typedef struct {
/** /**
* @brief L3GD20 gyroscope system output data rate selection. * @brief L3GD20 gyroscope system output data rate selection.
*/ */
l3gd20_odr_t gyrooutputdatarate; l3gd20_odr_t gyroodr;
#if L3GD20_USE_ADVANCED || defined(__DOXYGEN__) #if L3GD20_USE_ADVANCED || defined(__DOXYGEN__)
/** /**
* @brief L3GD20 gyroscope system block data update. * @brief L3GD20 gyroscope system block data update.
*/ */
l3gd20_bdu_t gyroblockdataupdate; l3gd20_bdu_t gyrobdu;
/** /**
* @brief L3GD20 gyroscope system endianness. * @brief L3GD20 gyroscope system endianness.
*/ */
@ -491,7 +491,7 @@ typedef struct {
/** /**
* @brief L3GD20 gyroscope system HP configuration. * @brief L3GD20 gyroscope system HP configuration.
*/ */
l3gd20_hpcf_t gyrohpconfiguration; l3gd20_hpcf_t gyrohpcfg;
/** /**
* @brief L3GD20 gyroscope system LP2 filter mode. * @brief L3GD20 gyroscope system LP2 filter mode.
* @details To activate LP2 HP should be active * @details To activate LP2 HP should be active

View File

@ -45,19 +45,19 @@ static const SPIConfig spicfg = {
}; };
static L3GD20Config l3gd20cfg = { static L3GD20Config l3gd20cfg = {
&SPID1, .spip = &SPID1,
&spicfg, .spicfg = &spicfg,
NULL, .gyrosensitivity = NULL,
NULL, .gyrobias = NULL,
L3GD20_FS_250DPS, .gyrofullscale = L3GD20_FS_250DPS,
L3GD20_ODR_760HZ, .gyroodr = L3GD20_ODR_760HZ,
#if L3GD20_USE_ADVANCED #if L3GD20_USE_ADVANCED
L3GD20_BDU_CONTINUOUS, .gyrobdu = L3GD20_BDU_CONTINUOUS,
L3GD20_END_LITTLE, .gyroendianness = L3GD20_END_LITTLE,
L3GD20_BW3, .gyrobandwidth = L3GD20_BW3,
L3GD20_HPM_REFERENCE, .gyrohpmode = L3GD20_HPM_REFERENCE,
L3GD20_HPCF_8, .gyrohpcfg = L3GD20_HPCF_8,
L3GD20_LP2M_ON, .gyrolp2mode = L3GD20_LP2M_ON
#endif #endif
}; };

View File

@ -46,19 +46,19 @@ static const SPIConfig spicfg = {
}; };
static L3GD20Config l3gd20cfg = { static L3GD20Config l3gd20cfg = {
&SPID1, .spip = &SPID1,
&spicfg, .spicfg = &spicfg,
NULL, .gyrosensitivity = NULL,
NULL, .gyrobias = NULL,
L3GD20_FS_250DPS, .gyrofullscale = L3GD20_FS_250DPS,
L3GD20_ODR_760HZ, .gyroodr = L3GD20_ODR_760HZ,
#if L3GD20_USE_ADVANCED #if L3GD20_USE_ADVANCED
L3GD20_BDU_CONTINUOUS, .gyrobdu = L3GD20_BDU_CONTINUOUS,
L3GD20_END_LITTLE, .gyroendianness = L3GD20_END_LITTLE,
L3GD20_BW3, .gyrobandwidth = L3GD20_BW3,
L3GD20_HPM_REFERENCE, .gyrohpmode = L3GD20_HPM_REFERENCE,
L3GD20_HPCF_8, .gyrohpcfg = L3GD20_HPCF_8,
L3GD20_LP2M_ON, .gyrolp2mode = L3GD20_LP2M_ON
#endif #endif
}; };

View File

@ -45,19 +45,19 @@ static const SPIConfig spicfg = {
}; };
static L3GD20Config l3gd20cfg = { static L3GD20Config l3gd20cfg = {
&SPID2, .spip = &SPID2,
&spicfg, .spicfg = &spicfg,
NULL, .gyrosensitivity = NULL,
NULL, .gyrobias = NULL,
L3GD20_FS_250DPS, .gyrofullscale = L3GD20_FS_250DPS,
L3GD20_ODR_760HZ, .gyroodr = L3GD20_ODR_760HZ,
#if L3GD20_USE_ADVANCED #if L3GD20_USE_ADVANCED
L3GD20_BDU_CONTINUOUS, .gyrobdu = L3GD20_BDU_CONTINUOUS,
L3GD20_END_LITTLE, .gyroendianness = L3GD20_END_LITTLE,
L3GD20_BW3, .gyrobandwidth = L3GD20_BW3,
L3GD20_HPM_REFERENCE, .gyrohpmode = L3GD20_HPM_REFERENCE,
L3GD20_HPCF_8, .gyrohpcfg = L3GD20_HPCF_8,
L3GD20_LP2M_ON, .gyrolp2mode = L3GD20_LP2M_ON
#endif #endif
}; };