Skip to content

Commit

Permalink
[boards] Update boardgen to add SPI support
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba2k2 committed Dec 8, 2023
1 parent ca096d8 commit ca8d767
Show file tree
Hide file tree
Showing 13 changed files with 93 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/push-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
python-version: '3.10'

- name: Install docs dependencies
run: pip install -U ltchiptool "boardgen>=0.11.0"
run: pip install -U ltchiptool "boardgen>=0.11.1"

- name: Generate docs and static JSON files
run: |
Expand Down
12 changes: 6 additions & 6 deletions boards/_base/ic/rtl8710bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,42 +52,42 @@
"C_NAME": "PA_6",
"GPIO": "PA06",
"IRQ": null,
"SPI": "FCS",
"FLASH": "^FCS",
"SD": "D2"
},
"19": {
"C_NAME": "PA_7",
"GPIO": "PA07",
"IRQ": null,
"SPI": "FD1",
"FLASH": "FD1",
"SD": "D3"
},
"20": {
"C_NAME": "PA_8",
"GPIO": "PA08",
"IRQ": null,
"SPI": "FD2",
"FLASH": "FD2",
"SD": "CMD"
},
"21": {
"C_NAME": "PA_9",
"GPIO": "PA09",
"IRQ": null,
"SPI": "FD0",
"FLASH": "FD0",
"SD": "CLK"
},
"22": {
"C_NAME": "PA_10",
"GPIO": "PA10",
"IRQ": null,
"SPI": "FSCK",
"FLASH": "FSCK",
"SD": "D0"
},
"23": {
"C_NAME": "PA_11",
"GPIO": "PA11",
"IRQ": null,
"SPI": "FD3",
"FLASH": "FD3",
"SD": "D1"
},
"27": {
Expand Down
13 changes: 13 additions & 0 deletions boards/variants/cb3se.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
#define NUM_ANALOG_OUTPUTS 6 // PWM & DAC outputs
#define PINS_GPIO_MAX 26 // Last usable GPIO number

// SPI Interfaces
// --------------
#define PIN_SPI0_CS 15u // GPIO15
#define PIN_SPI0_MISO 17u // GPIO17
#define PIN_SPI0_MOSI 16u // GPIO16
#define PIN_SPI0_SCK 14u // GPIO14
#define PINS_SPI0_CS (pin_size_t[]){15u}
#define PINS_SPI0_MISO (pin_size_t[]){17u}
#define PINS_SPI0_MOSI (pin_size_t[]){16u}
#define PINS_SPI0_SCK (pin_size_t[]){14u}

// Wire Interfaces
// ---------------
#define PIN_WIRE2_SCL 0u // GPIO0
Expand Down Expand Up @@ -72,8 +83,10 @@
// -----------------
#define HAS_SERIAL1 1
#define HAS_SERIAL2 1
#define HAS_SPI0 1
#define HAS_WIRE2 1
#define SERIAL_INTERFACES_COUNT 2
#define SPI_INTERFACES_COUNT 1
#define WIRE_INTERFACES_COUNT 1

// Arduino pin names
Expand Down
13 changes: 13 additions & 0 deletions boards/variants/cbu.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
#define NUM_ANALOG_OUTPUTS 6 // PWM & DAC outputs
#define PINS_GPIO_MAX 28 // Last usable GPIO number

// SPI Interfaces
// --------------
#define PIN_SPI0_CS 15u // GPIO15
#define PIN_SPI0_MISO 17u // GPIO17
#define PIN_SPI0_MOSI 16u // GPIO16
#define PIN_SPI0_SCK 14u // GPIO14
#define PINS_SPI0_CS (pin_size_t[]){15u}
#define PINS_SPI0_MISO (pin_size_t[]){17u}
#define PINS_SPI0_MOSI (pin_size_t[]){16u}
#define PINS_SPI0_SCK (pin_size_t[]){14u}

// Wire Interfaces
// ---------------
#define PIN_WIRE1_SCL 20u // GPIO20
Expand Down Expand Up @@ -79,9 +90,11 @@
// -----------------
#define HAS_SERIAL1 1
#define HAS_SERIAL2 1
#define HAS_SPI0 1
#define HAS_WIRE1 1
#define HAS_WIRE2 1
#define SERIAL_INTERFACES_COUNT 2
#define SPI_INTERFACES_COUNT 1
#define WIRE_INTERFACES_COUNT 2

// Arduino pin names
Expand Down
13 changes: 13 additions & 0 deletions boards/variants/generic-bk7231n-qfn32-tuya.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
#define NUM_ANALOG_OUTPUTS 6 // PWM & DAC outputs
#define PINS_GPIO_MAX 28 // Last usable GPIO number

// SPI Interfaces
// --------------
#define PIN_SPI0_CS 15u // GPIO15
#define PIN_SPI0_MISO 17u // GPIO17
#define PIN_SPI0_MOSI 16u // GPIO16
#define PIN_SPI0_SCK 14u // GPIO14
#define PINS_SPI0_CS (pin_size_t[]){15u}
#define PINS_SPI0_MISO (pin_size_t[]){17u}
#define PINS_SPI0_MOSI (pin_size_t[]){16u}
#define PINS_SPI0_SCK (pin_size_t[]){14u}

// Wire Interfaces
// ---------------
#define PIN_WIRE1_SCL 20u // GPIO20
Expand Down Expand Up @@ -79,9 +90,11 @@
// -----------------
#define HAS_SERIAL1 1
#define HAS_SERIAL2 1
#define HAS_SPI0 1
#define HAS_WIRE1 1
#define HAS_WIRE2 1
#define SERIAL_INTERFACES_COUNT 2
#define SPI_INTERFACES_COUNT 1
#define WIRE_INTERFACES_COUNT 2

// Arduino pin names
Expand Down
13 changes: 13 additions & 0 deletions boards/variants/generic-bk7231t-qfn32-tuya.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
#define NUM_ANALOG_OUTPUTS 6 // PWM & DAC outputs
#define PINS_GPIO_MAX 28 // Last usable GPIO number

// SPI Interfaces
// --------------
#define PIN_SPI0_CS 15u // GPIO15
#define PIN_SPI0_MISO 17u // GPIO17
#define PIN_SPI0_MOSI 16u // GPIO16
#define PIN_SPI0_SCK 14u // GPIO14
#define PINS_SPI0_CS (pin_size_t[]){15u}
#define PINS_SPI0_MISO (pin_size_t[]){17u}
#define PINS_SPI0_MOSI (pin_size_t[]){16u}
#define PINS_SPI0_SCK (pin_size_t[]){14u}

// Wire Interfaces
// ---------------
#define PIN_WIRE1_SCL 20u // GPIO20
Expand Down Expand Up @@ -79,9 +90,11 @@
// -----------------
#define HAS_SERIAL1 1
#define HAS_SERIAL2 1
#define HAS_SPI0 1
#define HAS_WIRE1 1
#define HAS_WIRE2 1
#define SERIAL_INTERFACES_COUNT 2
#define SPI_INTERFACES_COUNT 1
#define WIRE_INTERFACES_COUNT 2

// Arduino pin names
Expand Down
13 changes: 13 additions & 0 deletions boards/variants/generic-bk7252.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
#define NUM_ANALOG_OUTPUTS 4 // PWM & DAC outputs
#define PINS_GPIO_MAX 39 // Last usable GPIO number

// SPI Interfaces
// --------------
#define PIN_SPI0_CS 15u // GPIO15
#define PIN_SPI0_MISO 17u // GPIO17
#define PIN_SPI0_MOSI 16u // GPIO16
#define PIN_SPI0_SCK 14u // GPIO14
#define PINS_SPI0_CS (pin_size_t[]){15u}
#define PINS_SPI0_MISO (pin_size_t[]){17u}
#define PINS_SPI0_MOSI (pin_size_t[]){16u}
#define PINS_SPI0_SCK (pin_size_t[]){14u}

// Wire Interfaces
// ---------------
#define PIN_WIRE1_SCL 20u // GPIO20
Expand Down Expand Up @@ -108,9 +119,11 @@
// -----------------
#define HAS_SERIAL1 1
#define HAS_SERIAL2 1
#define HAS_SPI0 1
#define HAS_WIRE1 1
#define HAS_WIRE2 1
#define SERIAL_INTERFACES_COUNT 2
#define SPI_INTERFACES_COUNT 1
#define WIRE_INTERFACES_COUNT 2

// Arduino pin names
Expand Down
14 changes: 7 additions & 7 deletions boards/variants/generic-rtl8710bn-2mb-468k.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ PinInfo lt_arduino_pin_info_list[PINS_COUNT] = {
{PA_0, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D1: PA05, PWM4, WAKE1
{PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D2: PA06, FCS, SD_D2
{PA_6, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0},
// D2: PA06, ^FCS, SD_D2
{PA_6, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D3: PA07, FD1, SD_D3
{PA_7, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0},
{PA_7, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D4: PA08, FD2, SD_CMD
{PA_8, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0},
{PA_8, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D5: PA09, FD0, SD_CLK
{PA_9, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0},
{PA_9, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D6: PA10, FSCK, SD_D0
{PA_10, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0},
{PA_10, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D7: PA11, FD3, SD_D1
{PA_11, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0},
{PA_11, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D8: PA12, PWM3
{PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D9: PA14, PWM0, SWCLK
Expand Down
6 changes: 0 additions & 6 deletions boards/variants/generic-rtl8710bn-2mb-468k.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@
#define PIN_CS0 19u // PA_19
#define PIN_CS1 19u // PA_19
#define PIN_CTS0 19u // PA_19
#define PIN_FCS 6u // PA_6
#define PIN_FD0 9u // PA_9
#define PIN_FD1 7u // PA_7
#define PIN_FD2 8u // PA_8
#define PIN_FD3 11u // PA_11
#define PIN_FSCK 10u // PA_10
#define PIN_MISO0 22u // PA_22
#define PIN_MISO1 22u // PA_22
#define PIN_MOSI0 23u // PA_23
Expand Down
14 changes: 7 additions & 7 deletions boards/variants/generic-rtl8710bn-2mb-788k.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ PinInfo lt_arduino_pin_info_list[PINS_COUNT] = {
{PA_0, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D1: PA05, PWM4, WAKE1
{PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D2: PA06, FCS, SD_D2
{PA_6, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0},
// D2: PA06, ^FCS, SD_D2
{PA_6, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D3: PA07, FD1, SD_D3
{PA_7, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0},
{PA_7, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D4: PA08, FD2, SD_CMD
{PA_8, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0},
{PA_8, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D5: PA09, FD0, SD_CLK
{PA_9, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0},
{PA_9, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D6: PA10, FSCK, SD_D0
{PA_10, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0},
{PA_10, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D7: PA11, FD3, SD_D1
{PA_11, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0},
{PA_11, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D8: PA12, PWM3
{PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D9: PA14, PWM0, SWCLK
Expand Down
6 changes: 0 additions & 6 deletions boards/variants/generic-rtl8710bn-2mb-788k.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@
#define PIN_CS0 19u // PA_19
#define PIN_CS1 19u // PA_19
#define PIN_CTS0 19u // PA_19
#define PIN_FCS 6u // PA_6
#define PIN_FD0 9u // PA_9
#define PIN_FD1 7u // PA_7
#define PIN_FD2 8u // PA_8
#define PIN_FD3 11u // PA_11
#define PIN_FSCK 10u // PA_10
#define PIN_MISO0 22u // PA_22
#define PIN_MISO1 22u // PA_22
#define PIN_MOSI0 23u // PA_23
Expand Down
14 changes: 7 additions & 7 deletions boards/variants/generic-rtl8710bx-4mb-980k.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ PinInfo lt_arduino_pin_info_list[PINS_COUNT] = {
{PA_0, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D1: PA05, PWM4, WAKE1
{PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D2: PA06, FCS, SD_D2
{PA_6, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0},
// D2: PA06, ^FCS, SD_D2
{PA_6, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D3: PA07, FD1, SD_D3
{PA_7, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0},
{PA_7, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D4: PA08, FD2, SD_CMD
{PA_8, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0},
{PA_8, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D5: PA09, FD0, SD_CLK
{PA_9, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0},
{PA_9, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D6: PA10, FSCK, SD_D0
{PA_10, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0},
{PA_10, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D7: PA11, FD3, SD_D1
{PA_11, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0},
{PA_11, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D8: PA12, PWM3
{PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D9: PA14, PWM0, SWCLK
Expand Down
6 changes: 0 additions & 6 deletions boards/variants/generic-rtl8710bx-4mb-980k.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@
#define PIN_CS0 19u // PA_19
#define PIN_CS1 19u // PA_19
#define PIN_CTS0 19u // PA_19
#define PIN_FCS 6u // PA_6
#define PIN_FD0 9u // PA_9
#define PIN_FD1 7u // PA_7
#define PIN_FD2 8u // PA_8
#define PIN_FD3 11u // PA_11
#define PIN_FSCK 10u // PA_10
#define PIN_MISO0 22u // PA_22
#define PIN_MISO1 22u // PA_22
#define PIN_MOSI0 23u // PA_23
Expand Down

0 comments on commit ca8d767

Please sign in to comment.