mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 06:03:33 +08:00
clean up, change SPI2 clock back to 12MHz and remove debug prints
This commit is contained in:
committed by
Lorenz Meier
parent
ab71af6053
commit
ecbcfe838b
@@ -122,14 +122,18 @@ __BEGIN_DECLS
|
||||
#define PX4_SPI_BUS_RAMTRON 2
|
||||
|
||||
/* Use these in place of the spi_dev_e enumeration to select a specific SPI device on SPI1 */
|
||||
//#define PX4_SPIDEV_FRAM 0
|
||||
#define PX4_SPIDEV_GYRO 1
|
||||
#define PX4_SPIDEV_ACCEL_MAG 2
|
||||
#define PX4_SPIDEV_BARO 3
|
||||
#define PX4_SPIDEV_MPU 4
|
||||
#define PX4_SPIDEV_HMC 5
|
||||
#define PX4_SPIDEV_ICM 6
|
||||
|
||||
/* onboard MS5611 and FRAM are both on bus SPI2
|
||||
* spi_dev_e:SPIDEV_FLASH has the value 2 and is used in the NuttX ramtron driver
|
||||
* use 3 for the barometer to differentiate
|
||||
*/
|
||||
#define PX4_SPIDEV_BARO 3
|
||||
|
||||
/* I2C busses */
|
||||
#define PX4_I2C_BUS_EXPANSION 1
|
||||
#define PX4_I2C_BUS_LED PX4_I2C_BUS_EXPANSION
|
||||
|
||||
@@ -301,11 +301,12 @@ __EXPORT int nsh_archinitialize(void)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Default SPI2 to 37.5 MHz (40 MHz rounded to nearest valid divider, F4 max)
|
||||
* and de-assert the known chip selects. */
|
||||
/* Default SPI2 to 12MHz and de-assert the known chip selects.
|
||||
* MS5611 has max SPI clock speed of 20MHz
|
||||
*/
|
||||
|
||||
// XXX start with 10.4 MHz in FRAM usage and go up to 37.5 once validated
|
||||
SPI_SETFREQUENCY(spi2, 1 * 1000 * 1000);
|
||||
// XXX start with 10.4 MHz and go up to 20 once validated
|
||||
SPI_SETFREQUENCY(spi2, 12 * 1000 * 1000);
|
||||
SPI_SETBITS(spi2, 8);
|
||||
SPI_SETMODE(spi2, SPIDEV_MODE3);
|
||||
SPI_SELECT(spi2, SPIDEV_FLASH, false);
|
||||
|
||||
Reference in New Issue
Block a user