Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
Loading...
Searching...
No Matches
ch32v003_swio.h File Reference

Go to the source code of this file.

Data Structures

struct  SWIOState
 

Macros

#define R_GLITCH_HIGH
 
#define STTAG(x)
 
#define IRAM   IRAM_ATTR
 
#define DMDATA0   0x04
 
#define DMDATA1   0x05
 
#define DMCONTROL   0x10
 
#define DMSTATUS   0x11
 
#define DMHARTINFO   0x12
 
#define DMABSTRACTCS   0x16
 
#define DMCOMMAND   0x17
 
#define DMABSTRACTAUTO   0x18
 
#define DMPROGBUF0   0x20
 
#define DMPROGBUF1   0x21
 
#define DMPROGBUF2   0x22
 
#define DMPROGBUF3   0x23
 
#define DMPROGBUF4   0x24
 
#define DMPROGBUF5   0x25
 
#define DMPROGBUF6   0x26
 
#define DMPROGBUF7   0x27
 
#define DMCPBR   0x7C
 
#define DMCFGR   0x7D
 
#define DMSHDWCFGR   0x7E
 
#define FLASH_STATR_WRPRTERR   ((uint8_t)0x10)
 
#define CR_PAGE_PG   ((uint32_t)0x00010000)
 
#define CR_BUF_LOAD   ((uint32_t)0x00040000)
 
#define FLASH_CTLR_MER   ((uint16_t)0x0004) /* Mass Erase */
 
#define CR_STRT_Set   ((uint32_t)0x00000040)
 
#define CR_PAGE_ER   ((uint32_t)0x00020000)
 
#define CR_BUF_RST   ((uint32_t)0x00080000)
 

Enumerations

enum  RiscVChip {
  CHIP_UNKNOWN = 0x00 , CHIP_CH32V10x = 0x01 , CHIP_CH57x = 0x02 , CHIP_CH56x = 0x03 ,
  CHIP_CH32V20x = 0x05 , CHIP_CH32V30x = 0x06 , CHIP_CH58x = 0x07 , CHIP_CH32V003 = 0x09 ,
  CHIP_CH32X03x = 0x0d
}
 

Data Structure Documentation

◆ SWIOState

struct SWIOState
Data Fields
int t1coeff
int pinmaskD
int pinmaskC
int opmode
enum RiscVChip target_chip_type
int sectorsize
uint32_t statetag
uint32_t lastwriteflags
uint32_t currentstateval
uint32_t flash_unlocked
uint32_t autoincrement

Macro Definition Documentation

◆ R_GLITCH_HIGH

#define R_GLITCH_HIGH

◆ STTAG

#define STTAG ( x)
Value:
(*((uint32_t*)(x)))

◆ IRAM

#define IRAM   IRAM_ATTR

◆ DMDATA0

#define DMDATA0   0x04

◆ DMDATA1

#define DMDATA1   0x05

◆ DMCONTROL

#define DMCONTROL   0x10

◆ DMSTATUS

#define DMSTATUS   0x11

◆ DMHARTINFO

#define DMHARTINFO   0x12

◆ DMABSTRACTCS

#define DMABSTRACTCS   0x16

◆ DMCOMMAND

#define DMCOMMAND   0x17

◆ DMABSTRACTAUTO

#define DMABSTRACTAUTO   0x18

◆ DMPROGBUF0

#define DMPROGBUF0   0x20

◆ DMPROGBUF1

#define DMPROGBUF1   0x21

◆ DMPROGBUF2

#define DMPROGBUF2   0x22

◆ DMPROGBUF3

#define DMPROGBUF3   0x23

◆ DMPROGBUF4

#define DMPROGBUF4   0x24

◆ DMPROGBUF5

#define DMPROGBUF5   0x25

◆ DMPROGBUF6

#define DMPROGBUF6   0x26

◆ DMPROGBUF7

#define DMPROGBUF7   0x27

◆ DMCPBR

#define DMCPBR   0x7C

◆ DMCFGR

#define DMCFGR   0x7D

◆ DMSHDWCFGR

#define DMSHDWCFGR   0x7E

◆ FLASH_STATR_WRPRTERR

#define FLASH_STATR_WRPRTERR   ((uint8_t)0x10)

◆ CR_PAGE_PG

#define CR_PAGE_PG   ((uint32_t)0x00010000)

◆ CR_BUF_LOAD

#define CR_BUF_LOAD   ((uint32_t)0x00040000)

◆ FLASH_CTLR_MER

#define FLASH_CTLR_MER   ((uint16_t)0x0004) /* Mass Erase */

◆ CR_STRT_Set

#define CR_STRT_Set   ((uint32_t)0x00000040)

◆ CR_PAGE_ER

#define CR_PAGE_ER   ((uint32_t)0x00020000)

◆ CR_BUF_RST

#define CR_BUF_RST   ((uint32_t)0x00080000)

Enumeration Type Documentation

◆ RiscVChip

enum RiscVChip
Enumerator
CHIP_UNKNOWN 
CHIP_CH32V10x 
CHIP_CH57x 
CHIP_CH56x 
CHIP_CH32V20x 
CHIP_CH32V30x 
CHIP_CH58x 
CHIP_CH32V003 
CHIP_CH32X03x