First Test env

This commit is contained in:
Emanuele Trabattoni
2026-03-27 12:49:20 +01:00
parent a0710f7ee7
commit a210d808da
8 changed files with 292 additions and 86 deletions

View File

@@ -0,0 +1,71 @@
#pragma once
#include <Arduino.h>
// =====================
// UART DEBUG
// =====================
#define UART_TX 1 // TX0 (USB seriale)
#define UART_RX 3 // RX0
// =====================
// SPI BUS
// =====================
#define SPI_A_MOSI 23
#define SPI_A_MISO 19
#define SPI_A_SCK 18
// =====================
// I2C BUS
// =====================
#define SDA 21
#define SCL 22
// =====================
// ADC CONTROL (SPI + interrupt safe)
// =====================
#define ADC_A_CS 5 // chip select
#define ADC_A_DRDY 34 // input only + interrupt perfetto
#define ADC_A_RST 27 // output
#define ADC_A_SYNC 26 // output
// =====================
// DIGITAL OUT
// =====================
#define POT_A_CS 25
#define POT_B_CS 33
// =====================
// TRIGGER INPUT INTERRUPTS
// =====================
#define TRIG_A12P 35
#define TRIG_A12N 32
#define TRIG_A34P 39
#define TRIG_A34N 36
// =====================
// SPARK DETECT INTERRUPTS
// =====================
#define SPARK_A12 4
#define SPARK_A34 2
// Init Pin Functions
inline void initTriggerPinsInputs()
{
pinMode(TRIG_A12P, INPUT_PULLDOWN);
pinMode(TRIG_A12N, INPUT_PULLDOWN);
pinMode(TRIG_A34P, INPUT_PULLDOWN);
pinMode(TRIG_A34N, INPUT_PULLDOWN);
}
inline void initSparkPinInputs()
{
pinMode(SPARK_A12, INPUT_PULLDOWN);
pinMode(SPARK_A34, INPUT_PULLDOWN);
}