Newer
Older
#pragma once
#include "MCP23S08.h"
// Software SPI definitions
#define MOSI 13
#define MISO 12
#define SS 2
#define SCK 4
// MCP23S08 interrupt
#define ISR_PIN 15
//AlCon Logic Board interrupt
#define TRIGGER_SIGNAL 14
// LED pin on MCP23S08 expander
// Pin to inform SIB that a power down is about to happen, on MCP23S08 expander
#define ALERT_SIB_PIN 7
struct pins {
bool sib;
bool plc;
bool ups;
int last_triggered;
String stage;
bool ramping;
bool canDoPowerFromREST;
};
extern struct pins PINS;
extern MCP23S08 MCP;
void IRAM_ATTR isr();
void initializeMCP();
void isr_check_loop();
void powerOffCheckLoop();