From b8bce07b84b7009d9d65add91d84b3bce68de1d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Mon, 9 Mar 2020 14:10:35 +0100 Subject: [PATCH] busvoodoo_global: define dongle IO pins --- lib/busvoodoo_global.c | 7 +++++++ lib/busvoodoo_global.h | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/lib/busvoodoo_global.c b/lib/busvoodoo_global.c index b6cd346..0f45724 100644 --- a/lib/busvoodoo_global.c +++ b/lib/busvoodoo_global.c @@ -67,10 +67,17 @@ const char* busvoodoo_global_pinout_io[10] = {NULL, NULL, NULL, NULL, NULL, NULL const char* busvoodoo_global_pinout_rscan[5] = {NULL, NULL, NULL, NULL, NULL}; #endif +#if BUSVOODOO_HARDWARE_VERSION != 2 const char* busvoodoo_io_names[13] = {"I2C_SMBA/SPI_NSS/I2S_WS/UART1_CK", "SDIO_CMD", "UART1_CTS/SPI_SCK/I2S_CK", "SDIO_D3/UART2_RX", "I2C_SDA/UART1_RX", "SDIO_D0", "SPI_MOSI/I2S_SD", "SDIO_CK", "I2C_SCL/UART1_TX", "SDIO_D1", "I2S_MCK", "UART1_RTS/SPI_MISO", "SDIO_D2/UART2_TX"}; const uint32_t busvoodoo_io_ports[13] = {GPIOB, GPIOD, GPIOB, GPIOC, GPIOB, GPIOC, GPIOB, GPIOC, GPIOB, GPIOC, GPIOC, GPIOB, GPIOC}; const uint32_t busvoodoo_io_pins[13] = {GPIO12, GPIO2, GPIO13, GPIO11, GPIO11, GPIO8, GPIO15, GPIO12, GPIO10, GPIO9, GPIO6, GPIO14, GPIO10}; const uint8_t busvoodoo_io_groups[13] = {6, 6, 4, 4, 1, 1, 5, 5, 2, 2, 3, 3, 3}; +#else +const char* busvoodoo_io_names[8] = {"I2C_SDA/UART_RX", "I2C_SCL/UART_TX", "UART_RTS/SPI_MISO", "UART_CTS/SPI_SCK", "SPI_MOSI", "I2C_SMBA/SPI_NSS/UART_CK", "ICP_RX", "ICP_TX"}; +const uint32_t busvoodoo_io_ports[8] = {GPIOB, GPIOB, GPIOB, GPIOB, GPIOB, GPIOB, GPIOA, GPIOA}; +const uint32_t busvoodoo_io_pins[8] = {GPIO11, GPIO10, GPIO14, GPIO13, GPIO15, GPIO12, GPIO10, GPIO9}; +const uint8_t busvoodoo_io_groups[8] = {1, 2, 3, 4, 5, 6, 1, 2}; +#endif bool busvoodoo_full = false; char busvoodoo_version = '0'; diff --git a/lib/busvoodoo_global.h b/lib/busvoodoo_global.h index 2aec552..8a4a8fc 100644 --- a/lib/busvoodoo_global.h +++ b/lib/busvoodoo_global.h @@ -143,10 +143,17 @@ struct busvoodoo_mode_t { /** @defgroup busvoodoo_io I/O connector pin definition * @{ */ +#if BUSVOODOO_HARDWARE_VERSION != 2 extern const char* busvoodoo_io_names[13]; /**< I/O individual signal names */ extern const uint32_t busvoodoo_io_ports[13]; /**< port of individual signals */ extern const uint32_t busvoodoo_io_pins[13]; /**< pin of individual signals */ extern const uint8_t busvoodoo_io_groups[13]; /**< which I/O pin (group) does the signal belong to */ +#else +extern const char* busvoodoo_io_names[8]; /**< I/O individual signal names */ +extern const uint32_t busvoodoo_io_ports[8]; /**< port of individual signals */ +extern const uint32_t busvoodoo_io_pins[8]; /**< pin of individual signals */ +extern const uint8_t busvoodoo_io_groups[8]; /**< which I/O pin (group) does the signal belong to */ +#endif /** @} */ /** is the BusVoodoo board fully populated (with HV voltage regulator, RS-232, RS-485, CAN transceiver on the back side) */