Go to the source code of this file.
|
#define | ch32v003RunBinaryAsset(asset) |
| Load and run a binary image from the assets folder on the ch32v003. Included as a #define because we can't include main functionality in a module.
|
|
|
int | initCh32v003 (int swdio_pin) |
|
int | ch32v003WriteFlash (const uint8_t *buf, int sz) |
| Write data into the ch32v003's flash.
|
|
int | ch32v003WriteMemory (const uint8_t *binary, uint32_t length, uint32_t address) |
| Write to memory on the ch32v003.
|
|
int | ch32v003ReadMemory (uint8_t *binary, uint32_t length, uint32_t address) |
| 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.
|
|
int | ch32v003Resume () |
| Cause the 003 to reboot and execute the program loaded into it.
|
|
void | ch32v003CheckTerminal () |
| See if the ch32v003 has any pending printf to print on host processor.
|
|
void | ch32v003Teardown () |
| Disables ch32v003 communications.
|
|
void | ch32v003EmuDraw (int window_w, int window_h) |
|
◆ ch32v003RunBinaryAsset
#define ch32v003RunBinaryAsset |
( |
| asset | ) |
|
Value: ({ \
size_t sz; \
ch32v003Resume(); \
r; \
})
const uint8_t * cnfsGetFile(cnfsFileIdx_t fIdx, size_t *flen)
Get a pointer to a file, without needing to read it. Same rules that apply to cnfsGetFile,...
Definition cnfs.c:65
int ch32v003WriteFlash(const uint8_t *buf, int sz)
Write data into the ch32v003's flash.
Definition hdw-ch32v003.c:190
Load and run a binary image from the assets folder on the ch32v003. Included as a #define
because we can't include main functionality in a module.
- Parameters
-
asset | cnfsFileIdx_t of a binary image to be loaded into a location in the ch32v003. This must be of type cnfsFileIdx_t |
- Returns
- 0 if OK, nonzero in error condition.
◆ initCh32v003()
int initCh32v003 |
( |
int | swdio_pin | ) |
|
◆ ch32v003WriteFlash()
int ch32v003WriteFlash |
( |
const uint8_t * | buf, |
|
|
int | sz ) |
Write data into the ch32v003's flash.
- Parameters
-
buf | A pointer to a binary image in the master processor |
sz | The size of the binary image to be written |
- Returns
- 0 if OK, nonzero in error condition.
◆ ch32v003WriteMemory()
int ch32v003WriteMemory |
( |
const uint8_t * | binary, |
|
|
uint32_t | length, |
|
|
uint32_t | offset ) |
Write to memory on the ch32v003.
- Parameters
-
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 |
◆ ch32v003ReadMemory()
int ch32v003ReadMemory |
( |
uint8_t * | binary, |
|
|
uint32_t | length, |
|
|
uint32_t | offset ) |
Read data from the ch32v003's memory space into host processor memory space.
- Parameters
-
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 |
- Returns
- 0 if OK, nonzero if error.
◆ ch32v003GetReg()
int ch32v003GetReg |
( |
int | regno, |
|
|
uint32_t * | value ) |
Read ch32v003 debug module registers.
- Parameters
-
regno | The debug module register number. |
value | A pointer to the uint32_t to receive that register's value. |
- Returns
- 0 if OK, nonzero if error.
◆ ch32v003SetReg()
int ch32v003SetReg |
( |
int | regno, |
|
|
uint32_t | regValue ) |
Write ch32v003 debug module registers.
- Parameters
-
regno | The debug module register number. |
regValue | The value to write into that debug module regsiter |
- Returns
- 0 if OK, nonzero if error.
◆ ch32v003Resume()
Cause the 003 to reboot and execute the program loaded into it.
- Returns
- 0 if OK, nonzero in error condition.
◆ ch32v003CheckTerminal()
void ch32v003CheckTerminal |
( |
| ) |
|
See if the ch32v003 has any pending printf to print on host processor.
◆ ch32v003Teardown()
void ch32v003Teardown |
( |
| ) |
|
Disables ch32v003 communications.
◆ ch32v003EmuDraw()
void ch32v003EmuDraw |
( |
int | window_w, |
|
|
int | window_h ) |