объявляются два экземпляра spi по номеру железного spi, по дефолту используется тот, что задан для каждой платы
This commit is contained in:
1 parent
2a561ad0ed
commit
90b42b9fac
6 files changed
+44
-36
No files matched your search
@@ -101,6 +101,7 @@ HAL_TIMER32_CHANNEL_IndexTypeDef pwmPinToTimerChannel(uint32_t digPinNumber);
|
||||
|
||||
// SPI
|
||||
#define SPI_COMMON_QTY 2
|
||||
#define DEFAULT_SPI SPI1
|
||||
|
||||
#define PIN_SPI_SS 10
|
||||
#define PIN_SPI_MOSI 11
|
||||
@@ -111,14 +112,14 @@ static const uint8_t MOSI = PIN_SPI_MOSI;
|
||||
static const uint8_t MISO = PIN_SPI_MISO;
|
||||
static const uint8_t SCK = PIN_SPI_SCK;
|
||||
|
||||
#define PIN_SPI1_SS 9
|
||||
#define PIN_SPI1_MOSI 5
|
||||
#define PIN_SPI1_MISO 3
|
||||
#define PIN_SPI1_SCK 6
|
||||
static const uint8_t SS1 = PIN_SPI1_SS;
|
||||
static const uint8_t MOSI1 = PIN_SPI1_MOSI;
|
||||
static const uint8_t MISO1 = PIN_SPI1_MISO;
|
||||
static const uint8_t SCK1 = PIN_SPI1_SCK;
|
||||
#define PIN_SPI0_SS 9
|
||||
#define PIN_SPI0_MOSI 5
|
||||
#define PIN_SPI0_MISO 3
|
||||
#define PIN_SPI0_SCK 6
|
||||
static const uint8_t SS1 = PIN_SPI0_SS;
|
||||
static const uint8_t MOSI1 = PIN_SPI0_MOSI;
|
||||
static const uint8_t MISO1 = PIN_SPI0_MISO;
|
||||
static const uint8_t SCK1 = PIN_SPI0_SCK;
|
||||
|
||||
// config SEL_NSS1 to replace D10 to different controller pin,
|
||||
// because NSS which is D9/D10 by default is needed to spi
|
||||
|
||||
Reference in new issue
Block a user