1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 12:25:20 +03:00

FIX: SPI Pins, and I2C pins should be configured in config.h (#12484)

* FIX: SPI Pins, and I2C pins should be configured in config.h

* Set defaults to none.
This commit is contained in:
J Blackman 2023-03-09 20:41:34 +11:00 committed by GitHub
parent 5def26485b
commit 8e85029b00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 108 deletions

View file

@ -252,87 +252,3 @@ extern uint8_t _dmaram_end__;
#define USE_TIMER_MGMT
#define USE_TIMER_AF
#ifdef STM32F4
#ifndef I2C1_SCL_PIN
#define I2C1_SCL_PIN PB6
#endif
#ifndef I2C1_SDA_PIN
#define I2C1_SDA_PIN PB7
#endif
#ifndef I2C2_SCL_PIN
#define I2C2_SCL_PIN PB10
#endif
#ifndef I2C2_SDA_PIN
#define I2C2_SDA_PIN PB11
#endif
#ifndef I2C3_SCL_PIN
#define I2C3_SCL_PIN PA8
#endif
#ifndef I2C3_SDA_PIN
#define I2C3_SDA_PIN PC9
#endif
#endif // STM32F4
#ifdef STM32F7
#ifndef I2C1_SCL_PIN
#define I2C1_SCL_PIN PB6
#endif
#ifndef I2C1_SDA_PIN
#define I2C1_SDA_PIN PB7
#endif
#ifndef I2C2_SCL_PIN
#define I2C2_SCL_PIN PB10
#endif
#ifndef I2C2_SDA_PIN
#define I2C2_SDA_PIN PB11
#endif
#ifndef I2C3_SCL_PIN
#define I2C3_SCL_PIN PA8
#endif
#ifndef I2C3_SDA_PIN
#define I2C3_SDA_PIN PB4
#endif
#ifndef I2C4_SCL_PIN
#define I2C4_SCL_PIN PD12
#endif
#ifndef I2C4_SDA_PIN
#define I2C4_SDA_PIN PD13
#endif
#endif // STM32F7
#ifndef SPI1_SCK_PIN
#define SPI1_SCK_PIN PA5
#define SPI1_SDI_PIN PA6
#define SPI1_SDO_PIN PA7
#endif
#ifndef SPI2_SCK_PIN
#define SPI2_SCK_PIN PB13
#define SPI2_SDI_PIN PB14
#define SPI2_SDO_PIN PB15
#endif
#ifndef SPI3_SCK_PIN
#define SPI3_SCK_PIN PB3
#define SPI3_SDI_PIN PB4
#define SPI3_SDO_PIN PB5
#endif
#ifndef SPI4_SCK_PIN
#define SPI4_SCK_PIN NONE
#define SPI4_SDI_PIN NONE
#define SPI4_SDO_PIN NONE
#endif
#ifndef SPI5_SCK_PIN
#define SPI5_SCK_PIN NONE
#define SPI5_SDI_PIN NONE
#define SPI5_SDO_PIN NONE
#endif
#ifndef SPI6_SCK_PIN
#define SPI6_SCK_PIN NONE
#define SPI6_SDI_PIN NONE
#define SPI6_SDO_PIN NONE
#endif

View file

@ -31,6 +31,42 @@
#include "bus_spi.h"
#ifndef SPI1_SCK_PIN
#define SPI1_SCK_PIN NONE
#define SPI1_SDI_PIN NONE
#define SPI1_SDO_PIN NONE
#endif
#ifndef SPI2_SCK_PIN
#define SPI2_SCK_PIN NONE
#define SPI2_SDI_PIN NONE
#define SPI2_SDO_PIN NONE
#endif
#ifndef SPI3_SCK_PIN
#define SPI3_SCK_PIN NONE
#define SPI3_SDI_PIN NONE
#define SPI3_SDO_PIN NONE
#endif
#ifndef SPI4_SCK_PIN
#define SPI4_SCK_PIN NONE
#define SPI4_SDI_PIN NONE
#define SPI4_SDO_PIN NONE
#endif
#ifndef SPI5_SCK_PIN
#define SPI5_SCK_PIN NONE
#define SPI5_SDI_PIN NONE
#define SPI5_SDO_PIN NONE
#endif
#ifndef SPI6_SCK_PIN
#define SPI6_SCK_PIN NONE
#define SPI6_SDI_PIN NONE
#define SPI6_SDO_PIN NONE
#endif
typedef struct spiDefaultConfig_s {
SPIDevice device;
ioTag_t sck;

View file

@ -39,6 +39,14 @@
#define FLASH_CS_PIN NONE
#endif
#ifndef FLASH_SPI_INSTANCE
#define FLASH_SPI_INSTANCE NULL
#endif
#ifndef FLASH_QUADSPI_INSTANCE
#define FLASH_QUADSPI_INSTANCE NULL
#endif
PG_REGISTER_WITH_RESET_FN(flashConfig_t, flashConfig, PG_FLASH_CONFIG, 0);
void pgResetFn_flashConfig(flashConfig_t *flashConfig)

View file

@ -24,30 +24,6 @@
#define DEBUG_MODE DEBUG_NONE
#endif
// pg/flash
#ifdef USE_FLASH_M25P16
#ifndef FLASH_CS_PIN
#define FLASH_CS_PIN NONE
#endif
#ifndef FLASH_SPI_INSTANCE
#define FLASH_SPI_INSTANCE NULL
#endif
#endif
// pg/flash
#ifdef USE_FLASH_M25P16
#ifndef FLASH_CS_PIN
#define FLASH_CS_PIN NONE
#endif
#ifndef FLASH_SPI_INSTANCE
#define FLASH_SPI_INSTANCE NULL
#endif
#endif
#ifndef I2C1_CLOCKSPEED
#define I2C1_CLOCKSPEED 800
#endif