|
| 1 | +/* This file was auto-generated from generic-ln882hki.json using boardgen */ |
| 2 | + |
| 3 | +#pragma once |
| 4 | + |
| 5 | +// clang-format off |
| 6 | + |
| 7 | +// Pins |
| 8 | +// ---- |
| 9 | +#define PINS_COUNT 20 // Total GPIO count |
| 10 | +#define NUM_DIGITAL_PINS 20 // Digital inputs/outputs |
| 11 | +#define NUM_ANALOG_INPUTS 6 // ADC inputs |
| 12 | +#define NUM_ANALOG_OUTPUTS 0 // PWM & DAC outputs |
| 13 | +#define PINS_GPIO_MAX 25 // Last usable GPIO number |
| 14 | + |
| 15 | +// Wire Interfaces |
| 16 | +// --------------- |
| 17 | +#define PIN_WIRE0_SCL_0 0u // PA_0 |
| 18 | +#define PIN_WIRE0_SCL_1 1u // PA_1 |
| 19 | +#define PIN_WIRE0_SCL_2 2u // PA_2 |
| 20 | +#define PIN_WIRE0_SCL_3 3u // PA_3 |
| 21 | +#define PIN_WIRE0_SCL_4 4u // PA_4 |
| 22 | +#define PIN_WIRE0_SCL_5 5u // PA_5 |
| 23 | +#define PIN_WIRE0_SCL_6 6u // PA_6 |
| 24 | +#define PIN_WIRE0_SCL_7 7u // PA_7 |
| 25 | +#define PIN_WIRE0_SCL_8 8u // PA_8 |
| 26 | +#define PIN_WIRE0_SCL_9 9u // PA_9 |
| 27 | +#define PIN_WIRE0_SCL_10 10u // PA_10 |
| 28 | +#define PIN_WIRE0_SCL_11 11u // PA_11 |
| 29 | +#define PIN_WIRE0_SCL_12 12u // PA_12 |
| 30 | +#define PIN_WIRE0_SCL_13 19u // PB_3 |
| 31 | +#define PIN_WIRE0_SCL_14 20u // PB_4 |
| 32 | +#define PIN_WIRE0_SCL_15 21u // PB_5 |
| 33 | +#define PIN_WIRE0_SCL_16 22u // PB_6 |
| 34 | +#define PIN_WIRE0_SCL_17 23u // PB_7 |
| 35 | +#define PIN_WIRE0_SCL_18 24u // PB_8 |
| 36 | +#define PIN_WIRE0_SCL_19 25u // PB_9 |
| 37 | +#define PIN_WIRE0_SDA_0 0u // PA_0 |
| 38 | +#define PIN_WIRE0_SDA_1 1u // PA_1 |
| 39 | +#define PIN_WIRE0_SDA_2 2u // PA_2 |
| 40 | +#define PIN_WIRE0_SDA_3 3u // PA_3 |
| 41 | +#define PIN_WIRE0_SDA_4 4u // PA_4 |
| 42 | +#define PIN_WIRE0_SDA_5 5u // PA_5 |
| 43 | +#define PIN_WIRE0_SDA_6 6u // PA_6 |
| 44 | +#define PIN_WIRE0_SDA_7 7u // PA_7 |
| 45 | +#define PIN_WIRE0_SDA_8 8u // PA_8 |
| 46 | +#define PIN_WIRE0_SDA_9 9u // PA_9 |
| 47 | +#define PIN_WIRE0_SDA_10 10u // PA_10 |
| 48 | +#define PIN_WIRE0_SDA_11 11u // PA_11 |
| 49 | +#define PIN_WIRE0_SDA_12 12u // PA_12 |
| 50 | +#define PIN_WIRE0_SDA_13 19u // PB_3 |
| 51 | +#define PIN_WIRE0_SDA_14 20u // PB_4 |
| 52 | +#define PIN_WIRE0_SDA_15 21u // PB_5 |
| 53 | +#define PIN_WIRE0_SDA_16 22u // PB_6 |
| 54 | +#define PIN_WIRE0_SDA_17 23u // PB_7 |
| 55 | +#define PIN_WIRE0_SDA_18 24u // PB_8 |
| 56 | +#define PIN_WIRE0_SDA_19 25u // PB_9 |
| 57 | +#define PINS_WIRE0_SCL (pin_size_t[]){0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, 9u, 10u, 11u, 12u, 19u, 20u, 21u, 22u, 23u, 24u, 25u} |
| 58 | +#define PINS_WIRE0_SDA (pin_size_t[]){0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, 9u, 10u, 11u, 12u, 19u, 20u, 21u, 22u, 23u, 24u, 25u} |
| 59 | + |
| 60 | +// Serial ports |
| 61 | +// ------------ |
| 62 | +#define PIN_SERIAL0_RX 3u // PA_3 |
| 63 | +#define PIN_SERIAL0_TX 2u // PA_2 |
| 64 | +#define PIN_SERIAL1_RX 24u // PB_8 |
| 65 | +#define PIN_SERIAL1_TX 25u // PB_9 |
| 66 | +#define PINS_SERIAL0_RX (pin_size_t[]){3u} |
| 67 | +#define PINS_SERIAL0_TX (pin_size_t[]){2u} |
| 68 | +#define PINS_SERIAL1_RX (pin_size_t[]){24u} |
| 69 | +#define PINS_SERIAL1_TX (pin_size_t[]){25u} |
| 70 | + |
| 71 | +// Pin function macros |
| 72 | +// ------------------- |
| 73 | +#define PIN_ADC2 0u // PA_0 |
| 74 | +#define PIN_ADC3 1u // PA_1 |
| 75 | +#define PIN_ADC4 4u // PA_4 |
| 76 | +#define PIN_ADC5 19u // PB_3 |
| 77 | +#define PIN_ADC6 20u // PB_4 |
| 78 | +#define PIN_ADC7 21u // PB_5 |
| 79 | +#define PIN_PA00 0u // PA_0 |
| 80 | +#define PIN_PA01 1u // PA_1 |
| 81 | +#define PIN_PA02 2u // PA_2 |
| 82 | +#define PIN_PA03 3u // PA_3 |
| 83 | +#define PIN_PA04 4u // PA_4 |
| 84 | +#define PIN_PA05 5u // PA_5 |
| 85 | +#define PIN_PA06 6u // PA_6 |
| 86 | +#define PIN_PA07 7u // PA_7 |
| 87 | +#define PIN_PA08 8u // PA_8 |
| 88 | +#define PIN_PA09 9u // PA_9 |
| 89 | +#define PIN_PA10 10u // PA_10 |
| 90 | +#define PIN_PA11 11u // PA_11 |
| 91 | +#define PIN_PA12 12u // PA_12 |
| 92 | +#define PIN_PB03 19u // PB_3 |
| 93 | +#define PIN_PB04 20u // PB_4 |
| 94 | +#define PIN_PB05 21u // PB_5 |
| 95 | +#define PIN_PB06 22u // PB_6 |
| 96 | +#define PIN_PB07 23u // PB_7 |
| 97 | +#define PIN_PB08 24u // PB_8 |
| 98 | +#define PIN_PB09 25u // PB_9 |
| 99 | +#define PIN_RX0 3u // PA_3 |
| 100 | +#define PIN_RX1 24u // PB_8 |
| 101 | +#define PIN_TX0 2u // PA_2 |
| 102 | +#define PIN_TX1 25u // PB_9 |
| 103 | + |
| 104 | +// Port availability |
| 105 | +// ----------------- |
| 106 | +#define HAS_SERIAL0 1 |
| 107 | +#define HAS_SERIAL1 1 |
| 108 | +#define HAS_WIRE0 1 |
| 109 | +#define SERIAL_INTERFACES_COUNT 2 |
| 110 | +#define WIRE_INTERFACES_COUNT 1 |
| 111 | + |
| 112 | +// Arduino pin names |
| 113 | +// ----------------- |
| 114 | +#define PIN_D0 0u // PA_0 |
| 115 | +#define PIN_D1 1u // PA_1 |
| 116 | +#define PIN_D2 2u // PA_2 |
| 117 | +#define PIN_D3 3u // PA_3 |
| 118 | +#define PIN_D4 4u // PA_4 |
| 119 | +#define PIN_D5 5u // PA_5 |
| 120 | +#define PIN_D6 6u // PA_6 |
| 121 | +#define PIN_D7 7u // PA_7 |
| 122 | +#define PIN_D8 8u // PA_8 |
| 123 | +#define PIN_D9 9u // PA_9 |
| 124 | +#define PIN_D10 10u // PA_10 |
| 125 | +#define PIN_D11 11u // PA_11 |
| 126 | +#define PIN_D12 12u // PA_12 |
| 127 | +#define PIN_D13 19u // PB_3 |
| 128 | +#define PIN_D14 20u // PB_4 |
| 129 | +#define PIN_D15 21u // PB_5 |
| 130 | +#define PIN_D16 22u // PB_6 |
| 131 | +#define PIN_D17 23u // PB_7 |
| 132 | +#define PIN_D18 24u // PB_8 |
| 133 | +#define PIN_D19 25u // PB_9 |
| 134 | +#define PIN_A2 0u // PA_0 |
| 135 | +#define PIN_A3 1u // PA_1 |
| 136 | +#define PIN_A4 4u // PA_4 |
| 137 | +#define PIN_A5 19u // PB_3 |
| 138 | +#define PIN_A6 20u // PB_4 |
| 139 | +#define PIN_A7 21u // PB_5 |
| 140 | + |
| 141 | +// Static pin names |
| 142 | +// ---------------- |
| 143 | +static const unsigned char A2 = PIN_A2; |
| 144 | +static const unsigned char A3 = PIN_A3; |
| 145 | +static const unsigned char A4 = PIN_A4; |
| 146 | +static const unsigned char A5 = PIN_A5; |
| 147 | +static const unsigned char A6 = PIN_A6; |
| 148 | +static const unsigned char A7 = PIN_A7; |
| 149 | +static const unsigned char D0 = PIN_D0; |
| 150 | +static const unsigned char D1 = PIN_D1; |
| 151 | +static const unsigned char D2 = PIN_D2; |
| 152 | +static const unsigned char D3 = PIN_D3; |
| 153 | +static const unsigned char D4 = PIN_D4; |
| 154 | +static const unsigned char D5 = PIN_D5; |
| 155 | +static const unsigned char D6 = PIN_D6; |
| 156 | +static const unsigned char D7 = PIN_D7; |
| 157 | +static const unsigned char D8 = PIN_D8; |
| 158 | +static const unsigned char D9 = PIN_D9; |
| 159 | +static const unsigned char D10 = PIN_D10; |
| 160 | +static const unsigned char D11 = PIN_D11; |
| 161 | +static const unsigned char D12 = PIN_D12; |
| 162 | +static const unsigned char D13 = PIN_D13; |
| 163 | +static const unsigned char D14 = PIN_D14; |
| 164 | +static const unsigned char D15 = PIN_D15; |
| 165 | +static const unsigned char D16 = PIN_D16; |
| 166 | +static const unsigned char D17 = PIN_D17; |
| 167 | +static const unsigned char D18 = PIN_D18; |
| 168 | +static const unsigned char D19 = PIN_D19; |
0 commit comments