69 lines
1.7 KiB
C++
69 lines
1.7 KiB
C++
/**
|
|
This file is used to define the hardware parameters of the whole board and thus replacing the following files :
|
|
ScreenConfig.h, SDcardConfig.h, PinMapping.h
|
|
It contains parameters Pins parameters, I2C addresses and more.
|
|
**/
|
|
#ifndef BOARDCONFIG_H
|
|
#define BOARDCONFIG_H
|
|
#include "definition.h"
|
|
#include <SdFat.h>
|
|
|
|
class BoardConfig
|
|
{
|
|
public:
|
|
BoardConfig(const uint16_t I2C_screenAddress = 0x3C,
|
|
const uint16_t screenWidth = 128,
|
|
const uint16_t screenHeight = 64,
|
|
const uint16_t I2C_IOExpanderAddress = 0x27,
|
|
const uint16_t _I2C_RTCFlashAddress = 0x0,
|
|
const Pin SPI_SDCard_cs = GPIO_2,
|
|
const Pin I2C_sda = GPIO_4_SDA,
|
|
const Pin I2C_scl = GPIO_5_SCL,
|
|
const Pin SPI_mosi = GPIO_13_MOSI,
|
|
const Pin SPI_miso = GPIO_12_MISO,
|
|
const Pin SPI_clk = GPIO_14_CLK,
|
|
const SPISettings spiSpeed = SPI_FULL_SPEED
|
|
);
|
|
|
|
Pin getI2C_sda() const;
|
|
Pin getI2C_scl() const;
|
|
|
|
Pin getSPI_mosi() const;
|
|
Pin getSPI_miso() const;
|
|
Pin getSPI_clk() const;
|
|
Pin getSPI_SDCard_cs() const;
|
|
|
|
uint16_t getI2C_screenAddress() const;
|
|
uint16_t getI2C_IOExpanderAddress() const;
|
|
uint16_t getRTCFlashAddress() const;
|
|
|
|
SPISettings getSPISpeed() const;
|
|
|
|
uint16_t getScreenWidth() const;
|
|
uint16_t getScreenHeight() const;
|
|
protected:
|
|
|
|
private:
|
|
//1) Pins
|
|
const Pin _I2C_sda;
|
|
const Pin _I2C_scl;
|
|
const Pin _SPI_mosi;
|
|
const Pin _SPI_miso;
|
|
const Pin _SPI_clk;
|
|
const Pin _SPI_SDCard_cs;
|
|
|
|
//2) I2C Addresses
|
|
const uint16_t _I2C_screenAddress;
|
|
const uint16_t _I2C_IOExpanderAddress;
|
|
const uint16_t _I2C_RTCFlashAddress;
|
|
|
|
//3) SPI Speed
|
|
const SPISettings _SPISpeed;
|
|
|
|
//4) Miscellaneous
|
|
const uint16_t _screenWidth;
|
|
const uint16_t _screenHeight;
|
|
};
|
|
|
|
#endif //BOARDCONFIG_H
|