blob: 06c541f2bb25603cb561f0ac97e3664a439a129d [file] [log] [blame]
#pragma once
#include <Arduino.h>
namespace gonk::pin_config {
// STM32 Port & pin // PCB NET Name
constexpr uint16_t ICE40ResetN = PC13; // ICE_RST_N
constexpr uint16_t ICE40Done = PC8; // ICE_CDONE
constexpr uint16_t FlashCS = PD2; // ICE_SPI_SS
constexpr uint16_t FlashHold = PC11; // FLASH_HOLD
constexpr uint16_t FlashWP = PC12; // FLASH_WP
constexpr uint16_t FlashMOSI = PB5; // ICE_SPI_MOSI
constexpr uint16_t FlashMISO = PB4; // ICE_SPI_MISO
constexpr uint16_t FlashCLK = PB3; // ICE_SPI_SCK
constexpr uint16_t StatusLed = PB13; // STATUS
class PinConfig {
public:
PinConfig();
// Init common MCU pins such as the status LED.
void Init();
// Init FPGA specific pins.
void InitFpgaPins();
// Halt the FPGA with the SPI bus released so SPI flash is accessible from the
// MCU.
void FpgaHalt();
void FpgaSpiConfigMode();
void FpgaEnable();
void SPIEnable();
void SPIDisable();
private:
};
} // namespace gonk::pin_config