cpu_conf.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2020 Koen Zandberg <koen@bergzand.net>
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
18 #include "vendor/gd32vf103_core.h"
19 #include "cpu_conf_common.h"
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 #define CLIC_NUM_INTERRUPTS (ECLIC_NUM_INTERRUPTS)
26 #define CLIC_BASE_ADDR (ECLIC_CTRL_ADDR)
27 #define CPU_DEFAULT_IRQ_PRIO (0xFF)
28 
32 #define HAVE_CSR_MIE (0)
33 
38 #define FLASHPAGE_SIZE (1024U)
39 #define FLASHPAGE_NUMOF (128U)
40 #define FLASHPAGE_WRITE_BLOCK_SIZE (2U)
41 #define FLASHPAGE_WRITE_BLOCK_ALIGNMENT (4U)
42 #define CPU_FLASH_BASE 0x08000000
48 typedef enum {
56  SWJ_CFG_NO_NJTRST = 1U << AFIO_PCF0_SWJ_CFG_Pos,
60  SWJ_CFG_NO_JTAG = 4U << AFIO_PCF0_SWJ_CFG_Pos,
62 
63 #ifndef CONFIG_AFIO_PCF0_SWJ_CFG
70 #define CONFIG_AFIO_PCF0_SWJ_CFG SWJ_CFG_NO_NJTRST
71 #endif
72 
73 #ifdef __cplusplus
74 }
75 #endif
76 
afio_pcf0_swj_cfg_t
Possible values of the SWJ_CFG field in the AFIO->PCF0 register.
Definition: cpu_conf.h:48
@ SWJ_CFG_NO_NJTRST
JTAG enabled, but NJTRST disabled and pin PB4 usable as GPIO.
Definition: cpu_conf.h:56
@ SWJ_CFG_FULL_JTAG
Full JTAG interface (reset value)
Definition: cpu_conf.h:52
@ SWJ_CFG_NO_JTAG
JTAG disabled, all debug pins usable as GPIOs.
Definition: cpu_conf.h:60