small board

This commit is contained in:
Andrey 2023-06-10 22:02:04 -04:00
parent 48e1352a89
commit ecae5eb98f
6 changed files with 55 additions and 5 deletions

View File

@ -0,0 +1,7 @@
ifeq ($(LED_CRITICAL_ERROR_BRAIN_PIN),)
LED_CRITICAL_ERROR_BRAIN_PIN = -DLED_CRITICAL_ERROR_BRAIN_PIN=H64_LED1_RED
endif
DDEFS += $(LED_CRITICAL_ERROR_BRAIN_PIN)
include $(BOARDS_DIR)/hellen/hellen-common.mk

View File

@ -10,17 +10,30 @@ void setHellenCan() {
engineConfiguration->canRxPin = Gpio::D0;
}
void setHellen64Can() {
engineConfiguration->canTxPin = Gpio::B9;
engineConfiguration->canRxPin = Gpio::B8;
}
static OutputPin megaEn;
void setHellenMegaEnPin() {
static void setHellenMegaEnPin(Gpio pin) {
static bool initialized = false;
if (!initialized) {
initialized = true;
megaEn.initPin("mm-EN", H144_GP8); // OUT_PWR_EN
megaEn.initPin("mm-EN", pin);
megaEn.setValue(1);
}
}
void setHellenMegaEnPin() {
setHellenMegaEnPin(H144_GP8); // OUT_PWR_EN
}
void setHellen64MegaEnPin() {
setHellenMegaEnPin(H64_IO1); // OUT_PWR_EN
}
void hellenBoardStandBy() {
// we need to turn 'megaEn' and pause for a bit to make sure that WBO is off and does not wake main firmware right away
megaEn.setValue(0);

View File

@ -1,3 +1,3 @@
Gpio getCommsLedPin() {
return H64_BLUE_LED; // blue
return H64_LED2_BLUE;
}

View File

@ -1,3 +1,6 @@
BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
DDEFS += -DFIRMWARE_ID=\"small-can-board\"
DDEFS += -DSHORT_BOARD_NAME=small-can
include $(BOARDS_DIR)/hellen/hellen-common64.mk

View File

@ -0,0 +1,10 @@
#include "pch.h"
#include "hellen_meta.h"
#include "hellen_leds_64.cpp"
void setBoardConfigOverrides() {
setHellen64Can();
setHellen64MegaEnPin();
setHellen64SdCardSpi1();
}

View File

@ -24,15 +24,23 @@
void hellenWbo();
void setHellenMegaEnPin();
void setHellen64MegaEnPin();
void hellenBoardStandBy();
void configureHellenMegaAccCS2Pin();
void configureHellenCanTerminator();
void setHellenCan();
void setHellen64Can();
int detectHellenBoardId();
void detectHellenBoardType();
#define H64_LED1_RED Gpio::B0
#define H64_LED2_BLUE Gpio::B1
#define H64_IO1 Gpio::C13
#define H64_SPI1_CS1 Gpio::D2
// stm32 UART8
#define H144_UART1_RX Gpio::E0
#define H144_UART1_TX Gpio::E1
@ -231,16 +239,25 @@ void detectHellenBoardType();
#define H_SPI3_SCK Gpio::C10
#define H_SPI3_CS Gpio::A15
static void setHellenSdCardSpi1() {
static void setHellenSdCardSpi1NoCS() {
engineConfiguration->isSdCardEnabled = true;
engineConfiguration->sdCardSpiDevice = SPI_DEVICE_1;
engineConfiguration->spi1mosiPin = H_SPI1_MOSI;
engineConfiguration->spi1misoPin = H_SPI1_MISO;
engineConfiguration->spi1sckPin = H_SPI1_SCK;
engineConfiguration->sdCardCsPin = H_SPI1_CS1;
engineConfiguration->is_enabled_spi_1 = true;
}
static void setHellenSdCardSpi1() {
setHellenSdCardSpi1NoCS();
engineConfiguration->sdCardCsPin = H_SPI1_CS1;
}
static void setHellen64SdCardSpi1() {
setHellenSdCardSpi1NoCS();
engineConfiguration->sdCardCsPin = H64_SPI1_CS1;
}
static void setHellenSdCardSpi2() {
engineConfiguration->isSdCardEnabled = true;
engineConfiguration->sdCardSpiDevice = SPI_DEVICE_2;