forked from Elron_dev/elbear_arduino_bsp
v0.5.1
- в модулях Wire, SPI, Serial приведена в соответствие нумерация используемых экземпляров и периферии микроконтроллера. - в функции analogWrite() перед запуском ШИМ проверяется, не запущен ли уже указанный канал. - добавлена возможность переопределения функции main() в скетчах. - при старте программы задается граница кэшируемой области SPIFI в соответствии с размером текущего исполняемого кода. - исправление выявленных ошибок. Co-authored-by: KLASSENTS <klassen@elron.tech> Co-committed-by: KLASSENTS <klassen@elron.tech>
This commit is contained in:
1 parent
f1e091bf77
commit
eb9b1aa0c9
37 files changed
+248
-156
No files matched your search
@@ -81,6 +81,7 @@ void additionalPinsDeinit(uint32_t PinNumber);
|
||||
// UART
|
||||
// available uarts quantity
|
||||
#define SERIAL_PORT_QTY 2
|
||||
#define DEFAULT_SERIAL Serial0
|
||||
|
||||
// ADC
|
||||
#define MCU_ADC_RESOLUTION 12 // bits
|
||||
@@ -97,7 +98,7 @@ static inline __attribute__((always_inline)) bool digitalPinHasPWM(uint8_t p)
|
||||
return false;
|
||||
}
|
||||
// return true if digitalPin configured as pwm
|
||||
bool digitalPinPwmIsOn(uint8_t digitalPin);
|
||||
int8_t digitalPinPwmIsOn(uint8_t digitalPin);
|
||||
// determines which timer the pin belongs to
|
||||
TIMER32_TypeDef* pwmPinToTimer(uint32_t digPinNumber);
|
||||
// determines which timer channel the pin belongs to
|
||||
@@ -105,6 +106,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
|
||||
@@ -116,14 +118,14 @@ 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 SS0 = PIN_SPI0_SS;
|
||||
static const uint8_t MOSI0 = PIN_SPI0_MOSI;
|
||||
static const uint8_t MISO0 = PIN_SPI0_MISO;
|
||||
static const uint8_t SCK0 = 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
|
||||
@@ -131,9 +133,10 @@ void spi_onBegin(uint8_t spiNum);
|
||||
void spi_onEnd(uint8_t spiNum);
|
||||
|
||||
// I2C
|
||||
#define I2C_COMMON_QTY 1
|
||||
#define DEFAULT_WIRE Wire1 // use I2C1 by default
|
||||
#define PIN_WIRE_SDA 18
|
||||
#define PIN_WIRE_SCL 19
|
||||
#define I2C_COMMON_QTY 1
|
||||
static const uint8_t SDA = PIN_WIRE_SDA;
|
||||
static const uint8_t SCL = PIN_WIRE_SCL;
|
||||
// available frequencies
|
||||
|
||||
Reference in new issue
Block a user