NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
Loading...
Searching...
No Matches
config.h
Go to the documentation of this file.
1// ================================================================================ //
2// The NEORV32 RISC-V Processor - https://github.com/stnolting/neorv32 //
3// Copyright (c) NEORV32 contributors. //
4// Copyright (c) 2020 - 2025 Stephan Nolting. All rights reserved. //
5// Licensed under the BSD-3-Clause license, see LICENSE for details. //
6// SPDX-License-Identifier: BSD-3-Clause //
7// ================================================================================ //
8
13
14#ifndef CONFIG_H
15#define CONFIG_H
16
17/**********************************************************************
18 * Processor memory layout
19 **********************************************************************/
20
21// Memory base address for the executable
22#ifndef EXE_BASE_ADDR
23#define EXE_BASE_ADDR 0x00000000U
24#endif
25
26/**********************************************************************
27 * UART configuration
28 **********************************************************************/
29
30// Set to 0 to disable UART
31#ifndef UART_EN
32#define UART_EN 1
33#endif
34
35// UART BAUD rate for serial
36#ifndef UART_BAUD
37#define UART_BAUD 19200
38#endif
39
40// Set to 1 to enable UART RTS/CTS hardware flow control
41#ifndef UART_HW_HANDSHAKE_EN
42#define UART_HW_HANDSHAKE_EN 0
43#endif
44
45// Print splash screen
46#ifndef UART_PRINT_SPLASH_EN
47#define UART_PRINT_SPLASH_EN 1
48#endif
49
50/**********************************************************************
51 * Status LED
52 **********************************************************************/
53
54// Set to 0 to disable bootloader status LED at GPIO.gpio_o(STATUS_LED_PIN)
55#ifndef STATUS_LED_EN
56#define STATUS_LED_EN 1
57#endif
58
59// GPIO output pin for high-active bootloader status LED
60#ifndef STATUS_LED_PIN
61#define STATUS_LED_PIN 0
62#endif
63
64/**********************************************************************
65 * Auto-boot configuration
66 **********************************************************************/
67
68// Enable auto-boot
69#ifndef AUTO_BOOT_EN
70#define AUTO_BOOT_EN 1
71#endif
72
73// Time until the auto-boot sequence starts (in seconds)
74#ifndef AUTO_BOOT_TIMEOUT
75#define AUTO_BOOT_TIMEOUT 10
76#endif
77
78/**********************************************************************
79 * SPI configuration
80 **********************************************************************/
81
82// Enable SPI (default) including SPI flash boot options
83#ifndef SPI_EN
84#define SPI_EN 1
85#endif
86
87// SPI flash chip select
88#ifndef SPI_FLASH_CS
89#define SPI_FLASH_CS 0
90#endif
91
92// SPI flash clock prescaler, see #NEORV32_CLOCK_PRSC_enum
93#ifndef SPI_FLASH_CLK_PRSC
94#define SPI_FLASH_CLK_PRSC CLK_PRSC_64
95#endif
96
97// SPI flash base address (hast to be aligned to the sector size)
98#ifndef SPI_FLASH_BASE_ADDR
99#define SPI_FLASH_BASE_ADDR 0x00400000U
100#endif
101
102// SPI flash address bytes (1,2,3,4)
103#ifndef SPI_FLASH_ADDR_BYTES
104#define SPI_FLASH_ADDR_BYTES 3
105#endif
106
107// SPI flash sector size in bytes
108#ifndef SPI_FLASH_SECTOR_SIZE
109#define SPI_FLASH_SECTOR_SIZE 65536
110#endif
111
112/**********************************************************************
113 * TWI configuration
114 **********************************************************************/
115
116// Enable TWI for copying to RAM
117#ifndef TWI_EN
118#define TWI_EN 0
119#endif
120
121// TWI clock prescaler, see #NEORV32_CLOCK_PRSC_enum
122#ifndef TWI_CLK_PRSC
123#define TWI_CLK_PRSC CLK_PRSC_1024
124#endif
125
126// TWI clock divider
127#ifndef TWI_CLK_DIV
128#define TWI_CLK_DIV 3
129#endif
130
131// TWI allow clock stretching
132#ifndef TWI_CLK_STRECH_EN
133#define TWI_CLK_STRECH_EN 0
134#endif
135
136// TWI device ID (write address; R/W cleared)
137#ifndef TWI_DEVICE_ID
138#define TWI_DEVICE_ID 0xA0
139#endif
140
141// TWI flash base address (has to 4-byte aligned)
142#ifndef TWI_FLASH_BASE_ADDR
143#define TWI_FLASH_BASE_ADDR 0x00000000U
144#endif
145
146// TWI flash address bytes (1,2,3,4)
147#ifndef TWI_FLASH_ADDR_BYTES
148#define TWI_FLASH_ADDR_BYTES 2
149#endif
150
151// TWI flash bulk write enable
152#ifndef TWI_FLASH_BULK_WRITE_EN
153#define TWI_FLASH_BULK_WRITE_EN 0
154#endif
155
156#endif // CONFIG_H