HPM SDK
HPMicro Software Development Kit
hpm_soc_feature.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2023 HPMicro
3
*
4
* SPDX-License-Identifier: BSD-3-Clause
5
*
6
*/
7
8
#ifndef HPM_SOC_FEATURE_H
9
#define HPM_SOC_FEATURE_H
10
11
#include "
hpm_soc.h
"
12
#include "
hpm_soc_ip_feature.h
"
13
14
/*
15
* PLIC feature
16
*/
17
#define PLIC_SUPPORT_EDGE_TRIGGER (1)
18
19
/*
20
* PMP/PMA Feature
21
*/
22
#define PMP_SUPPORT_PMA (0)
23
24
/*
25
* I2C Section
26
*/
27
#define I2C_SOC_FIFO_SIZE (4U)
28
#define I2C_SOC_TRANSFER_COUNT_MAX (4096U)
29
30
/*
31
* PMIC Section
32
*/
33
#define PCFG_SOC_LDO1P1_MIN_VOLTAGE_IN_MV (700U)
34
#define PCFG_SOC_LDO1P1_MAX_VOLTAGE_IN_MV (1320U)
35
#define PCFG_SOC_LDO2P5_MIN_VOLTAGE_IN_MV (2125)
36
#define PCFG_SOC_LDO2P5_MAX_VOLTAGE_IN_MV (2900U)
37
#define PCFG_SOC_DCDC_MIN_VOLTAGE_IN_MV (600U)
38
#define PCFG_SOC_DCDC_MAX_VOLTAGE_IN_MV (1375U)
39
40
/*
41
* PLLCTL Section
42
*/
43
#define PLLCTL_SOC_PLL_MAX_COUNT (2U)
44
/* PLL reference clock in hz */
45
#define PLLCTL_SOC_PLL_REFCLK_FREQ (24U * 1000000UL)
46
/* only PLL1 and PLL2 have DIV0, DIV1 */
47
#define PLLCTL_SOC_PLL_HAS_DIV0(x) ((((x) == 1) || ((x) == 2)) ? 1 : 0)
48
#define PLLCTL_SOC_PLL_HAS_DIV1(x) ((((x) == 1) || ((x) == 2)) ? 1 : 0)
49
50
51
/*
52
* PWM Section
53
*/
54
#define PWM_SOC_PWM_MAX_COUNT (8U)
55
#define PWM_SOC_CMP_MAX_COUNT (24U)
56
#define PWM_SOC_OUTPUT_TO_PWM_MAX_COUNT (8U)
57
58
/*
59
* DMA Section
60
*/
61
#define DMA_SOC_TRANSFER_WIDTH_MAX(x) (DMA_TRANSFER_WIDTH_WORD)
62
#define DMA_SOC_TRANSFER_PER_BURST_MAX(x) (DMA_NUM_TRANSFER_PER_BURST_128T)
63
#define DMA_SOC_CHANNEL_NUM (32U)
64
#define DMA_SOC_MAX_COUNT (1U)
65
#define DMA_SOC_CHN_TO_DMAMUX_CHN(x, n) (DMAMUX_MUXCFG_HDMA_MUX0 + n)
66
#define DMA_SOC_HAS_IDLE_FLAG (1U)
67
68
/*
69
* DMAMUX Section
70
*/
71
#define DMAMUX_SOC_WRITEONLY (1U)
72
73
/*
74
* USB Section
75
*/
76
#define USB_SOC_MAX_COUNT (1U)
77
78
#define USB_SOC_DCD_QTD_NEXT_INVALID (1U)
79
#define USB_SOC_DCD_QHD_BUFFER_COUNT (5U)
80
#define USB_SOC_DCD_MAX_ENDPOINT_COUNT (16U)
81
#ifndef USB_SOC_DCD_QTD_COUNT_EACH_ENDPOINT
82
#define USB_SOC_DCD_QTD_COUNT_EACH_ENDPOINT (8U)
83
#endif
84
#define USB_SOC_DCD_MAX_QTD_COUNT (USB_SOC_DCD_MAX_ENDPOINT_COUNT * 2U * USB_SOC_DCD_QTD_COUNT_EACH_ENDPOINT)
85
#define USB_SOS_DCD_MAX_QHD_COUNT (USB_SOC_DCD_MAX_ENDPOINT_COUNT * 2U)
86
#define USB_SOC_DCD_DATA_RAM_ADDRESS_ALIGNMENT (2048U)
87
88
#define USB_SOC_HCD_FRAMELIST_MAX_ELEMENTS (1024U)
89
90
/*
91
* ADC Section
92
*/
93
#define ADC_SOC_IP_VERSION (3U)
94
#define ADC_SOC_SEQ_MAX_LEN (16U)
95
#define ADC_SOC_SEQ_HCFG_EN (1U)
96
#define ADC_SOC_MAX_TRIG_CH_LEN (4U)
97
#define ADC_SOC_MAX_TRIG_CH_NUM (11U)
98
#define ADC_SOC_DMA_ADDR_ALIGNMENT (4U)
99
#define ADC_SOC_CONFIG_INTEN_CHAN_BIT_SIZE (8U)
100
#define ADC_SOC_BUSMODE_ENABLE_CTRL_SUPPORT (1U)
101
#define ADC_SOC_PREEMPT_ENABLE_CTRL_SUPPORT (1U)
102
#define ADC_SOC_SEQ_MAX_DMA_BUFF_LEN_IN_4BYTES (16777216U)
103
#define ADC_SOC_PMT_MAX_DMA_BUFF_LEN_IN_4BYTES (48U)
104
105
#define ADC16_SOC_PARAMS_LEN (34U)
106
#define ADC16_SOC_MAX_CH_NUM (15U)
107
#define ADC16_SOC_MAX_SAMPLE_VALUE (65535U)
108
#define ADC16_SOC_MAX_CONV_CLK_NUM (21U)
109
110
/*
111
* SYSCTL Section
112
*/
113
#define SYSCTL_SOC_CPU_GPR_COUNT (14U)
114
#define SYSCTL_SOC_MONITOR_SLICE_COUNT (4U)
115
116
/*
117
* PTPC Section
118
*/
119
#define PTPC_SOC_TIMER_MAX_COUNT (2U)
120
121
/*
122
* SDP Section
123
*/
124
#define SDP_REGISTER_DESCRIPTOR_COUNT (1U)
125
#define SDP_HAS_SM3_SUPPORT (1U)
126
#define SDP_HAS_SM4_SUPPORT (1U)
127
128
/*
129
* SOC Privilege mode
130
*/
131
#define SOC_HAS_S_MODE (0U)
132
133
/*
134
* DAC Section
135
*/
136
#define DAC_SOC_BUFF_ALIGNED_SIZE (32U)
137
#define DAC_SOC_MAX_DATA (4095U)
138
#define DAC_SOC_MAX_BUFF_COUNT (65536U)
139
#define DAC_SOC_MAX_OUTPUT_FREQ (1000000UL)
140
141
/*
142
* UART Section
143
*/
144
#define UART_SOC_FIFO_SIZE (16U)
145
#define UART_SOC_OVERSAMPLE_MAX (30U)
/* only support 30 oversample rate for rx idle detection */
146
147
/*
148
* SPI Section
149
*/
150
#define SPI_SOC_TRANSFER_COUNT_MAX (0xFFFFFFFFU)
151
#define SPI_SOC_FIFO_DEPTH (8U)
152
153
/*
154
* OTP Section
155
*/
156
#define OTP_SOC_UUID_IDX (88U)
157
#define OTP_SOC_UUID_LEN (16U)
/* in bytes */
158
159
/*
160
* PWM Section
161
*/
162
#define PWM_SOC_HRPWM_SUPPORT (0U)
163
#define PWM_SOC_SHADOW_TRIG_SUPPORT (0U)
164
#define PWM_SOC_TIMER_RESET_SUPPORT (1U)
165
166
/*
167
* TRGM section
168
*/
169
#define TRGM_SOC_HAS_FILTER_SHIFT (1U)
170
#define TRGM_SOC_HAS_DMAMUX_EN (1U)
171
#define TRGM_SOC_HAS_ADC_MATRIX_SEL (1U)
172
#define TRGM_SOC_HAS_DAC_MATRIX_SEL (1U)
173
#define TRGM_SOC_HAS_POS_MATRIX_SEL (1U)
174
175
/*
176
* MCAN Section
177
*/
178
#define MCAN_SOC_MAX_COUNT (4U)
179
#define MCAN_SOC_MSG_BUF_IN_IP (0U)
180
#define MCAN_SOC_MSG_BUF_IN_AHB_RAM (1U)
181
#define CAN_SOC_MAX_COUNT MCAN_SOC_MAX_COUNT
182
183
/*
184
* EWDG Section
185
*/
186
#define EWDG_SOC_CLK_DIV_VAL_MAX (5U)
187
#define EWDG_SOC_OVERTIME_REG_WIDTH (16U)
188
#define EWDG_SOC_SUPPORT_TIMEOUT_INTERRUPT (1)
189
#define EWDG_TIMEOUT_INTERRUPT_REQUIRE_EDGE_TRIGGER (1)
190
191
/*
192
* Sync Timer
193
*/
194
#define SYNT_SOC_HAS_TIMESTAMP (1U)
195
196
/*
197
* GPIO
198
*/
199
#define GPIO_SOC_HAS_EDGE_BOTH_INTERRUPT (1U)
200
204
#define OPAMP_SOC_HAS_MAX_PRESET_CHN_NUM (7U)
205
209
#define PLB_SOC_TYPEA_TRGM_INPUT0 (TRGM_TRGOCFG_PLB_IN_00)
210
#define PLB_SOC_TYPEA_TRGM_OUTPUT0 (HPM_TRGM0_INPUT_SRC_PLB_OUT00)
211
#define PLB_SOC_TYPEB_TRGM_INPUT0 (TRGM_TRGOCFG_PLB_IN_16)
212
#define PLB_SOC_TYPEB_TRGM_OUTPUT0 (HPM_TRGM0_INPUT_SRC_PLB_OUT16)
213
214
215
#endif
/* HPM_SOC_FEATURE_H */
hpm_soc.h
hpm_soc_ip_feature.h
soc
HPM5300
HPM5361
hpm_soc_feature.h
Generated on Tue Dec 31 2024 02:57:16 for HPM SDK by
1.9.1