|
| 1 | +/** |
| 2 | + * @file board_gd32f207c_eval.h |
| 3 | + * |
| 4 | + */ |
| 5 | +/* Copyright (C) 2021-2026 by Arjan van Vught mailto:info@gd32-dmx.org |
| 6 | + * |
| 7 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 8 | + * of this software and associated documentation files (the "Software"), to deal |
| 9 | + * in the Software without restriction, including without limitation the rights |
| 10 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 11 | + * copies of the Software, and to permit persons to whom the Software is |
| 12 | + * furnished to do so, subject to the following conditions: |
| 13 | +
|
| 14 | + * The above copyright notice and this permission notice shall be included in |
| 15 | + * all copies or substantial portions of the Software. |
| 16 | +
|
| 17 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 18 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 20 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 21 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 22 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 23 | + * THE SOFTWARE. |
| 24 | + */ |
| 25 | + |
| 26 | +#ifndef DMX_BOARD_GD32F207C_EVAL_H_ |
| 27 | +#define DMX_BOARD_GD32F207C_EVAL_H_ |
| 28 | + |
| 29 | +#include <cstdint> |
| 30 | + |
| 31 | +#include "gd32.h" // IWYU pragma: keep |
| 32 | + |
| 33 | +#define DMX_MAX_PORTS 2 |
| 34 | + |
| 35 | +namespace dmx::config { |
| 36 | +namespace max { |
| 37 | +inline constexpr uint32_t kPorts = DMX_MAX_PORTS; |
| 38 | +} // namespace max |
| 39 | + |
| 40 | +// #define DMX_USE_USART0 |
| 41 | +#define DMX_USE_USART1 |
| 42 | +#define DMX_USE_USART2 |
| 43 | +// #define DMX_USE_UART3 |
| 44 | +// #define DMX_USE_UART4 |
| 45 | +// #define DMX_USE_USART5 |
| 46 | +// #define DMX_USE_UART6 |
| 47 | +// #define DMX_USE_UART7 |
| 48 | + |
| 49 | +// inline constexpr auto kUsart0Port = 0; |
| 50 | +inline constexpr auto kUsart1Port = 0; |
| 51 | +inline constexpr auto kUsart2Port = 1; |
| 52 | +// inline constexpr auto kUart3Port = 2; |
| 53 | +// inline constexpr auto kUart4Port = 3; |
| 54 | +// inline constexpr auto kUsart5Port = 5; |
| 55 | +// inline constexpr auto kUart6Port = 6; |
| 56 | +// inline constexpr auto kUart7Port = 7; |
| 57 | + |
| 58 | +inline constexpr auto kDirPort0GpioPort = GPIOE; |
| 59 | +inline constexpr auto kDirPort0GpioPin = GPIO_PIN_9; |
| 60 | + |
| 61 | +inline constexpr auto kDirPort1GpioPort = GPIOE; |
| 62 | +inline constexpr auto kDirPort1GpioPin = GPIO_PIN_10; |
| 63 | + |
| 64 | +inline constexpr auto kDirPort2GpioPort = GPIOE; |
| 65 | +inline constexpr auto kDirPort2GpioPin = GPIO_PIN_11; |
| 66 | + |
| 67 | +inline constexpr auto kDirPort3GpioPort = GPIOE; |
| 68 | +inline constexpr auto kDirPort3GpioPin = GPIO_PIN_12; |
| 69 | + |
| 70 | +inline constexpr auto kDirPort4GpioPort = GPIOE; |
| 71 | +inline constexpr auto kDirPort4GpioPin = GPIO_PIN_13; |
| 72 | + |
| 73 | +inline constexpr auto kDirPort5GpioPort = GPIOE; |
| 74 | +inline constexpr auto kDirPort5GpioPin = GPIO_PIN_14; |
| 75 | + |
| 76 | +inline constexpr auto kDirPort6GpioPort = GPIOE; |
| 77 | +inline constexpr auto kDirPort6GpioPin = GPIO_PIN_15; |
| 78 | + |
| 79 | +inline constexpr auto kDirPort7GpioPort = GPIOB; |
| 80 | +inline constexpr auto kDirPort7GpioPin = GPIO_PIN_15; |
| 81 | +} // namespace dmx::config |
| 82 | +#endif // DMX_BOARD_GD32F207C_EVAL_H_ |
0 commit comments