Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ch32v003fun
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Horn
ch32v003fun
Commits
bdba5ebd
Commit
bdba5ebd
authored
2 years ago
by
cnlohr
Browse files
Options
Downloads
Plain Diff
Merge branch 'testbranch' of
https://github.com/cnlohr/ch32v003fun
into testbranch
parents
a4744699
689710f9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/sandbox/sandbox.c
+0
-9
0 additions, 9 deletions
examples/sandbox/sandbox.c
minichlink/Makefile
+3
-1
3 additions, 1 deletion
minichlink/Makefile
minichlink/wch_printf.c
+35
-0
35 additions, 0 deletions
minichlink/wch_printf.c
with
38 additions
and
10 deletions
examples/sandbox/sandbox.c
+
0
−
9
View file @
bdba5ebd
...
@@ -8,15 +8,6 @@
...
@@ -8,15 +8,6 @@
// Working on WS2812 driving.
// Working on WS2812 driving.
static
inline
uint32_t
__get_dscratch0
(
void
)
{
uint32_t
result
;
__ASM
volatile
(
"csrr %0,"
"0x7b2"
:
"=r"
(
result
));
return
(
result
);
}
int
main
()
int
main
()
{
{
SystemInit48HSI
();
SystemInit48HSI
();
...
...
This diff is collapsed.
Click to expand it.
minichlink/Makefile
+
3
−
1
View file @
bdba5ebd
TOOLS
:=
wch_erase wch_reset wch_write_simple minichlink
TOOLS
:=
wch_erase wch_reset wch_write_simple
wch_printf
minichlink
all
:
$(TOOLS)
all
:
$(TOOLS)
...
@@ -9,6 +9,8 @@ wch_erase : wch_erase.c
...
@@ -9,6 +9,8 @@ wch_erase : wch_erase.c
gcc
-o
$@
$^
$(
LDFLAGS
)
$(
CFLAGS
)
gcc
-o
$@
$^
$(
LDFLAGS
)
$(
CFLAGS
)
wch_reset
:
wch_reset.c
wch_reset
:
wch_reset.c
gcc
-o
$@
$^
$(
LDFLAGS
)
$(
CFLAGS
)
gcc
-o
$@
$^
$(
LDFLAGS
)
$(
CFLAGS
)
wch_printf
:
wch_printf.c
gcc
-o
$@
$^
$(
LDFLAGS
)
$(
CFLAGS
)
wch_write_simple
:
wch_write_simple.c
wch_write_simple
:
wch_write_simple.c
gcc
-o
$@
$^
$(
LDFLAGS
)
$(
CFLAGS
)
gcc
-o
$@
$^
$(
LDFLAGS
)
$(
CFLAGS
)
minichlink
:
minichlink.c
minichlink
:
minichlink.c
...
...
This diff is collapsed.
Click to expand it.
minichlink/wch_printf.c
0 → 100644
+
35
−
0
View file @
bdba5ebd
#include
<stdio.h>
#include
"wch_link_base.h"
// TESTED
int
main
()
{
libusb_device_handle
*
devh
=
wch_link_base_setup
();
// Issue reset
// wch_link_command( devh, "\x81\x0b\x01\x01", 4, 0, 0, 0 );
// Why does db[1] = 6 appear to be some sort of query?
// Also 0x0b appears to be a query. But it wrecks up the chip.
// db[1] = 0xd DOES WRITE TO 0xe0000000. But is it predictable?
// DO NOT 0x0f!
unsigned
char
databuff
[
11
]
=
{
0x81
,
0x0d
,
0x08
,
0x07
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
};
unsigned
char
rbuff
[
1024
];
int
i
,
j
;
for
(
i
=
1
;
i
<
20
;
i
++
)
for
(
j
=
1
;
j
<
20
;
j
++
)
{
databuff
[
2
]
=
i
;
databuff
[
3
]
=
j
;
int
transferred
;
wch_link_command
(
devh
,
databuff
,
11
,
&
transferred
,
rbuff
,
1024
);
int
k
;
printf
(
"%d, %d: %d: "
,
i
,
j
,
transferred
);
for
(
k
=
0
;
k
<
transferred
;
k
++
)
printf
(
"%02x "
,
rbuff
[
k
]
);
printf
(
"
\n
"
);
usleep
(
10000
);
}
// Close out.
wch_link_command
(
devh
,
"
\x81\x0d\x01\xff
"
,
4
,
0
,
0
,
0
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment