Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
|
Macros | |
#define | MAX_IN_TIMEOUT 1000 |
#define | DisableISR() |
#define | EnableISR() |
#define | GPIO_VAR_W1TC (*GPIO_VAR_W1TC_R) |
#define | GPIO_VAR_W1TS (*GPIO_VAR_W1TS_R) |
#define | GPIO_VAR_ENABLE_W1TC (*GPIO_VAR_ENABLE_W1TC_R) |
#define | GPIO_VAR_ENABLE_W1TS (*GPIO_VAR_ENABLE_W1TS_R) |
#define | GPIO_VAR_IN (*GPIO_VAR_IN_R) |
#define | IO_MUX_REG(x) |
#define | XIO_MUX_REG(x) |
#define | GPIO_NUM(x) |
#define | XGPIO_NUM(x) |
Functions | |
int | uprintf (const char *fmt,...) |
vaprintf stand-in for USB logging. | |
int | initCh32v003 (int swdio_pin) |
int | ch32v003WriteMemory (const uint8_t *binary, uint32_t length, uint32_t offset) |
Write to memory on the ch32v003. | |
int | ch32v003WriteFlash (const uint8_t *buf, int sz) |
Write data into the ch32v003's flash. | |
int | ch32v003Resume () |
Cause the 003 to reboot and execute the program loaded into it. | |
int | ch32v003ReadMemory (uint8_t *binary, uint32_t length, uint32_t offset) |
Read data from the ch32v003's memory space into host processor memory space. | |
int | ch32v003GetReg (int regno, uint32_t *value) |
Read ch32v003 debug module registers. | |
int | ch32v003SetReg (int regno, uint32_t regValue) |
Write ch32v003 debug module registers. | |
void | ch32v003CheckTerminal () |
See if the ch32v003 has any pending printf to print on host processor. | |
void | ch32v003Teardown () |
Disables ch32v003 communications. | |
Variables | |
struct SWIOState | swioContext |
#define MAX_IN_TIMEOUT 1000 |
#define DisableISR | ( | ) |
#define EnableISR | ( | ) |
#define GPIO_VAR_W1TC (*GPIO_VAR_W1TC_R) |
#define GPIO_VAR_W1TS (*GPIO_VAR_W1TS_R) |
#define GPIO_VAR_ENABLE_W1TC (*GPIO_VAR_ENABLE_W1TC_R) |
#define GPIO_VAR_ENABLE_W1TS (*GPIO_VAR_ENABLE_W1TS_R) |
#define GPIO_VAR_IN (*GPIO_VAR_IN_R) |
#define IO_MUX_REG | ( | x | ) |
#define XIO_MUX_REG | ( | x | ) |
#define XGPIO_NUM | ( | x | ) |
int uprintf | ( | const char * | fmt, |
... ) |
vaprintf stand-in for USB logging.
fmt | vaprintf format |
... | vaprintf args |
int initCh32v003 | ( | int | swdio_pin | ) |
int ch32v003WriteMemory | ( | const uint8_t * | binary, |
uint32_t | length, | ||
uint32_t | offset ) |
Write to memory on the ch32v003.
binary | A binary image to be loaded into a location in the ch32v003. |
length | The size of the binary image. |
offset | The offset of the binary image.s |
int ch32v003WriteFlash | ( | const uint8_t * | buf, |
int | sz ) |
Write data into the ch32v003's flash.
buf | A pointer to a binary image in the master processor |
sz | The size of the binary image to be written |
int ch32v003Resume | ( | ) |
Cause the 003 to reboot and execute the program loaded into it.
int ch32v003ReadMemory | ( | uint8_t * | binary, |
uint32_t | length, | ||
uint32_t | offset ) |
Read data from the ch32v003's memory space into host processor memory space.
binary | A pointer to a buffer in the host processor |
length | The number of bytes to read |
offset | The location of memory to read in the ch32v003 |
int ch32v003GetReg | ( | int | regno, |
uint32_t * | value ) |
Read ch32v003 debug module registers.
regno | The debug module register number. |
value | A pointer to the uint32_t to receive that register's value. |
int ch32v003SetReg | ( | int | regno, |
uint32_t | regValue ) |
Write ch32v003 debug module registers.
regno | The debug module register number. |
regValue | The value to write into that debug module regsiter |
void ch32v003CheckTerminal | ( | ) |
See if the ch32v003 has any pending printf to print on host processor.
void ch32v003Teardown | ( | ) |
Disables ch32v003 communications.
struct SWIOState swioContext |