Files
libretiny/boards/variants/wa2.h
2023-10-28 14:58:52 +02:00

101 lines
2.9 KiB
C

/* This file was auto-generated from wa2.json using boardgen */
#pragma once
// clang-format off
// Pins
// ----
#define PINS_COUNT 13 // Total GPIO count
#define NUM_DIGITAL_PINS 13 // Digital inputs/outputs
#define NUM_ANALOG_INPUTS 1 // ADC inputs
#define NUM_ANALOG_OUTPUTS 5 // PWM & DAC outputs
#define PINS_GPIO_MAX 23 // Last usable GPIO number
// Wire Interfaces
// ---------------
#define PIN_WIRE1_SCL 20u // GPIO20
#define PIN_WIRE1_SDA 21u // GPIO21
#define PINS_WIRE1_SCL (pin_size_t[]){20u}
#define PINS_WIRE1_SDA (pin_size_t[]){21u}
// Serial ports
// ------------
#define PIN_SERIAL1_RX 10u // GPIO10
#define PIN_SERIAL1_TX 11u // GPIO11
#define PIN_SERIAL2_TX 0u // GPIO0
#define PINS_SERIAL1_RX (pin_size_t[]){10u}
#define PINS_SERIAL1_TX (pin_size_t[]){11u}
#define PINS_SERIAL2_TX (pin_size_t[]){0u}
// Pin function macros
// -------------------
#define PIN_ADC1 4u // GPIO4
#define PIN_ADC3 23u // GPIO23
#define PIN_P0 0u // GPIO0
#define PIN_P4 4u // GPIO4
#define PIN_P6 6u // GPIO6
#define PIN_P7 7u // GPIO7
#define PIN_P8 8u // GPIO8
#define PIN_P10 10u // GPIO10
#define PIN_P11 11u // GPIO11
#define PIN_P18 18u // GPIO18
#define PIN_P19 19u // GPIO19
#define PIN_P20 20u // GPIO20
#define PIN_P21 21u // GPIO21
#define PIN_P22 22u // GPIO22
#define PIN_P23 23u // GPIO23
#define PIN_PWM0 6u // GPIO6
#define PIN_PWM1 7u // GPIO7
#define PIN_PWM2 8u // GPIO8
#define PIN_PWM4 18u // GPIO18
#define PIN_PWM5 19u // GPIO19
#define PIN_RX1 10u // GPIO10
#define PIN_SCL1 20u // GPIO20
#define PIN_SCL2 0u // GPIO0
#define PIN_SDA1 21u // GPIO21
#define PIN_TX1 11u // GPIO11
#define PIN_TX2 0u // GPIO0
// Port availability
// -----------------
#define HAS_SERIAL1 1
#define HAS_SERIAL2 1
#define HAS_WIRE1 1
#define SERIAL_INTERFACES_COUNT 2
#define WIRE_INTERFACES_COUNT 1
// Arduino pin names
// -----------------
#define PIN_D0 8u // GPIO8
#define PIN_D1 7u // GPIO7
#define PIN_D2 6u // GPIO6
#define PIN_D3 23u // GPIO23
#define PIN_D4 10u // GPIO10
#define PIN_D5 11u // GPIO11
#define PIN_D6 18u // GPIO18
#define PIN_D7 19u // GPIO19
#define PIN_D8 20u // GPIO20
#define PIN_D9 4u // GPIO4
#define PIN_D10 0u // GPIO0
#define PIN_D11 21u // GPIO21
#define PIN_D12 22u // GPIO22
#define PIN_A0 23u // GPIO23
// Static pin names
// ----------------
static const unsigned char A0 = PIN_A0;
static const unsigned char D0 = PIN_D0;
static const unsigned char D1 = PIN_D1;
static const unsigned char D2 = PIN_D2;
static const unsigned char D3 = PIN_D3;
static const unsigned char D4 = PIN_D4;
static const unsigned char D5 = PIN_D5;
static const unsigned char D6 = PIN_D6;
static const unsigned char D7 = PIN_D7;
static const unsigned char D8 = PIN_D8;
static const unsigned char D9 = PIN_D9;
static const unsigned char D10 = PIN_D10;
static const unsigned char D11 = PIN_D11;
static const unsigned char D12 = PIN_D12;