-
Notifications
You must be signed in to change notification settings - Fork 17
/
gpio.h
46 lines (37 loc) · 948 Bytes
/
gpio.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Pin definitions for the project
#ifndef PINDEFS_H
#define PINDEFS_H
#include "Arduino.h"
#include <stdint.h>
class StatusLight
{
public:
StatusLight(int pin);
void update();
void update(long on, long off);
void on();
void off();
private:
int ledPin;
long OnTime;
long OffTime;
int ledState;
unsigned long previousMillis;
};
// Configuration solder-jumpers
const int CONFIG_PIN[] = {4,5,6};
// Status LEDs
const int STATUS_LED[] = {0,1,2,3};
// Relays
const int SHUTDOWN_CTRL_PIN = 11;
const int PRECHARGE_CTRL_PIN = 12;
// Frequency measurements (from Voltage-to-Frequency converters)
const int FREQ_ACCU_PIN = 14;
const int FREQ_TS_PIN = 15;
// Status inputs
const int PDOC_PIN = A7; // Active-high when PDOC is OK
const int PWR_OK_PIN = A4; // Active-high when power-supply (shutdown circuit) is OK
// Function prototypes
void setupGPIO(void);
float getShutdownCircuitVoltage(void);
#endif