#pragma once
#include <Arduino.h>

#define I2C_SDA1_Pin    1
#define I2C_SCL1_Pin    2

//int linearizeLED(float inp);

typedef struct{
  int8_t rgb1;
  int8_t rgb2;
  int8_t btn[3];
  int8_t buzzer;
  int8_t touch[5];
  int8_t shield;
  int8_t relay[4];
  int8_t stat[2];
  int8_t adc1;
  int8_t oled_dc;
  int8_t oled_rst;
  int8_t oled_mosi;
  int8_t oled_sck;
  int8_t oled_cs;
  int8_t ext[2];
  int8_t rf433tx;
  int8_t rf433rx;
}BOARD_PINS;

extern BOARD_PINS* thisBoardPins;
// Safe status pin macros: only write when configured (>=0)
#define setStatusPin1(state) do { if (thisBoardPins && thisBoardPins->stat[0] >= 0) digitalWrite(thisBoardPins->stat[0], state); } while(0)
#define setStatusPin2(state) do { if (thisBoardPins && thisBoardPins->stat[1] >= 0) digitalWrite(thisBoardPins->stat[1], state); } while(0)

bool Load_Board_Pins(BOARD_PINS& boardPins, const String& path);
void Init_Board_Basic(BOARD_PINS& boardPins);
void updateFanControl(float temperature);
void Initialize_Rear_Control(int relayIndex, int buttonIndex, int rampTime, int steps, float min, float max);

