92 lines
1.8 KiB
C++
92 lines
1.8 KiB
C++
#include "BoardConfig.h"
|
|
|
|
BoardConfig::BoardConfig(const uint16_t I2C_screenAddress,
|
|
const uint16_t screenWidth,
|
|
const uint16_t screenHeight,
|
|
const uint16_t I2C_IOExpanderAddress,
|
|
const uint16_t _I2C_RTCFlashAddress,
|
|
const Pin SPI_SDCard_cs,
|
|
const Pin I2C_sda,
|
|
const Pin I2C_scl,
|
|
const Pin SPI_mosi,
|
|
const Pin SPI_miso,
|
|
const Pin SPI_clk,
|
|
const SPISettings spiSpeed
|
|
):
|
|
_I2C_sda(I2C_sda == DEFAULT_PIN ? GPIO_4_SDA : I2C_sda),
|
|
_I2C_scl(I2C_scl == DEFAULT_PIN ? GPIO_5_SCL : I2C_scl),
|
|
_SPI_mosi(SPI_mosi == DEFAULT_PIN ? GPIO_13_MOSI : SPI_mosi),
|
|
_SPI_miso(SPI_miso == DEFAULT_PIN ? GPIO_12_MISO : SPI_miso),
|
|
_SPI_clk(SPI_clk == DEFAULT_PIN ? GPIO_14_CLK : SPI_clk),
|
|
_SPI_SDCard_cs(_SPI_SDCard_cs == DEFAULT_PIN ? GPIO_2 : SPI_SDCard_cs),
|
|
_I2C_screenAddress(I2C_screenAddress),
|
|
_I2C_IOExpanderAddress(I2C_IOExpanderAddress),
|
|
_I2C_RTCFlashAddress(_I2C_RTCFlashAddress),
|
|
_SPISpeed(spiSpeed),
|
|
_screenWidth(screenWidth),
|
|
_screenHeight(screenHeight)
|
|
{
|
|
|
|
}
|
|
|
|
Pin BoardConfig::getI2C_sda() const
|
|
{
|
|
return _I2C_sda;
|
|
}
|
|
|
|
Pin BoardConfig::getI2C_scl() const
|
|
{
|
|
return _I2C_scl;
|
|
}
|
|
|
|
Pin BoardConfig::getSPI_mosi() const
|
|
{
|
|
return _SPI_mosi;
|
|
}
|
|
|
|
Pin BoardConfig::getSPI_miso() const
|
|
{
|
|
return _SPI_miso;
|
|
}
|
|
|
|
Pin BoardConfig::getSPI_clk() const
|
|
{
|
|
return _SPI_clk;
|
|
}
|
|
|
|
Pin BoardConfig::getSPI_SDCard_cs() const
|
|
{
|
|
return _SPI_SDCard_cs;
|
|
}
|
|
|
|
uint16_t BoardConfig::getI2C_screenAddress() const
|
|
{
|
|
return _I2C_screenAddress;
|
|
}
|
|
|
|
uint16_t BoardConfig::getI2C_IOExpanderAddress() const
|
|
{
|
|
return _I2C_IOExpanderAddress;
|
|
}
|
|
|
|
uint16_t BoardConfig::getRTCFlashAddress() const
|
|
{
|
|
return _I2C_RTCFlashAddress;
|
|
}
|
|
|
|
|
|
SPISettings BoardConfig::getSPISpeed() const
|
|
{
|
|
return _SPISpeed;
|
|
}
|
|
|
|
uint16_t BoardConfig::getScreenWidth() const
|
|
{
|
|
return _screenWidth;
|
|
}
|
|
|
|
uint16_t BoardConfig::getScreenHeight() const
|
|
{
|
|
return _screenHeight;
|
|
}
|