Updated 6500 to run at 5.25mhz (rated to 8mhz)
This commit is contained in:
parent
d4037e05e4
commit
737510062d
|
@ -72,11 +72,7 @@ static void mpu6500SpiInit(void)
|
|||
IOInit(mpuSpi6500CsPin, OWNER_SYSTEM, RESOURCE_SPI);
|
||||
IOConfigGPIO(mpuSpi6500CsPin, SPI_IO_CS_CFG);
|
||||
|
||||
#if defined(STM32F4)
|
||||
spiSetDivisor(MPU6500_SPI_INSTANCE, SPI_SLOW_CLOCK);
|
||||
#else
|
||||
spiSetDivisor(MPU6500_SPI_INSTANCE, SPI_STANDARD_CLOCK);
|
||||
#endif
|
||||
|
||||
hardwareInitialised = true;
|
||||
}
|
||||
|
|
|
@ -26,31 +26,28 @@
|
|||
#include "io.h"
|
||||
#include "rcc.h"
|
||||
|
||||
#if defined(STM32F40_41xxx) || defined (STM32F411xE) || defined(STM32F303xC)
|
||||
#if defined(STM32F4) || defined(STM32F3)
|
||||
#define SPI_IO_AF_CFG IO_CONFIG(GPIO_Mode_AF, GPIO_Speed_50MHz, GPIO_OType_PP, GPIO_PuPd_NOPULL)
|
||||
#define SPI_IO_AF_SCK_CFG IO_CONFIG(GPIO_Mode_AF, GPIO_Speed_50MHz, GPIO_OType_PP, GPIO_PuPd_DOWN)
|
||||
#define SPI_IO_AF_MISO_CFG IO_CONFIG(GPIO_Mode_AF, GPIO_Speed_50MHz, GPIO_OType_PP, GPIO_PuPd_UP)
|
||||
#define SPI_IO_CS_CFG IO_CONFIG(GPIO_Mode_OUT, GPIO_Speed_50MHz, GPIO_OType_PP, GPIO_PuPd_NOPULL)
|
||||
#elif defined(STM32F10X)
|
||||
#elif defined(STM32F1)
|
||||
#define SPI_IO_AF_CFG IO_CONFIG(GPIO_Mode_AF_OD, GPIO_Speed_50MHz)
|
||||
#define SPI_IO_CS_CFG IO_CONFIG(GPIO_Mode_Out_OD, GPIO_Speed_50MHz)
|
||||
#else
|
||||
#error "Unknown processor"
|
||||
#endif
|
||||
#if defined(STM32F40_41xxx) || defined (STM32F411xE)
|
||||
|
||||
#if defined(STM32F4)
|
||||
#define SPI_SLOW_CLOCK 128 //00.65625 MHz
|
||||
#define SPI_STANDARD_CLOCK 8 //11.50000 MHz
|
||||
#define SPI_STANDARD_CLOCK 32 //05.25000 MHz
|
||||
#define SPI_FAST_CLOCK 4 //21.00000 MHz
|
||||
#define SPI_ULTRAFAST_CLOCK 2 //42.00000 MHz
|
||||
|
||||
#else
|
||||
|
||||
#define SPI_SLOW_CLOCK 128 //00.56250 MHz
|
||||
#define SPI_STANDARD_CLOCK 4 //09.00000 MHz
|
||||
#define SPI_FAST_CLOCK 2 //18.00000 MHz
|
||||
#define SPI_ULTRAFAST_CLOCK 2 //18.00000 MHz
|
||||
|
||||
#endif
|
||||
|
||||
typedef enum SPIDevice {
|
||||
|
|
Loading…
Reference in New Issue