Initial commit
This commit is contained in:
34
include/hardware.h
Normal file
34
include/hardware.h
Normal file
@@ -0,0 +1,34 @@
|
||||
// General hardware definitions
|
||||
#pragma once
|
||||
|
||||
// Keys
|
||||
#define KEY_1 1 // Key or touchpad
|
||||
#define KEY_2 2 // Key or touchpad
|
||||
|
||||
// I2S audio output -> PCM5102 DAC
|
||||
#define I2S_DOUT 4 // data out
|
||||
#define I2S_BCLK 5 // bit clock
|
||||
#define I2S_LRC 6 // left right channel select
|
||||
#define I2S_XSMT 7 // PCM5102 soft mute
|
||||
|
||||
// SPI for SD-Card; VSPI pins for higher performance
|
||||
#define SD_CS 10
|
||||
#define SD_MOSI 11
|
||||
#define SD_MISO 13
|
||||
#define SD_SCK 12
|
||||
|
||||
// I2C for control interface
|
||||
#define I2C_SDA 8
|
||||
#define I2C_CLK 9
|
||||
|
||||
// CAN bus for NMEA2000 connection
|
||||
#define CAN_RX 47
|
||||
#define CAN_TX 48
|
||||
|
||||
// RS485 for NMEA0183 connection / UART1
|
||||
#define SER_RX 18
|
||||
#define SER_TX 17
|
||||
|
||||
// I2C Addresses
|
||||
// Address of DAC module
|
||||
// Address of switchbank
|
||||
38
include/main.h
Normal file
38
include/main.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#pragma
|
||||
|
||||
// WIFI AP
|
||||
#define WIFI_CHANNEL 9
|
||||
#define WIFI_MAX_STA 2
|
||||
|
||||
// Keys
|
||||
#define KEY_1 GPIO_NUM_5 // D2
|
||||
#define KEY_2 GPIO_NUM_6 // D3
|
||||
#define KEY_3 GPIO_NUM_7 // D4
|
||||
#define KEY_4 GPIO_NUM_8 // D5
|
||||
#define KEY_5 GPIO_NUM_9 // D6
|
||||
#define KEY_6 GPIO_NUM_10 // D7
|
||||
#define KEY_DST GPIO_NUM_17
|
||||
|
||||
// LEDS
|
||||
#define LED_A GPIO_NUM_1
|
||||
#define LED_B GPIO_NUM_2
|
||||
#define LED_C GPIO_NUM_3
|
||||
#define LED_RGBA GPIO_NUM_4
|
||||
#define LED_RGBB GPIO_NUM_13
|
||||
#define LED_RGBC GPIO_NUM_14
|
||||
#define LED_USER GPIO_NUM_48
|
||||
|
||||
// CAN bus for NMEA2000 connection
|
||||
#define CAN_RX GPIO_NUM_18 // D9
|
||||
#define CAN_TX GPIO_NUM_21 // D10
|
||||
#define CAN_RECOVERY_PERIOD 3000
|
||||
|
||||
// NMEA2000 defaults
|
||||
#define N2K_DEFAULT_NODEID 124
|
||||
|
||||
// I2C temp. sensor
|
||||
#define I2C_SDA GPIO_NUM_11 // A4
|
||||
#define I2C_SCL GPIO_NUM_12 // A5
|
||||
|
||||
// I2C addresses
|
||||
#define SHT31_ADDRESS 0x44
|
||||
Reference in New Issue
Block a user