-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardware.h
72 lines (58 loc) · 1.51 KB
/
hardware.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#pragma once
// UART0: connected to ESP32
#define UART_ESP32 uart0
#define UART_ESP32_TX_PIN 0
#define UART_ESP32_RX_PIN 1
#define UART_ESP32_BAUDRATE 115200
// I2C0: system I2C bus
#define I2C_SYSTEM i2c1
#define I2C_SYSTEM_SDA_PIN 2
#define I2C_SYSTEM_SCL_PIN 3
// Buttons
#define BUTTON_MENU 4
#define BUTTON_HOME 5
#define BUTTON_ACCEPT 6
#define BUTTON_JOY_A 7
#define BUTTON_JOY_B 8
#define BUTTON_JOY_C 9
#define BUTTON_JOY_D 10
#define BUTTON_JOY_E 11
#define BUTTON_START 22
#define BUTTON_BACK 26
// FPGA
#define FPGA_CDONE 20
#define FPGA_RESET 21
// UART1: connected to ICE40 FPGA
#define UART_FPGA uart1
#define UART_FPGA_TX_PIN 24
#define UART_FPGA_RX_PIN 25
#define UART_FPGA_BAUDRATE 9600
// LCD control lines
#define LCD_BACKLIGHT_PIN 15
// ESP32 control lines
#define ESP32_BL_PIN 12 // Output, high for normal boot, low for download boot, also serves as IRQ
#define ESP32_EN_PIN 13 // Output, high to enable ESP32, low to reset ESP32
#define ESP32_INT_PIN 14
// Analog inputs
#define ANALOG_VUSB_PIN 28
#define ANALOG_VUSB_ADC 2
#define ANALOG_VBAT_PIN 29
#define ANALOG_VBAT_ADC 3
#define ANALOG_TEMP_ADC 4
// System state GPIOs
#define BATT_CHRG_PIN 23
// Other GPIOs
#define PROTO_0_PIN 16
#define PROTO_1_PIN 17
// SAO GPIOs
#define SAO_IO0_PIN 18
#define SAO_IO1_PIN 19
// IR LED
#define IR_PIN 27
#define IR_PIO pio0
// SAO WS2812
#define WS2812_PIO pio1
// USB virtual device numbers
#define USB_CDC_ESP32 0
#define USB_CDC_FPGA 1
#define USB_CDC_STDIO 2