-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsystem.h
36 lines (26 loc) · 1.03 KB
/
system.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* system.h -- system services */
/* Copyright (c) 2020 Renaud Fivet */
extern volatile unsigned uptime ; /* seconds elapsed since boot */
int init( void) ; /* System initialization, called once at startup */
void kputc( unsigned char c) ; /* character output */
int kputs( const char s[]) ; /* string output */
void yield( void) ; /* give way */
/* GPIOA low level API ********************************************************/
typedef enum {
LOW = 0,
HIGH
} iolvl_t ;
void gpioa_input( int pin) ; /* Configure GPIOA pin as input */
void gpioa_output( int pin) ; /* Configure GPIOA pin as output */
iolvl_t gpioa_read( int pin) ; /* Read level of GPIOA pin */
void usleep( unsigned usecs) ; /* wait at least usecs us */
typedef enum {
VNT_INIT,
VNT_CAL,
VNT_RAW,
VNT_VNC
} vnt_cmd_t ;
void adc_vnt( vnt_cmd_t cmd, short *ptrV, short *ptrC) ;
const unsigned short *adc_init( unsigned channels) ;
unsigned adc_convert( void) ;
/* end of system.h */