|
| 1 | +/**************************************************************************** |
| 2 | + * boards/arm/ht32f491x3/esk32/include/board.h |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: Apache-2.0 |
| 5 | + * |
| 6 | + * Licensed to the Apache Software Foundation (ASF) under one or more |
| 7 | + * contributor license agreements. See the NOTICE file distributed with |
| 8 | + * this work for additional information regarding copyright ownership. The |
| 9 | + * ASF licenses this file to you under the Apache License, Version 2.0 (the |
| 10 | + * "License"); you may not use this file except in compliance with the |
| 11 | + * License. You may obtain a copy of the License at |
| 12 | + * |
| 13 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 14 | + * |
| 15 | + * Unless required by applicable law or agreed to in writing, software |
| 16 | + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 17 | + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 18 | + * License for the specific language governing permissions and limitations |
| 19 | + * under the License. |
| 20 | + * |
| 21 | + ****************************************************************************/ |
| 22 | + |
| 23 | +#ifndef __BOARDS_ARM_HT32F491X3_ESK32_INCLUDE_BOARD_H |
| 24 | +#define __BOARDS_ARM_HT32F491X3_ESK32_INCLUDE_BOARD_H |
| 25 | + |
| 26 | +/**************************************************************************** |
| 27 | + * Included Files |
| 28 | + ****************************************************************************/ |
| 29 | + |
| 30 | +#include <nuttx/config.h> |
| 31 | + |
| 32 | +#include <stdbool.h> |
| 33 | +#include <stdint.h> |
| 34 | + |
| 35 | +/**************************************************************************** |
| 36 | + * Board USART Pin Mapping |
| 37 | + ****************************************************************************/ |
| 38 | + |
| 39 | +/* Populate BOARD_USARTx_* for each routed USART on the board. The selected |
| 40 | + * console still comes from CONFIG_USARTx_SERIAL_CONSOLE in the defconfig. |
| 41 | + */ |
| 42 | + |
| 43 | +#define BOARD_USART1_GPIO_CLKEN (1u << 0) |
| 44 | +#define BOARD_USART1_TX_GPIO_BASE 0x40020000u |
| 45 | +#define BOARD_USART1_RX_GPIO_BASE 0x40020000u |
| 46 | +#define BOARD_USART1_TX_PIN 9u |
| 47 | +#define BOARD_USART1_RX_PIN 10u |
| 48 | +#define BOARD_USART1_TX_AF 7u |
| 49 | +#define BOARD_USART1_RX_AF 7u |
| 50 | + |
| 51 | +/**************************************************************************** |
| 52 | + * Board LED Pin Mapping |
| 53 | + ****************************************************************************/ |
| 54 | + |
| 55 | +#define BOARD_LED2_GPIO_CLKEN (1u << 3) |
| 56 | +#define BOARD_LED2_GPIO_BASE 0x40020c00u |
| 57 | +#define BOARD_LED2_GPIO_PIN 13u |
| 58 | + |
| 59 | +#define BOARD_LED3_GPIO_CLKEN (1u << 3) |
| 60 | +#define BOARD_LED3_GPIO_BASE 0x40020c00u |
| 61 | +#define BOARD_LED3_GPIO_PIN 14u |
| 62 | + |
| 63 | +#define BOARD_LED4_GPIO_CLKEN (1u << 3) |
| 64 | +#define BOARD_LED4_GPIO_BASE 0x40020c00u |
| 65 | +#define BOARD_LED4_GPIO_PIN 15u |
| 66 | + |
| 67 | +#define BOARD_LED2 0 |
| 68 | +#define BOARD_LED3 1 |
| 69 | +#define BOARD_LED4 2 |
| 70 | +#define BOARD_NLEDS 3 |
| 71 | + |
| 72 | +#define BOARD_LED2_BIT (1 << BOARD_LED2) |
| 73 | +#define BOARD_LED3_BIT (1 << BOARD_LED3) |
| 74 | +#define BOARD_LED4_BIT (1 << BOARD_LED4) |
| 75 | + |
| 76 | +/**************************************************************************** |
| 77 | + * Public Function Prototypes |
| 78 | + ****************************************************************************/ |
| 79 | + |
| 80 | +void ht32f491x3_clockconfig(void); |
| 81 | +void ht32f491x3_boardinitialize(void); |
| 82 | + |
| 83 | +int board_app_initialize(uintptr_t arg); |
| 84 | + |
| 85 | +#if defined(CONFIG_USERLED) && !defined(CONFIG_ARCH_LEDS) |
| 86 | +uint32_t board_userled_initialize(void); |
| 87 | +void board_userled(int led, bool ledon); |
| 88 | +void board_userled_all(uint32_t ledset); |
| 89 | +#endif |
| 90 | + |
| 91 | +#ifdef CONFIG_BOARD_LATE_INITIALIZE |
| 92 | +void board_late_initialize(void); |
| 93 | +#endif |
| 94 | + |
| 95 | +#endif /* __BOARDS_ARM_HT32F491X3_ESK32_INCLUDE_BOARD_H */ |
0 commit comments