перенесла лишнее обратно
This commit is contained in:
parent
ac51d0cae1
commit
8093d3a157
@ -31,21 +31,13 @@ extern "C" {
|
||||
|
||||
#include "mik32_hal_gpio.h"
|
||||
#include "mik32_hal_timer32.h"
|
||||
#include "wiring_LL.h"
|
||||
|
||||
void ErrorMsgHandler(const char * msg);
|
||||
|
||||
// total number of pins available for initialization
|
||||
#define PINS_COMMON_QTY 24
|
||||
#define pinCommonQty() (PINS_COMMON_QTY)
|
||||
|
||||
#define SPI0_NSS_OUT_PORT GPIO_1
|
||||
#define SPI0_NSS_OUT_PIN GPIO_PIN_14
|
||||
#define SPI1_NSS_OUT_PORT GPIO_1
|
||||
#define SPI1_NSS_OUT_PIN GPIO_PIN_4
|
||||
extern bool spi0NssPinIsBlocked;
|
||||
extern bool spi1NssPinIsBlocked;
|
||||
extern const HAL_PinsTypeDef digitalPinToGpioPinArray[];
|
||||
|
||||
// analog pins
|
||||
#define PIN_A0 (14)
|
||||
@ -62,7 +54,6 @@ static const uint8_t A3 = PIN_A3;
|
||||
static const uint8_t A4 = PIN_A4;
|
||||
static const uint8_t A5 = PIN_A5;
|
||||
|
||||
|
||||
// digital pins
|
||||
// D0...D13, D18, D19
|
||||
|
||||
@ -93,9 +84,6 @@ uint32_t analogInputToChannelNumber(uint32_t PinNumber);
|
||||
|
||||
// PWM
|
||||
#define PWM_FREQUENCY_MAX 1000000 // Hz
|
||||
// use only if digitalPinHasPWM() == true
|
||||
#define PWM_PIN_TO_PORT_NUMBER(pin) (((pin==10)||(pin==11)||(pin==12)||(pin==13)) ? 1:0)
|
||||
|
||||
static inline __attribute__((always_inline)) bool digitalPinHasPWM(uint8_t p)
|
||||
{
|
||||
// if spi is in use D9 or D10 cannot work as pwm
|
||||
|
||||
@ -14,16 +14,21 @@
|
||||
#include "pins_arduino.h"
|
||||
#include "mik32_hal_adc.h"
|
||||
#include "wiring_analog.h"
|
||||
#include "wiring_LL.h"
|
||||
|
||||
#define SPI0_SWITCH_PORT GPIO_1
|
||||
#define SPI0_SWITCH_PIN GPIO_PIN_10
|
||||
#define SPI0_NSS_IN_PORT GPIO_0
|
||||
#define SPI0_NSS_IN_PIN GPIO_PIN_3
|
||||
#define SPI0_NSS_OUT_PORT GPIO_1
|
||||
#define SPI0_NSS_OUT_PIN GPIO_PIN_14
|
||||
|
||||
#define SPI1_SWITCH_PORT GPIO_1
|
||||
#define SPI1_SWITCH_PIN GPIO_PIN_6
|
||||
#define SPI1_NSS_IN_PORT GPIO_1
|
||||
#define SPI1_NSS_IN_PIN GPIO_PIN_3
|
||||
#define SPI1_NSS_OUT_PORT GPIO_1
|
||||
#define SPI1_NSS_OUT_PIN GPIO_PIN_4
|
||||
|
||||
bool spi0NssPinIsBlocked = false;
|
||||
bool spi1NssPinIsBlocked = false;
|
||||
@ -162,6 +167,9 @@ uint32_t analogInputToChannelNumber(uint32_t PinNumber)
|
||||
}
|
||||
|
||||
// ---------------------- PWM ---------------------- //
|
||||
// use only if digitalPinHasPWM() == true
|
||||
#define PWM_PIN_TO_PORT_NUMBER(pin) (((pin==10)||(pin==11)||(pin==12)||(pin==13)) ? 1:0)
|
||||
|
||||
// return true if digitalPin configured as pwm
|
||||
__attribute__((noinline, section(".ram_text"))) bool digitalPinPwmIsOn(uint8_t digitalPin)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user