repo_full_name
stringlengths
6
93
repo_url
stringlengths
25
112
repo_api_url
stringclasses
28 values
owner
stringclasses
28 values
repo_name
stringclasses
28 values
description
stringclasses
28 values
stars
int64
617
98.8k
forks
int64
31
355
watchers
int64
990
999
license
stringclasses
2 values
default_branch
stringclasses
2 values
repo_created_at
timestamp[s]date
2012-07-24 23:12:50
2025-06-16 08:07:28
repo_updated_at
timestamp[s]date
2026-02-23 15:23:15
2026-05-03 18:52:12
repo_topics
listlengths
0
13
repo_languages
unknown
is_fork
bool
1 class
open_issues
int64
3
104
file_path
stringlengths
3
208
file_name
stringclasses
509 values
file_extension
stringclasses
1 value
file_size_bytes
int64
101
84k
file_url
stringclasses
627 values
file_raw_url
stringclasses
627 values
file_sha
stringclasses
624 values
language
stringclasses
8 values
parsed_at
stringdate
2026-05-04 01:12:36
2026-05-04 19:41:55
text
stringlengths
100
102k
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
386/include/ape/ureg.h
null
null
null
null
null
null
C
2026-05-04T18:24:56.735650
#ifndef __UREG_H #define __UREG_H #if !defined(_PLAN9_SOURCE) This header file is an extension to ANSI/POSIX #endif struct Ureg { unsigned long di; /* general registers */ unsigned long si; /* ... */ unsigned long bp; /* ... */ unsigned long nsp; unsigned long bx; /* ... */ unsigned long dx; /* ... */ ...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/bin/source/acd/acd.h
null
null
null
null
null
null
C
2026-05-04T18:24:56.736827
#include <u.h> #include <libc.h> #include <bio.h> #include <disk.h> #include <auth.h> #include <fcall.h> #include <thread.h> #include <9p.h> /* acme */ typedef struct Event Event; typedef struct Window Window; enum { STACK = 16384, EVENTSIZE = 256, NEVENT = 5, }; struct Event { int c1; int c2; int q0; int q...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
386/include/ape/float.h
null
null
null
null
null
null
C
2026-05-04T18:24:56.743526
#ifndef __FLOAT #define __FLOAT /* IEEE, default rounding */ #define FLT_ROUNDS 1 #define FLT_RADIX 2 #define FLT_DIG 6 #define FLT_EPSILON 1.19209290e-07 #define FLT_MANT_DIG 24 #define FLT_MAX 3.40282347e+38 #define FLT_MAX_10_EXP 38 #define FLT_MAX_EXP 128 #define FLT_MIN 1.17549435e-38 #define FLT_MIN_10_EXP -...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/bin/source/acd/cddb.c
null
null
null
null
null
null
C
2026-05-04T18:24:56.744102
#include "acd.h" #include <ctype.h> /* see CDDBPROTO */ static ulong cddb_sum(int n) { int ret; ret = 0; while(n > 0) { ret += n%10; n /= 10; } return ret; } static ulong diskid(Toc *t) { int i, n, tmp; Msf *ms, *me; n = 0; for(i=0; i < t->ntrack; i++) n += cddb_sum(t->track[i].start.m*60+t->track[i]...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/bin/source/acd/main.c
null
null
null
null
null
null
C
2026-05-04T18:24:56.767519
#include "acd.h" int debug; void usage(void) { fprint(2, "usage: acd dev\n"); threadexitsall("usage"); } Alt mkalt(Channel *c, void *v, int op) { Alt a; memset(&a, 0, sizeof(a)); a.c = c; a.v = v; a.op = op; return a; } void freetoc(Toc *t) { int i; free(t->title); for(i=0; i<t->ntrack; i++) free(t->...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
386/include/ape/stdarg.h
null
null
null
null
null
null
C
2026-05-04T18:24:56.768060
#ifndef __STDARG #define __STDARG typedef char *va_list; #define va_start(list, start) list = (sizeof(start)<4 ? (char *)((int *)&(start)+1) : \ (char *)(&(start)+1)) #define va_end(list) #define va_arg(list, mode)\ ((sizeof(mode) == 1)?\ ((list += 4), (mode*)list)[-4]:\ (sizeof(mode) == 2)?\ ((list += 4), (mod...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/bin/source/acd/acme.c
null
null
null
null
null
null
C
2026-05-04T18:24:56.771955
#include "acd.h" static int iscmd(char *s, char *cmd) { int len; len = strlen(cmd); return strncmp(s, cmd, len)==0 && (s[len]=='\0' || s[len]==' ' || s[len]=='\t' || s[len]=='\n'); } static char* skip(char *s, char *cmd) { s += strlen(cmd); while(*s==' ' || *s=='\t' || *s=='\n') s++; return s; } //#define P...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
386/include/ureg.h
null
null
null
null
null
null
C
2026-05-04T18:24:56.797072
struct Ureg { ulong di; /* general registers */ ulong si; /* ... */ ulong bp; /* ... */ ulong nsp; ulong bx; /* ... */ ulong dx; /* ... */ ulong cx; /* ... */ ulong ax; /* ... */ ulong gs; /* data segments */ ulong fs; /* ... */ ulong es; /* ... */ ulong ds; /* ... */ ulong trap; /* trap type *...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
386/include/ape/math.h
null
null
null
null
null
null
C
2026-05-04T18:24:56.798873
#ifndef __MATH #define __MATH #pragma lib "/$M/lib/ape/libap.a" /* a HUGE_VAL appropriate for IEEE double-precision */ /* the correct value, 1.797693134862316e+308, causes a ken overflow */ #define HUGE_VAL 1.79769313486231e+308 #ifdef __cplusplus extern "C" { #endif extern double acos(double); extern double asin(do...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
386/include/u.h
null
null
null
null
null
null
C
2026-05-04T18:24:56.848699
#define nil ((void*)0) typedef unsigned short ushort; typedef unsigned char uchar; typedef unsigned long ulong; typedef unsigned int uint; typedef signed char schar; typedef long long vlong; typedef unsigned long long uvlong; typedef unsigned long uintptr; typedef unsigned long usize; typedef uint Rune; typedef uni...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/bin/source/acd/util.c
null
null
null
null
null
null
C
2026-05-04T18:24:57.638512
#include "acd.h" void* emalloc(uint n) { void *p; p = malloc(n); if(p == nil) error("can't malloc: %r"); memset(p, 0, n); return p; } char* estrdup(char *s) { char *t; t = emalloc(strlen(s)+1); strcpy(t, s); return t; } char* estrstrdup(char *s, char *t) { char *u; u = emalloc(strlen(s)+strlen(t)+1);...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/bin/source/acd/win.c
null
null
null
null
null
null
C
2026-05-04T18:24:57.660276
#include "acd.h" Window* newwindow(void) { char buf[12]; Window *w; w = emalloc(sizeof(Window)); w->ctl = open("/mnt/wsys/new/ctl", ORDWR|OCEXEC); if(w->ctl<0 || read(w->ctl, buf, 12)!=12) error("can't open window ctl file: %r"); ctlprint(w->ctl, "noscroll\n"); w->id = atoi(buf); w->event = winopenfile(w, "...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/bin/source/spout.c
null
null
null
null
null
null
C
2026-05-04T18:24:57.661434
#include <u.h> #include <libc.h> #include <ctype.h> #include <bio.h> void spout(int, char*); Biobuf bout; void main(int argc, char *argv[]) { int i, fd; Binit(&bout, 1, OWRITE); if(argc == 1) spout(0, ""); else for(i=1; i<argc; i++){ fd = open(argv[i], OREAD); if(fd < 0){ fprint(2, "spell: can't o...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/bin/source/adict/adict.c
null
null
null
null
null
null
C
2026-05-04T18:24:57.663346
#include <u.h> #include <libc.h> #include <bio.h> #include <thread.h> #include "win.h" #include "adict.h" enum { STACK = 8192, }; char *prog = "adict"; char *lprog = "/bin/adict"; char *xprog = "/bin/dict"; char *dict, *pattern, *curaddr[MAXMATCH], *curone, *args[6], buffer[80]; char abuffer[80], fbuffer[80], pbuff...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/bin/source/adict/win.h
null
null
null
null
null
null
C
2026-05-04T18:24:57.705446
enum { False, True, EVENTSIZE=256, }; typedef struct Event Event; struct Event { int c1; int c2; int q0; int q1; int flag; int nb; int nr; char b[EVENTSIZE*UTFmax+1]; Rune r[EVENTSIZE+1]; }; typedef struct Win Win; struct Win { int winid; int addr; Biobuf *body; int ctl; int data; int event; char...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/bin/source/adict/win.c
null
null
null
null
null
null
C
2026-05-04T18:24:57.706654
#include <u.h> #include <libc.h> #include <bio.h> #include <thread.h> #include "win.h" void* erealloc(void *p, uint n) { p = realloc(p, n); if(p == nil) fprint(2, "realloc failed: %r"); return p; } void wnew(Win *w) { char buf[12]; w->ctl = open("/mnt/acme/new/ctl", ORDWR); if(w->ctl<0 || read(w->ctl, buf, 1...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/bin/source/adict/adict.h
null
null
null
null
null
null
C
2026-05-04T18:24:57.713427
enum { Matchwin, Entrywin, Dictwin }; #define MAXTAG 20 #define MAXMATCH 100 #define BUFSIZE 4096
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/bin/source/mkwnew.c
null
null
null
null
null
null
C
2026-05-04T18:24:57.714922
#include <u.h> #include <libc.h> void main(int argc, char *argv[]) { int i, fd, pid, n; char wdir[256]; int dflag; dflag = 0; ARGBEGIN{ case 'd': dflag = 1; break; default: fprint(2, "usage: wnew [-d] [label]\n"); }ARGEND pid = getpid(); wdir[0] = '\0'; if(!dflag) getwd(wdir, sizeof wdir); if(arg...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/bin/source/acd/toc.c
null
null
null
null
null
null
C
2026-05-04T18:24:57.755940
#include "acd.h" Toc thetoc; void tocthread(void *v) { Drive *d; threadsetname("tocthread"); d = v; DPRINT(2, "recv ctocdisp?..."); while(recv(d->ctocdisp, &thetoc) == 1) { DPRINT(2, "recv ctocdisp!..."); drawtoc(d->w, &thetoc); DPRINT(2, "send dbreq...\n"); send(d->ctocdbreq, &thetoc); } } void freet...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/bin/source/acd/mmc.c
null
null
null
null
null
null
C
2026-05-04T18:24:57.770750
#include "acd.h" int msfconv(Fmt *fp) { Msf m; m = va_arg(fp->args, Msf); fmtprint(fp, "%d.%d.%d", m.m, m.s, m.f); return 0; } static int status(Drive *d) { uchar cmd[12]; memset(cmd, 0, sizeof cmd); cmd[0] = 0xBD; return scsi(d->scsi, cmd, sizeof cmd, nil, 0, Snone); } static int playmsf(Drive *d, Msf sta...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/mail/src/dat.h
null
null
null
null
null
null
C
2026-05-04T18:24:59.375947
typedef struct Event Event; typedef struct Exec Exec; typedef struct Message Message; typedef struct Window Window; enum { STACK = 8192, EVENTSIZE = 256, NEVENT = 5, }; struct Event { int c1; int c2; int q0; int q1; int flag; int nb; int nr; char b[EVENTSIZE*UTFmax+1]; Rune r[EVENTSIZE+1]; }; struct Wi...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/bin/source/win/fs.c
null
null
null
null
null
null
C
2026-05-04T18:24:59.377105
#include <u.h> #include <libc.h> #include <fcall.h> #include <thread.h> #include <9p.h> #include "dat.h" Channel *fschan; Channel *writechan; static File *devcons, *devnew; static void fsread(Req *r) { Fsevent e; if(r->fid->file == devnew){ if(r->fid->aux==nil){ respond(r, "phase error"); return; } re...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/bin/source/win/util.c
null
null
null
null
null
null
C
2026-05-04T18:24:59.378081
#include <u.h> #include <libc.h> #include <bio.h> #include <thread.h> #include "dat.h" void* emalloc(uint n) { void *p; p = malloc(n); if(p == nil) error("can't malloc: %r"); memset(p, 0, n); return p; } char* estrdup(char *s) { char *t; t = emalloc(strlen(s)+1); strcpy(t, s); return t; } char* estrstrd...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/bin/source/win/pipe.c
null
null
null
null
null
null
C
2026-05-04T18:24:59.379397
#include <u.h> #include <libc.h> #include <fcall.h> #include <thread.h> #include <9p.h> #include "dat.h" typedef struct Wpid Wpid; struct Wpid { int pid; Window *w; Wpid *next; }; void pipectl(void*); int pipefd; Wpid *wpid; int snarffd; Channel *newpipechan; int newpipewin(int pid, char *p) { int id; Window...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/bin/source/win/win.c
null
null
null
null
null
null
C
2026-05-04T18:24:59.380820
#include <u.h> #include <libc.h> #include <bio.h> #include <thread.h> #include "dat.h" Window* newwindow(void) { char buf[12]; Window *w; w = emalloc(sizeof(Window)); w->ctl = open("/mnt/wsys/new/ctl", ORDWR|OCEXEC); if(w->ctl<0 || read(w->ctl, buf, 12)!=12) error("can't open window ctl file: %r"); ctlprint(w...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/mail/src/mesg.c
null
null
null
null
null
null
C
2026-05-04T18:24:59.381357
#include <u.h> #include <libc.h> #include <bio.h> #include <thread.h> #include <ctype.h> #include <plumb.h> #include "dat.h" enum { DIRCHUNK = 32*sizeof(Dir) }; char regexchars[] = "\\/[].+?()*^$"; char deleted[] = "(deleted)-"; char deletedrx[] = "\\(deleted\\)-"; char deletedrx01[] = "(\\(deleted\\)-)?"; char dele...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/mail/src/mail.c
null
null
null
null
null
null
C
2026-05-04T18:24:59.382900
#include <u.h> #include <libc.h> #include <bio.h> #include <thread.h> #include <plumb.h> #include <ctype.h> #include "dat.h" char *maildir = "/mail/fs/"; /* mountpoint of mail file system */ char *mailtermdir = "/mnt/term/mail/fs/"; /* alternate mountpoint */ char *mboxname = "mbox"; /* mailboxdir/mboxname is mail...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/bin/source/win/main.c
null
null
null
null
null
null
C
2026-05-04T18:24:59.384205
#include <u.h> #include <libc.h> #include <bio.h> #include <thread.h> #include <fcall.h> #include <9p.h> #include <ctype.h> #include "dat.h" void mainctl(void*); void startcmd(char *[], int*); void stdout2body(void*); int debug; int notepg; int eraseinput; int dirty = 0; Window *win; /* the main window */ void usa...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/mail/src/html.c
null
null
null
null
null
null
C
2026-05-04T18:25:00.656007
#include <u.h> #include <libc.h> #include <bio.h> #include <thread.h> #include <ctype.h> #include <plumb.h> #include "dat.h" char* formathtml(char *body, int *np) { int i, j, p[2], q[2]; Exec *e; char buf[1024]; Channel *sync; e = emalloc(sizeof(struct Exec)); if(pipe(p) < 0 || pipe(q) < 0) error("can't crea...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/bin/source/win/dat.h
null
null
null
null
null
null
C
2026-05-04T18:25:00.711297
typedef struct Fsevent Fsevent; typedef struct Event Event; typedef struct Message Message; typedef struct Window Window; enum { STACK = 8192, NPIPEDATA = 8000, NPIPE = NPIPEDATA+32, /* EVENTSIZE is really 256 in acme, but we use events internally and want bigger buffers */ EVENTSIZE = 16*1024, NEVENT = 5, };...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/mail/src/util.c
null
null
null
null
null
null
C
2026-05-04T18:25:01.501124
#include <u.h> #include <libc.h> #include <bio.h> #include <thread.h> #include <plumb.h> #include "dat.h" void* emalloc(uint n) { void *p; p = malloc(n); if(p == nil) error("can't malloc: %r"); memset(p, 0, n); setmalloctag(p, getcallerpc(&n)); return p; } void* erealloc(void *p, uint n) { p = realloc(p, n)...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/news/src/win.h
null
null
null
null
null
null
C
2026-05-04T18:25:01.503377
/* acme */ typedef struct Event Event; typedef struct Window Window; enum { STACK = 8192, EVENTSIZE = 256, NEVENT = 5, }; struct Event { int c1; int c2; int q0; int q1; int flag; int nb; int nr; char b[EVENTSIZE*UTFmax+1]; Rune r[EVENTSIZE+1]; }; struct Window { /* file descriptors */ int ctl; int ...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/wiki/src/awiki.h
null
null
null
null
null
null
C
2026-05-04T18:25:01.504671
#include <u.h> #include <libc.h> #include <bio.h> #include <thread.h> /* acme */ typedef struct Event Event; typedef struct Window Window; enum { STACK = 8192, EVENTSIZE = 256, NEVENT = 5, }; struct Event { int c1; int c2; int q0; int q1; int flag; int nb; int nr; char b[EVENTSIZE*UTFmax+1]; Rune r[EVE...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/news/src/util.c
null
null
null
null
null
null
C
2026-05-04T18:25:01.506320
#include <u.h> #include <libc.h> #include <bio.h> #include <thread.h> #include "win.h" void* emalloc(uint n) { void *p; p = malloc(n); if(p == nil) error("can't malloc: %r"); memset(p, 0, n); return p; } char* estrdup(char *s) { char *t; t = emalloc(strlen(s)+1); strcpy(t, s); return t; } char* estrstrd...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/news/src/news.c
null
null
null
null
null
null
C
2026-05-04T18:25:01.507300
/* * Acme interface to nntpfs. */ #include <u.h> #include <libc.h> #include <bio.h> #include <thread.h> #include "win.h" #include <ctype.h> int canpost; int debug; int nshow = 20; int lo; /* next message to look at in dir */ int hi; /* current hi message in dir */ char *dir = "/mnt/news"; char *group; char *from; ...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/mail/src/win.c
null
null
null
null
null
null
C
2026-05-04T18:25:01.507846
#include <u.h> #include <libc.h> #include <bio.h> #include <thread.h> #include <plumb.h> #include "dat.h" Window* newwindow(void) { char buf[12]; Window *w; w = emalloc(sizeof(Window)); w->ctl = open("/mnt/wsys/new/ctl", ORDWR|OCEXEC); if(w->ctl<0 || read(w->ctl, buf, 12)!=12) error("can't open window ctl file...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/mail/src/reply.c
null
null
null
null
null
null
C
2026-05-04T18:25:01.510049
#include <u.h> #include <libc.h> #include <bio.h> #include <thread.h> #include <ctype.h> #include <plumb.h> #include "dat.h" static int replyid; int quote(Message *m, Biobuf *b, char *dir, char *quotetext) { char *body, *type; int i, n, nlines; char **lines; if(quotetext){ body = quotetext; n = strlen(body);...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/news/src/win.c
null
null
null
null
null
null
C
2026-05-04T18:25:01.716302
#include <u.h> #include <libc.h> #include <bio.h> #include <thread.h> #include "win.h" Window* newwindow(void) { char buf[12]; Window *w; w = emalloc(sizeof(Window)); w->ctl = open("/mnt/wsys/new/ctl", ORDWR|OCEXEC); if(w->ctl<0 || read(w->ctl, buf, 12)!=12) error("can't open window ctl file: %r"); ctlprint(w...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/wiki/src/util.c
null
null
null
null
null
null
C
2026-05-04T18:25:02.990910
#include "awiki.h" void* emalloc(uint n) { void *p; p = malloc(n); if(p == nil) error("can't malloc: %r"); memset(p, 0, n); return p; } char* estrdup(char *s) { char *t; t = emalloc(strlen(s)+1); strcpy(t, s); return t; } char* estrstrdup(char *s, char *t) { char *u; u = emalloc(strlen(s)+strlen(t)+1...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
amd64/include/ape/math.h
null
null
null
null
null
null
C
2026-05-04T18:25:03.174595
#ifndef __MATH #define __MATH #pragma lib "/$M/lib/ape/libap.a" /* a HUGE_VAL appropriate for IEEE double-precision */ /* the correct value, 1.797693134862316e+308, causes a ken overflow */ #define HUGE_VAL 1.79769313486231e+308 #ifdef __cplusplus extern "C" { #endif extern double acos(double); extern double asin(do...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
amd64/include/ape/stdarg.h
null
null
null
null
null
null
C
2026-05-04T18:25:03.177838
#ifndef __STDARG #define __STDARG typedef char *va_list; #define va_start(list, start) list = (sizeof(start)<8 ? (char *)((long long *)&(start)+1) : \ (char *)(&(start)+1)) #define va_end(list) #define va_arg(list, mode)\ ((sizeof(mode) == 1)?\ ((mode*)(list += 8))[-8]:\ (sizeof(mode) == 2)?\ ((mode*)(list += 8...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
amd64/include/ape/ureg.h
null
null
null
null
null
null
C
2026-05-04T18:25:03.178758
#ifndef __UREG_H #define __UREG_H #if !defined(_PLAN9_SOURCE) This header file is an extension to ANSI/POSIX #endif struct Ureg { unsigned long long ax; unsigned long long bx; unsigned long long cx; unsigned long long dx; unsigned long long si; unsigned long long di; unsigned long long bp; unsigned long lo...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/wiki/src/win.c
null
null
null
null
null
null
C
2026-05-04T18:25:03.181868
#include "awiki.h" Window* newwindow(void) { char buf[12]; Window *w; w = emalloc(sizeof(Window)); w->ctl = open("/mnt/wsys/new/ctl", ORDWR|OCEXEC); if(w->ctl<0 || read(w->ctl, buf, 12)!=12) error("can't open window ctl file: %r"); ctlprint(w->ctl, "noscroll\n"); w->id = atoi(buf); w->event = winopenfile(w,...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
amd64/include/ape/float.h
null
null
null
null
null
null
C
2026-05-04T18:25:03.182460
#ifndef __FLOAT #define __FLOAT /* IEEE, default rounding */ #define FLT_ROUNDS 1 #define FLT_RADIX 2 #define FLT_DIG 6 #define FLT_EPSILON 1.19209290e-07 #define FLT_MANT_DIG 24 #define FLT_MAX 3.40282347e+38 #define FLT_MAX_10_EXP 38 #define FLT_MAX_EXP 128 #define FLT_MIN 1.17549435e-38 #define FLT_MIN_10_EXP -...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
amd64/include/u.h
null
null
null
null
null
null
C
2026-05-04T18:25:03.194173
#define nil ((void*)0) typedef unsigned short ushort; typedef unsigned char uchar; typedef unsigned long ulong; typedef unsigned int uint; typedef signed char schar; typedef long long vlong; typedef unsigned long long uvlong; typedef unsigned long long uintptr; typedef unsigned long usize; typedef uint Rune; typede...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/wiki/src/wiki.c
null
null
null
null
null
null
C
2026-05-04T18:25:03.216384
#include "awiki.h" Wiki *wlist; void link(Wiki *w) { if(w->linked) return; w->linked = 1; w->prev = nil; w->next = wlist; if(wlist) wlist->prev = w; wlist = w; } void unlink(Wiki *w) { if(!w->linked) return; w->linked = 0; if(w->next) w->next->prev = w->prev; if(w->prev) w->prev->next = w->next;...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
acme/wiki/src/main.c
null
null
null
null
null
null
C
2026-05-04T18:25:03.287853
#include "awiki.h" int debug; int mapfd; char *email; char *dir; void usage(void) { fprint(2, "usage: Wiki [-e email] [dir]\n"); exits("usage"); } void threadmain(int argc, char **argv) { char *s; Dir *d; rfork(RFNAMEG); ARGBEGIN{ case 'D': debug++; break; case 'e': email = EARGF(usage()); break; d...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
arm/include/ape/float.h
null
null
null
null
null
null
C
2026-05-04T18:25:03.649435
#ifndef __FLOAT #define __FLOAT /* IEEE, default rounding */ #define FLT_ROUNDS 1 #define FLT_RADIX 2 #define FLT_DIG 6 #define FLT_EPSILON 1.19209290e-07 #define FLT_MANT_DIG 24 #define FLT_MAX 3.40282347e+38 #define FLT_MAX_10_EXP 38 #define FLT_MAX_EXP 128 #define FLT_MIN 1.17549435e-38 #define FLT_MIN_10_EXP -...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
arm/include/ape/math.h
null
null
null
null
null
null
C
2026-05-04T18:25:04.498049
#ifndef __MATH #define __MATH #pragma lib "/$M/lib/ape/libap.a" /* a HUGE_VAL appropriate for IEEE double-precision */ /* the correct value, 1.797693134862316e+308, causes a ken overflow */ #define HUGE_VAL 1.79769313486231e+308 #ifdef __cplusplus extern "C" { #endif extern double acos(double); extern double asin(do...
Harvey-OS/harvey
https://github.com/Harvey-OS/harvey
null
null
null
null
1,452
null
null
mit
null
null
null
null
null
null
null
amd64/include/ureg.h
null
null
null
null
null
null
C
2026-05-04T18:25:07.540147
struct Ureg { u64int ax; u64int bx; u64int cx; u64int dx; u64int si; u64int di; u64int bp; u64int r8; u64int r9; u64int r10; u64int r11; u64int r12; u64int r13; u64int r14; u64int r15; u16int ds; u16int es; u16int fs; u16int gs; u64int type; u64int error; /* error code (or zero) */ u64int ip;...
kgabis/parson
https://github.com/kgabis/parson
null
null
null
null
1,449
null
null
mit
null
null
null
null
null
null
null
parson.c
null
null
null
null
null
null
C
2026-05-04T18:25:09.718725
/* SPDX-License-Identifier: MIT Parson 1.5.3 (https://github.com/kgabis/parson) Copyright (c) 2012 - 2023 Krzysztof Gabis Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction...
kgabis/parson
https://github.com/kgabis/parson
null
null
null
null
1,449
null
null
mit
null
null
null
null
null
null
null
tests.c
null
null
null
null
null
null
C
2026-05-04T18:25:09.724300
/* SPDX-License-Identifier: MIT Parson (https://github.com/kgabis/parson) Copyright (c) 2012 - 2023 Krzysztof Gabis Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, incl...
kgabis/parson
https://github.com/kgabis/parson
null
null
null
null
1,449
null
null
mit
null
null
null
null
null
null
null
parson.h
null
null
null
null
null
null
C
2026-05-04T18:25:09.734936
/* SPDX-License-Identifier: MIT Parson 1.5.3 (https://github.com/kgabis/parson) Copyright (c) 2012 - 2023 Krzysztof Gabis Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/adc_dma_opamp/adc_dma_opamp.c
null
null
null
null
null
null
C
2026-05-04T18:25:12.578573
/* * Example for using ADC with DMA and an op-amp * 04-13-2023 E. Brombaugh */ #include "ch32fun.h" #include <stdio.h> #define ADC_NUMCHLS 4 volatile uint16_t adc_buffer[ADC_NUMCHLS]; /* * initialize adc for DMA */ void adc_init( void ) { // ADCCLK = 24 MHz => RCC_ADCPRE = 0: divide by 2 RCC->CFGR0 &= ~(0x1F<...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/adc_dma_opamp/funconfig.h
null
null
null
null
null
null
C
2026-05-04T18:25:12.582836
#ifndef _FUNCONFIG_H #define _FUNCONFIG_H // Place configuration items here, you can see a full list in ch32fun/ch32fun.h // To reconfigure to a different processor, update TARGET_MCU in the Makefile #endif
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/adc_injection/funconfig.h
null
null
null
null
null
null
C
2026-05-04T18:25:12.583513
#ifndef _FUNCONFIG_H #define _FUNCONFIG_H // Place configuration items here, you can see a full list in ch32fun/ch32fun.h // To reconfigure to a different processor, update TARGET_MCU in the Makefile #endif
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/adc_fixed_fs/funconfig.h
null
null
null
null
null
null
C
2026-05-04T18:25:12.585366
#ifndef _FUNCONFIG_H #define _FUNCONFIG_H // Place configuration items here, you can see a full list in ch32fun/ch32fun.h // To reconfigure to a different processor, update TARGET_MCU in the Makefile #define FUNCONF_USE_HSE 1 #define FUNCONF_USE_PLL 1 // Do not use built-in 2x PLL #define FUNCONF_USE_...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/adc_polled/adc_polled.c
null
null
null
null
null
null
C
2026-05-04T18:25:12.593521
/* * Example for using ADC with polling * 03-27-2023 E. Brombaugh */ #include "ch32fun.h" #include <stdio.h> /* * initialize adc for polling */ void adc_init( void ) { // ADCCLK = 24 MHz => RCC_ADCPRE = 0: divide by 2 RCC->CFGR0 &= ~(0x1F<<11); // Enable GPIOD and ADC RCC->APB2PCENR |= RCC_APB2Periph_GPIOD...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/adc_injection/adc_injection.c
null
null
null
null
null
null
C
2026-05-04T18:25:12.594590
// Basic GPIO and Injection-Mode ADC Example using modern funPinMode / funDigitalWrite / etc... modes. // // The ADC has two modes: Rule and Injection. // Injection allows you to read up to 4 ADCs in rapid succession. // But there is no rule at the end for checking completion of conversion... So it's usually only goo...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/adc_polled/funconfig.h
null
null
null
null
null
null
C
2026-05-04T18:25:12.596502
#ifndef _FUNCONFIG_H #define _FUNCONFIG_H // Place configuration items here, you can see a full list in ch32fun/ch32fun.h // To reconfigure to a different processor, update TARGET_MCU in the Makefile #endif
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/adc_fixed_fs/adc_fixed_fs.c
null
null
null
null
null
null
C
2026-05-04T18:25:12.627867
/* * Example for using ADC with DMA and timer for fixed sampling rate * by eeucalyptus */ #include "ch32fun.h" #include <stdio.h> #include <stdlib.h> #define BUFFER_LENGTH 128 volatile uint16_t buffer[2][BUFFER_LENGTH] = {0}; volatile uint32_t current_write_buffer = 0; #define current_read_buffer (1-current_write_...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
ch32fun/ch32fun.h
null
null
null
null
null
null
C
2026-05-04T18:25:12.644069
/* SPDX-License-Identifier: MIT */ // This contains a copy of ch32v00x.h and core_riscv.h ch32v00x_conf.h and other misc functions See copyright explanation at the end of the file. #ifndef __CH32FUN_H #define __CH32FUN_H #include "funconfig.h" /************************************************************************...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
ch32fun/ch32fun.c
null
null
null
null
null
null
C
2026-05-04T18:25:12.645278
// Mixture of embedlibc, and ch32v00x_startup.c // Use with newlib headers. // Mixture of weblibc, mini-printf and ??? /* This file contains the following functions: // libc (via musl) mixture and miniprintf int printf( const char* format, ... ) int vprintf(const char* format, va_list args) int snprintf( char * buffe...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/blink/blink.c
null
null
null
null
null
null
C
2026-05-04T18:25:13.209995
#include "ch32fun.h" #include <stdio.h> // use defines to make more meaningful names for our GPIO pins #define PIN_1 PD0 #define PIN_K PD4 #define PIN_BOB PD6 #define PIN_KEVIN PC0 int main() { SystemInit(); funGpioInitAll(); // Enable GPIOs funPinMode( PIN_1, GPIO_Speed_10MHz | GPIO_CNF_OUT_PP ); // Set PI...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/app_without_flash/funconfig.h
null
null
null
null
null
null
C
2026-05-04T18:25:13.237653
#ifndef _FUNCONFIG_H #define _FUNCONFIG_H // Place configuration items here, you can see a full list in ch32fun/ch32fun.h // To reconfigure to a different processor, update TARGET_MCU in the Makefile #define FUNCONF_USE_HSI 0 // CH592 does not have HSI #define FUNCONF_USE_HSE 1 #define CLK_SOURCE...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/bldc_gimbal/bldc_gimbal.c
null
null
null
null
null
null
C
2026-05-04T18:25:13.242663
#include "ch32fun.h" #include <stdio.h> // Connect motor to PD5, PD6, and PC7. // This is actually 1/F_CPU per PWM period advance. uint32_t target_rotor_speed = 3500; // Higher values here use longer but more accurate PWM periods. #define PWM_PERIOD_PO2 5 void handle_debug_input( int numbytes, uint8_t * data ) { i...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/blink/funconfig.h
null
null
null
null
null
null
C
2026-05-04T18:25:13.243864
#ifndef _FUNCONFIG_H #define _FUNCONFIG_H // Place configuration items here, you can see a full list in ch32fun/ch32fun.h // To reconfigure to a different processor, update TARGET_MCU in the Makefile #endif
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/app_without_flash/app_without_flash.c
null
null
null
null
null
null
C
2026-05-04T18:25:13.253494
/* Example of code that is compiled to run from RAM, pushed to RAM, then run from there. */ #include "ch32fun.h" #include <stdio.h> uint32_t count; #if CH32V003 #define USEPIN PA1 #else #define USEPIN PA8 #endif int main() { SystemInit(); #ifdef funGpioInitAll funGpioInitAll(); #endif funPinMode( USEPIN, G...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/bootload/funconfig.h
null
null
null
null
null
null
C
2026-05-04T18:25:13.254080
#ifndef _FUNCONFIG_H #define _FUNCONFIG_H // Place configuration items here, you can see a full list in ch32fun/ch32fun.h // To reconfigure to a different processor, update TARGET_MCU in the Makefile #define FUNCONF_USE_DEBUGPRINTF 0 #endif
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/blink_raw/funconfig.h
null
null
null
null
null
null
C
2026-05-04T18:25:13.291238
#ifndef _FUNCONFIG_H #define _FUNCONFIG_H // Place configuration items here, you can see a full list in ch32fun/ch32fun.h // To reconfigure to a different processor, update TARGET_MCU in the Makefile #endif
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/bldc_gimbal/funconfig.h
null
null
null
null
null
null
C
2026-05-04T18:25:13.292444
#ifndef _FUNCONFIG_H #define _FUNCONFIG_H // Place configuration items here, you can see a full list in ch32fun/ch32fun.h // To reconfigure to a different processor, update TARGET_MCU in the Makefile #define FUNCONF_USE_DEBUGPRINTF 1 #define FUNCONF_SYSTICK_USE_HCLK 1 // Systick = 48MHz #endif
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/bootload/bootload.c
null
null
null
null
null
null
C
2026-05-04T18:25:13.318322
#include "ch32fun.h" #include <stdio.h> uint32_t count; // You can override the interrupt vector this way: void InterruptVector() __attribute__((naked)) __attribute((section(".init"))); void InterruptVector() { asm volatile( "\n\ .align 2\n\ .option push;\n\ .option norvc;\n\ j handle_reset\n\ .opt...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/blink_raw/blink_raw.c
null
null
null
null
null
null
C
2026-05-04T18:25:13.319163
#include "ch32fun.h" #include <stdio.h> int main() { SystemInit(); // Enable GPIOs RCC->APB2PCENR |= RCC_APB2Periph_GPIOD | RCC_APB2Periph_GPIOC; // GPIO D0 Push-Pull GPIOD->CFGLR &= ~(0xf<<(4*0)); GPIOD->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP)<<(4*0); // GPIO D4 Push-Pull GPIOD->CFGLR &= ~(0xf<<(4*4)...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/branchless_gpio_lib/branchless_gpio_lib.c
null
null
null
null
null
null
C
2026-05-04T18:25:14.071628
// 2023-06-26 recallmenot #define DEMO_GPIO_blink 1 #define DEMO_GPIO_blink_port 0 #define DEMO_GPIO_out 0 #define DEMO_GPIO_in_btn 0 #define DEMO_ADC_bargraph 0 #define DEMO_PWM_dayrider 0 #if ((DEMO_GPIO_blink + DEMO_GPIO_blink_port + DEMO_GPIO_out + DEMO_GPIO_in_btn + DEMO_ADC_bargraph + DEMO_P...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/branchless_gpio_lib/funconfig.h
null
null
null
null
null
null
C
2026-05-04T18:25:14.835553
#ifndef _FUNCONFIG_H #define _FUNCONFIG_H // Place configuration items here, you can see a full list in ch32fun/ch32fun.h // To reconfigure to a different processor, update TARGET_MCU in the Makefile #define FUNCONF_TINYVECTOR 1 #endif
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/color_lcd/ch32v_hal.h
null
null
null
null
null
null
C
2026-05-04T18:25:14.836787
// // CH32V Hardware Abstraction layer // written by Larry Bank // bitbank@pobox.com // // Copyright 2023 BitBank Software, Inc. All Rights Reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the Lic...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/cap_touch_adc/cap_touch_adc.c
null
null
null
null
null
null
C
2026-05-04T18:25:14.837828
/* ADC-aided capacitive touch sensing. This demonstrates use of the ADC with cap sense pads. By using the ADC, you can get much higher resolution than if you use the exti. But, you are limited by the number of ADC lines, i.e. you can only support a maximum of eight (8) touch inputs with this method. In exchang...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/cap_touch_exti/funconfig.h
null
null
null
null
null
null
C
2026-05-04T18:25:14.838978
#ifndef _FUNCONFIG_H #define _FUNCONFIG_H // Place configuration items here, you can see a full list in ch32fun/ch32fun.h // To reconfigure to a different processor, update TARGET_MCU in the Makefile // Though this should be on by default we can extra force it on. #define FUNCONF_USE_DEBUGPRINTF 1 #define FUNCONF_DE...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/cap_touch_adc/funconfig.h
null
null
null
null
null
null
C
2026-05-04T18:25:14.840641
#ifndef _FUNCONFIG_H #define _FUNCONFIG_H // Place configuration items here, you can see a full list in ch32fun/ch32fun.h // To reconfigure to a different processor, update TARGET_MCU in the Makefile #define FUNCONF_SYSTICK_USE_HCLK 1 #endif
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/breathe/funconfig.h
null
null
null
null
null
null
C
2026-05-04T18:25:14.841916
#ifndef _FUNCONFIG_H #define _FUNCONFIG_H // Place configuration items here, you can see a full list in ch32fun/ch32fun.h // To reconfigure to a different processor, update TARGET_MCU in the Makefile #endif
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/color_lcd/color_lcd.c
null
null
null
null
null
null
C
2026-05-04T18:25:14.843368
// // color LCD demo // written by Larry Bank // bitbank@pobox.com // // Copyright 2023 BitBank Software, Inc. All Rights Reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at /...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/breathe/breathe.c
null
null
null
null
null
null
C
2026-05-04T18:25:15.087549
#include "ch32fun.h" // This code generates a signal on a GPIO pin meant to drive an LED or similar device // Since the human visual system deals on an exponential scale, the output needs to be // scaled apropriately. Instead of linearly increasing the brightness, increase it // in proportion to the square of the des...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/cap_touch_exti/cap_touch_exti.c
null
null
null
null
null
null
C
2026-05-04T18:25:15.088093
/* Demo showing how to use eternal interrupts to detect touch. This allows for both low resolution touch (about 6-7 bits for a 6mm x 10mm pad) by using internal pull up resistors, as well as high resolution touch (8+ bits per pad) with a 560k pull up resistor. The current configuration uses: PORT C, pin 4 - reg...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/cpp_virtual_methods/example.h
null
null
null
null
null
null
C
2026-05-04T18:25:15.527382
/* * Example for using virtual methods in C++ * 05/21/2023 A. Mandera */ #pragma once class Print { public: void doPrint(int); virtual void doNewLine(void) = 0; virtual void printValue(int) = 0; }; class ExampleClass : public Print { public: void begin(); int value(); void doNewLine(void) override; void pr...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/constructors/constructors.c
null
null
null
null
null
null
C
2026-05-04T18:25:15.528987
#include "ch32fun.h" #include <stdio.h> // Functions with __attribute__((constructor)) will be run by SystemInit() // and increment this counter static unsigned ctor_count = 0; __attribute__((constructor)) static void ctor_fn1(void) { ctor_count++; } __attribute__((constructor)) static void ctor_fn2(void) { ctor_c...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/debugprintfdemo/funconfig.h
null
null
null
null
null
null
C
2026-05-04T18:25:15.575166
#ifndef _FUNCONFIG_H #define _FUNCONFIG_H // Place configuration items here, you can see a full list in ch32fun/ch32fun.h // To reconfigure to a different processor, update TARGET_MCU in the Makefile // Though this should be on by default we can extra force it on. #define FUNCONF_USE_DEBUGPRINTF 1 //#define FUNCONF_...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/color_lcd/spi_lcd.h
null
null
null
null
null
null
C
2026-05-04T18:25:15.576473
// // spi_lcd.h // a Sitronix LCD display library // Created on: Sep 11, 2023 // written by Larry Bank (bitbank@pobox.com) // // // Copyright 2023 BitBank Software, Inc. All Rights Reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the Lic...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/constructors/funconfig.h
null
null
null
null
null
null
C
2026-05-04T18:25:15.642548
#ifndef _FUNCONFIG_H #define _FUNCONFIG_H // Run constructors on SystemInit(). Alternatively you can remove this and // invoke CallConstructors() yourself whenever you want. #define FUNCONF_SUPPORT_CONSTRUCTORS 1 // For debugging #define FUNCONF_USE_DEBUGPRINTF 1 #endif
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/cpp_virtual_methods/funconfig.h
null
null
null
null
null
null
C
2026-05-04T18:25:15.644161
#ifndef _FUNCONFIG_H #define _FUNCONFIG_H // Place configuration items here, you can see a full list in ch32fun/ch32fun.h // To reconfigure to a different processor, update TARGET_MCU in the Makefile #endif
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/debugprintfdemo/debugprintfdemo.c
null
null
null
null
null
null
C
2026-05-04T18:25:15.756347
/* Small example showing how to use the SWIO programming pin to do printf through the debug interface */ #include "ch32fun.h" #include <stdio.h> uint32_t count; int last = 0; void handle_debug_input( int numbytes, uint8_t * data ) { last = data[0]; count += numbytes; } int main() { SystemInit(); while( !De...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/direct_gpio/funconfig.h
null
null
null
null
null
null
C
2026-05-04T18:25:15.814358
#ifndef _FUNCONFIG_H #define _FUNCONFIG_H // Place configuration items here, you can see a full list in ch32fun/ch32fun.h // To reconfigure to a different processor, update TARGET_MCU in the Makefile #endif
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/direct_gpio/direct_gpio.c
null
null
null
null
null
null
C
2026-05-04T18:25:15.869718
#include "ch32fun.h" #include <stdio.h> int main() { SystemInit(); // Enable GPIOs RCC->APB2PCENR |= RCC_APB2Periph_GPIOC; // GPIO C1 Push-Pull GPIOC->CFGLR &= ~(0xf<<(4*1)); GPIOC->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP)<<(4*1); // GPIO C2 Push-Pull GPIOC->CFGLR &= ~(0xf<<(4*2)); GPIOC->CFGLR |= (GPI...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/dma_gpio/funconfig.h
null
null
null
null
null
null
C
2026-05-04T18:25:16.469624
#ifndef _FUNCONFIG_H #define _FUNCONFIG_H // Place configuration items here, you can see a full list in ch32fun/ch32fun.h // To reconfigure to a different processor, update TARGET_MCU in the Makefile #endif
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/dma_gpio_mem2mem/dma_gpio_mem2mem.c
null
null
null
null
null
null
C
2026-05-04T18:25:16.470980
// DMA GPIO Output Example - this example shows // how you can output 8 pins all simultaneously // with a planned bit pattern at 8MSamples/s. This // mechanism is called "mem2mem" and lets the DMA // run as fast as possible and is not affected // by the latency of a timer trigger. // Accessing SRAM with the CPU during ...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/dma_gpio_ws2812/funconfig.h
null
null
null
null
null
null
C
2026-05-04T18:25:16.472568
#ifndef _FUNCONFIG_H #define _FUNCONFIG_H // Place configuration items here, you can see a full list in ch32fun/ch32fun.h // To reconfigure to a different processor, update TARGET_MCU in the Makefile #endif
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/dma_gpio_ws2812/dma_gpio_ws2812.c
null
null
null
null
null
null
C
2026-05-04T18:25:16.473334
// DMA GPIO Output Example - this one showing output // of a bitsream to a ws2812b LED on port PD0 -- note // that this could be any port. Also note, that this // has much higher overhead than using the SPI port // for WS2812B output. // While this does work to output via DMA ws2812 LEDs // on any port, think of this...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/dma_gpio/dma_gpio.c
null
null
null
null
null
null
C
2026-05-04T18:25:16.849741
// DMA GPIO Output Example - this example shows // how you can output 8 pins all simultaneously // with a dynamic bit pattern at 2MSamples/s. As the // sampling rate increases (decreasing TIM1->ATRLR), // the jitter due to the CPU and DMA accessing SRAM // simultaneously can be observed by contrasting the // timing of ...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/dma_spi/funconfig.h
null
null
null
null
null
null
C
2026-05-04T18:25:16.851331
#ifndef _FUNCONFIG_H #define _FUNCONFIG_H // Place configuration items here, you can see a full list in ch32fun/ch32fun.h // To reconfigure to a different processor, update TARGET_MCU in the Makefile #define FUNCONF_USE_DEBUGPRINTF 1 #define FUNCONF_USE_UARTPRINTF 0 #endif
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/dma_spi/dma_spi.c
null
null
null
null
null
null
C
2026-05-04T18:25:16.851979
/* SPI DMA example with software NSS Based on cnlohr's example for the CH32V203 Author: Fredrik Saevland (fsaev) https://github.com/fsaev MIT License Copyright (c) 2024 Fredrik Saevland Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files...
cnlohr/ch32fun
https://github.com/cnlohr/ch32fun
null
null
null
null
1,436
null
null
mit
null
null
null
null
null
null
null
examples/external_crystal/external_crystal.c
null
null
null
null
null
null
C
2026-05-04T18:25:16.852607
#include "ch32fun.h" #include <stdio.h> uint32_t count; int main() { SystemInit(); // Enable GPIOs RCC->APB2PCENR |= RCC_APB2Periph_GPIOD | RCC_APB2Periph_GPIOC; // GPIO D0 Push-Pull GPIOD->CFGLR &= ~(0xf<<(4*0)); GPIOD->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP)<<(4*0); // GPIO D4 Push-Pull GPIOD->CFGL...