|
| 1 | +/** |
| 2 | + ******************************************************************************* |
| 3 | + * @file adc/adc_01_base/source/ddl_config.h |
| 4 | + * @brief This file contains HC32 Series Device Driver Library usage management. |
| 5 | + @verbatim |
| 6 | + Change Logs: |
| 7 | + Date Author Notes |
| 8 | + 2020-06-12 Yangjp First version |
| 9 | + @endverbatim |
| 10 | + ******************************************************************************* |
| 11 | + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. |
| 12 | + * |
| 13 | + * This software component is licensed by HDSC under BSD 3-Clause license |
| 14 | + * (the "License"); You may not use this file except in compliance with the |
| 15 | + * License. You may obtain a copy of the License at: |
| 16 | + * opensource.org/licenses/BSD-3-Clause |
| 17 | + * |
| 18 | + ******************************************************************************* |
| 19 | + */ |
| 20 | +#ifndef __DDL_CONFIG_H__ |
| 21 | +#define __DDL_CONFIG_H__ |
| 22 | + |
| 23 | +/******************************************************************************* |
| 24 | + * Include files |
| 25 | + ******************************************************************************/ |
| 26 | + |
| 27 | +/* C binding of definitions if building with C++ compiler */ |
| 28 | +#ifdef __cplusplus |
| 29 | +extern "C" |
| 30 | +{ |
| 31 | +#endif |
| 32 | + |
| 33 | +/******************************************************************************* |
| 34 | + * Global type definitions ('typedef') |
| 35 | + ******************************************************************************/ |
| 36 | + |
| 37 | +/******************************************************************************* |
| 38 | + * Global pre-processor symbols/macros ('#define') |
| 39 | + ******************************************************************************/ |
| 40 | +/* Chip module on-off define */ |
| 41 | +#define DDL_ON (1U) |
| 42 | +#define DDL_OFF (0U) |
| 43 | + |
| 44 | +/** |
| 45 | + * @brief This is the list of modules to be used in the Device Driver Library. |
| 46 | + * Select the modules you need to use to DDL_ON. |
| 47 | + * @note DDL_ICG_ENABLE must be turned on(DDL_ON) to ensure that the chip works |
| 48 | + * properly. |
| 49 | + * @note DDL_UTILITY_ENABLE must be turned on(DDL_ON) if using Device Driver |
| 50 | + * Library. |
| 51 | + * @note DDL_PRINT_ENABLE must be turned on(DDL_ON) if using printf function. |
| 52 | + */ |
| 53 | +#define DDL_ICG_ENABLE (DDL_ON) |
| 54 | +#define DDL_UTILITY_ENABLE (DDL_ON) |
| 55 | +#define DDL_PRINT_ENABLE (DDL_ON) |
| 56 | + |
| 57 | +#define DDL_ADC_ENABLE (DDL_ON) |
| 58 | +#define DDL_AES_ENABLE (DDL_ON) |
| 59 | +#define DDL_CAN_ENABLE (DDL_ON) |
| 60 | +#define DDL_CLK_ENABLE (DDL_ON) |
| 61 | +#define DDL_CMP_ENABLE (DDL_ON) |
| 62 | +#define DDL_CRC_ENABLE (DDL_ON) |
| 63 | +#define DDL_CTC_ENABLE (DDL_ON) |
| 64 | +#define DDL_DAC_ENABLE (DDL_ON) |
| 65 | +#define DDL_DCU_ENABLE (DDL_ON) |
| 66 | +#define DDL_DMA_ENABLE (DDL_ON) |
| 67 | +#define DDL_DMC_ENABLE (DDL_ON) |
| 68 | +#define DDL_DVP_ENABLE (DDL_ON) |
| 69 | +#define DDL_EFM_ENABLE (DDL_ON) |
| 70 | +#define DDL_EMB_ENABLE (DDL_ON) |
| 71 | +#define DDL_ETH_ENABLE (DDL_ON) |
| 72 | +#define DDL_EVENT_PORT_ENABLE (DDL_OFF) |
| 73 | +#define DDL_FCM_ENABLE (DDL_ON) |
| 74 | +#define DDL_FMAC_ENABLE (DDL_ON) |
| 75 | +#define DDL_GPIO_ENABLE (DDL_ON) |
| 76 | +#define DDL_HASH_ENABLE (DDL_ON) |
| 77 | +#define DDL_HRPWM_ENABLE (DDL_ON) |
| 78 | +#define DDL_I2C_ENABLE (DDL_ON) |
| 79 | +#define DDL_I2S_ENABLE (DDL_ON) |
| 80 | +#define DDL_INTERRUPTS_ENABLE (DDL_ON) |
| 81 | +#define DDL_KEYSCAN_ENABLE (DDL_ON) |
| 82 | +#define DDL_MAU_ENABLE (DDL_ON) |
| 83 | +#define DDL_MPU_ENABLE (DDL_ON) |
| 84 | +#define DDL_NFC_ENABLE (DDL_ON) |
| 85 | +#define DDL_OTS_ENABLE (DDL_ON) |
| 86 | +#define DDL_PWC_ENABLE (DDL_ON) |
| 87 | +#define DDL_QSPI_ENABLE (DDL_ON) |
| 88 | +#define DDL_RMU_ENABLE (DDL_ON) |
| 89 | +#define DDL_RTC_ENABLE (DDL_ON) |
| 90 | +#define DDL_SDIOC_ENABLE (DDL_ON) |
| 91 | +#define DDL_SMC_ENABLE (DDL_ON) |
| 92 | +#define DDL_SPI_ENABLE (DDL_ON) |
| 93 | +#define DDL_SRAM_ENABLE (DDL_ON) |
| 94 | +#define DDL_SWDT_ENABLE (DDL_ON) |
| 95 | +#define DDL_TMR0_ENABLE (DDL_ON) |
| 96 | +#define DDL_TMR2_ENABLE (DDL_ON) |
| 97 | +#define DDL_TMR4_ENABLE (DDL_ON) |
| 98 | +#define DDL_TMR6_ENABLE (DDL_ON) |
| 99 | +#define DDL_TMRA_ENABLE (DDL_ON) |
| 100 | +#define DDL_TRNG_ENABLE (DDL_ON) |
| 101 | +#define DDL_USART_ENABLE (DDL_ON) |
| 102 | +#define DDL_USBFS_ENABLE (DDL_OFF) |
| 103 | +#define DDL_USBHS_ENABLE (DDL_OFF) |
| 104 | +#define DDL_WDT_ENABLE (DDL_ON) |
| 105 | + |
| 106 | +/* BSP on-off define */ |
| 107 | +#define BSP_ON (1U) |
| 108 | +#define BSP_OFF (0U) |
| 109 | + |
| 110 | +/** |
| 111 | + * @brief The following is a list of currently supported BSP boards. |
| 112 | + */ |
| 113 | +#define BSP_EV_HC32F4A0_LQFP176 (1U) |
| 114 | +#define BSP_MS_HC32F4A0_LQFP176_050_MEM (2U) |
| 115 | + |
| 116 | +/** |
| 117 | + * @brief The macro BSP_EV_HC32F4A0 is used to specify the BSP board currently |
| 118 | + * in use. |
| 119 | + * The value should be set to one of the list of currently supported BSP boards. |
| 120 | + * @note If there is no supported BSP board or the BSP function is not used, |
| 121 | + * the value needs to be set to BSP_EV_HC32F4A0. |
| 122 | + */ |
| 123 | +#define BSP_EV_HC32F4A0 (BSP_EV_HC32F4A0) |
| 124 | + |
| 125 | +/** |
| 126 | + * @brief This is the list of BSP components to be used. |
| 127 | + * Select the components you need to use to BSP_ON. |
| 128 | + */ |
| 129 | +#define BSP_CY62167EV30LL_ENABLE (BSP_OFF) |
| 130 | +#define BSP_IS42S16400J7TLI_ENABLE (BSP_OFF) |
| 131 | +#define BSP_IS62WV51216_ENABLE (BSP_OFF) |
| 132 | +#define BSP_MT29F2G08AB_ENABLE (BSP_OFF) |
| 133 | +#define BSP_NT35510_ENABLE (BSP_OFF) |
| 134 | +#define BSP_OV5640_ENABLE (BSP_OFF) |
| 135 | +#define BSP_S29GL064N90TFI03_ENABLE (BSP_OFF) |
| 136 | +#define BSP_TCA9539_ENABLE (BSP_OFF) |
| 137 | +#define BSP_W25QXX_ENABLE (BSP_OFF) |
| 138 | +#define BSP_WM8731_ENABLE (BSP_OFF) |
| 139 | + |
| 140 | +/** |
| 141 | + * @brief Ethernet and PHY Configuration. |
| 142 | + * @note PHY delay these values are based on a 1 ms Systick interrupt. |
| 143 | + */ |
| 144 | +/* MAC ADDRESS */ |
| 145 | +#define ETH_MAC_ADDR0 (2U) |
| 146 | +#define ETH_MAC_ADDR1 (0U) |
| 147 | +#define ETH_MAC_ADDR2 (0U) |
| 148 | +#define ETH_MAC_ADDR3 (0U) |
| 149 | +#define ETH_MAC_ADDR4 (0U) |
| 150 | +#define ETH_MAC_ADDR5 (0U) |
| 151 | + |
| 152 | +/* Ethernet driver buffers size and count */ |
| 153 | +#define ETH_TXBUF_SIZE (ETH_PACKET_MAX_SIZE) /* Buffer size for receive */ |
| 154 | +#define ETH_RXBUF_SIZE (ETH_PACKET_MAX_SIZE) /* Buffer size for transmit */ |
| 155 | +#define ETH_TXBUF_NUMBER (4UL) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ |
| 156 | +#define ETH_RXBUF_NUMBER (4UL) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ |
| 157 | + |
| 158 | +/* PHY Address*/ |
| 159 | +#define PHY_ADDRESS (0x00U) /* RTL8201F */ |
| 160 | + |
| 161 | +/* PHY Configuration delay */ |
| 162 | +#define PHY_HW_RESET_DELAY (0x0000003FUL) |
| 163 | +#define PHY_RESET_DELAY (0x0000007FUL) |
| 164 | +#define PHY_CONFIG_DELAY (0x0000003FUL) |
| 165 | +#define PHY_READ_TIMEOUT (0x00000005UL) |
| 166 | +#define PHY_WRITE_TIMEOUT (0x00000005UL) |
| 167 | + |
| 168 | +/* Common PHY Registers */ |
| 169 | +#define PHY_BCR (0x00U) /*!< Basic Control Register */ |
| 170 | +#define PHY_BSR (0x01U) /*!< Basic Status Register */ |
| 171 | + |
| 172 | +#define PHY_SOFT_RESET (0x8000U) /*!< PHY Soft Reset */ |
| 173 | +#define PHY_LOOPBACK (0x4000U) /*!< Select loop-back mode */ |
| 174 | +#define PHY_FULLDUPLEX_100M (0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ |
| 175 | +#define PHY_HALFDUPLEX_100M (0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ |
| 176 | +#define PHY_FULLDUPLEX_10M (0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ |
| 177 | +#define PHY_HALFDUPLEX_10M (0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ |
| 178 | +#define PHY_AUTONEGOTIATION (0x1000U) /*!< Enable auto-negotiation function */ |
| 179 | +#define PHY_POWERDOWN (0x0800U) /*!< Select the power down mode */ |
| 180 | +#define PHY_ISOLATE (0x0400U) /*!< Isolate PHY from MII */ |
| 181 | +#define PHY_RESTART_AUTONEGOTIATION (0x0200U) /*!< Restart auto-negotiation function */ |
| 182 | + |
| 183 | +#define PHY_100BASE_TX_FD (0x4000U) /*!< 100Base-TX full duplex support */ |
| 184 | +#define PHY_100BASE_TX_HD (0x2000U) /*!< 100Base-TX half duplex support */ |
| 185 | +#define PHY_10BASE_T_FD (0x1000U) /*!< 10Base-T full duplex support */ |
| 186 | +#define PHY_10BASE_T_HD (0x0800U) /*!< 10Base-T half duplex support */ |
| 187 | +#define PHY_AUTONEGO_COMPLETE (0x0020U) /*!< Auto-Negotiation process completed */ |
| 188 | +#define PHY_LINK_STATUS (0x0004U) /*!< Valid link established */ |
| 189 | +#define PHY_JABBER_DETECTION (0x0002U) /*!< Jabber condition detected */ |
| 190 | + |
| 191 | +/** |
| 192 | + * @brief External clock source for I2S peripheral |
| 193 | + */ |
| 194 | +#ifndef I2S_EXT_CLK_FREQ |
| 195 | + #define I2S_EXT_CLK_FREQ (12288000UL) /*!< Value of the external oscillator */ |
| 196 | +#endif /* I2S_EXT_CLK_FREQ */ |
| 197 | + |
| 198 | +/******************************************************************************* |
| 199 | + * Global variable definitions ('extern') |
| 200 | + ******************************************************************************/ |
| 201 | + |
| 202 | +/******************************************************************************* |
| 203 | + * Global function prototypes (definition in C source) |
| 204 | + ******************************************************************************/ |
| 205 | + |
| 206 | +#ifdef __cplusplus |
| 207 | +} |
| 208 | +#endif |
| 209 | + |
| 210 | +#endif /* __DDL_CONFIG_H__ */ |
| 211 | + |
| 212 | +/******************************************************************************* |
| 213 | + * EOF (not truncated) |
| 214 | + ******************************************************************************/ |
0 commit comments