dev0.2_halRevision (#1)
- Реализация части функций в библиотеках hal перенесена в заголовочный файл, функции определены как inline. - В модулях Tone, SPI, Wire работа с регистрами вынесена в библиотеку hal или в платозависимые файлы pins_arduino.h, variants.c - В модуле wiring_analog при отключении работы ШИМ сначала проверяется, включен ли ШИМ на указанной ноге. Если включен, вывод после отключения таймера конфигурируется на вход. Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
1 parent
f020720e1f
commit
8f0a5b0a94
17 files changed
+433
-313
No files matched your search
@@ -32,8 +32,6 @@ extern "C" {
|
||||
#include "mik32_hal_gpio.h"
|
||||
#include "mik32_hal_timer32.h"
|
||||
|
||||
extern bool spiNssPinIsBlocked;
|
||||
|
||||
// analog pins
|
||||
#define PIN_A0 (14)
|
||||
#define PIN_A1 (15)
|
||||
@@ -78,6 +76,7 @@ uint32_t analogInputToChannelNumber(uint32_t PinNumber);
|
||||
|
||||
// PWM
|
||||
bool digitalPinHasPWM(uint8_t p);
|
||||
bool digitalPinPwmIsOn(uint8_t digitalPin); // use only if digitalPinHasPWM() == true
|
||||
// determines which timer the pin belongs to
|
||||
TIMER32_TypeDef* pwmPinToTimer(uint32_t digPinNumber);
|
||||
// determines which timer channel the pin belongs to
|
||||
@@ -94,19 +93,13 @@ static const uint8_t MISO = PIN_SPI_MISO;
|
||||
static const uint8_t SCK = PIN_SPI_SCK;
|
||||
// config SEL_NSS1 to replace D10 to different controller pin,
|
||||
// because pin 1.3 which is D10 by default is needed to spi
|
||||
inline void blockSpiPin(void)
|
||||
{
|
||||
spiNssPinIsBlocked = true;
|
||||
}
|
||||
inline void unblockSpiPin(void)
|
||||
{
|
||||
spiNssPinIsBlocked = false;
|
||||
}
|
||||
void spi_onBegin(void);
|
||||
void spi_onEnd(void);
|
||||
|
||||
// I2C
|
||||
#define PIN_WIRE_SDA (18)
|
||||
#define PIN_WIRE_SCL (19)
|
||||
#define I2C_NUM (1) // i2c number 0 or 1
|
||||
#define I2C_NUM (1) // i2c number 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