функции для spi сделала inline пустыми

This commit is contained in:
klassents 2024-12-20 16:38:35 +07:00
parent 81afaffee8
commit 5913211b5e
2 changed files with 16 additions and 27 deletions

View File

@ -97,9 +97,9 @@ static const uint8_t A7 = PIN_A7;
// User led and button // User led and button
#define LED_BUILTIN (P0_3)
#define LED_BUILTIN0 (P0_3) #define LED_BUILTIN0 (P0_3)
#define LED_BUILTIN1 (P1_3) #define LED_BUILTIN1 (P1_3)
#define LED_BUILTIN LED_BUILTIN0
#define BTN_BUILTIN (P0_8) #define BTN_BUILTIN (P0_8)
// determines the address of the port by the board pin number to which this pin belongs on the MCU // determines the address of the port by the board pin number to which this pin belongs on the MCU
@ -141,10 +141,9 @@ static const uint8_t SS = PIN_SPI_SS;
static const uint8_t MOSI = PIN_SPI_MOSI; static const uint8_t MOSI = PIN_SPI_MOSI;
static const uint8_t MISO = PIN_SPI_MISO; static const uint8_t MISO = PIN_SPI_MISO;
static const uint8_t SCK = PIN_SPI_SCK; static const uint8_t SCK = PIN_SPI_SCK;
// config SEL_NSS1 to replace D10 to different controller pin, // functions is needed for compatibility with other boards
// because pin 1.3 which is D10 by default is needed to spi static inline void spi_onBegin(void) {}
void spi_onBegin(void); static inline void spi_onEnd(void) {}
void spi_onEnd(void);
// I2C // I2C
#define PIN_WIRE_SDA (P1_12) #define PIN_WIRE_SDA (P1_12)
@ -158,7 +157,7 @@ static const uint8_t SCL = PIN_WIRE_SCL;
#define WIRE_FREQ_1000K 1000000 #define WIRE_FREQ_1000K 1000000
// interrupts // interrupts
#define EXTERNAL_INTERRUPTS_QTY 7 #define EXTERNAL_INTERRUPTS_QTY 8
extern uint8_t interruptInfo[EXTERNAL_INTERRUPTS_QTY][3]; extern uint8_t interruptInfo[EXTERNAL_INTERRUPTS_QTY][3];
// determines the board pin number by interrupt number // determines the board pin number by interrupt number
#define interruptToDigitalPin(interruptNum) (interruptInfo[interruptNum][0]) #define interruptToDigitalPin(interruptNum) (interruptInfo[interruptNum][0])

View File

@ -164,7 +164,7 @@ HAL_TIMER32_CHANNEL_IndexTypeDef pwmPinToTimerChannel(uint32_t digPinNumber)
case 3: case 3:
return TIMER32_CHANNEL_3; return TIMER32_CHANNEL_3;
default: default:
return NULL; return 255;
} }
} }
@ -173,13 +173,14 @@ HAL_TIMER32_CHANNEL_IndexTypeDef pwmPinToTimerChannel(uint32_t digPinNumber)
// index = interrupt number. In each row {digitalPinNumber, IntLineValue, IntMuxValue} // index = interrupt number. In each row {digitalPinNumber, IntLineValue, IntMuxValue}
uint8_t interruptInfo[EXTERNAL_INTERRUPTS_QTY][3] = uint8_t interruptInfo[EXTERNAL_INTERRUPTS_QTY][3] =
{ {
{2, GPIO_LINE_2, GPIO_MUX_LINE_2_PORT0_10}, // INT0 {BTN_BUILTIN, GPIO_LINE_0, GPIO_MUX_LINE_0_PORT0_8}, // INT0
{3, GPIO_LINE_0, GPIO_MUX_LINE_0_PORT0_0}, // INT1 {P0_9, GPIO_LINE_1, GPIO_MUX_LINE_1_PORT0_9}, // INT1
{4, GPIO_LINE_4, GPIO_MUX_LINE_4_PORT0_8}, // INT2 {P0_10, GPIO_LINE_2, GPIO_MUX_LINE_2_PORT0_10}, // INT2
{5, GPIO_LINE_1, GPIO_MUX_LINE_1_PORT0_1}, // INT3 {P0_11, GPIO_LINE_3, GPIO_MUX_LINE_3_PORT0_11}, // INT3
{8, GPIO_LINE_5, GPIO_MUX_LINE_5_PORT1_9}, // INT4 {P0_12, GPIO_LINE_4, GPIO_MUX_LINE_4_PORT0_12}, // INT4
{9, GPIO_LINE_3, GPIO_MUX_LINE_3_PORT0_3}, // INT5 {P0_13, GPIO_LINE_5, GPIO_MUX_LINE_5_PORT0_13}, // INT5
{BTN_BUILTIN, GPIO_LINE_6, GPIO_MUX_LINE_6_PORT2_6}, // INT6 (button) // todo кнопка на этом пине?? {P0_14, GPIO_LINE_6, GPIO_MUX_LINE_6_PORT0_14}, // INT6
{P0_15, GPIO_LINE_7, GPIO_MUX_LINE_7_PORT0_15}, // INT7
}; };
int8_t digitalPinToGpioIntMux(uint8_t digPinNumber) int8_t digitalPinToGpioIntMux(uint8_t digPinNumber)
@ -220,14 +221,3 @@ int8_t digitalPinToInterrupt(uint32_t digPinNumber)
} }
return NOT_AN_INTERRUPT; return NOT_AN_INTERRUPT;
} }
// ---------------------- SPI ---------------------- //
void spi_onBegin(void)
{
return;
}
void spi_onEnd(void)
{
return;
}