2020-12-04 19:13:29 -05:00
|
|
|
/* 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 */
|
|
|
|
|
2020-12-14 20:41:12 -05:00
|
|
|
/* 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 */
|
|
|
|
|
2020-12-29 01:26:39 -05:00
|
|
|
typedef enum {
|
|
|
|
VNT_INIT,
|
|
|
|
VNT_CAL,
|
|
|
|
VNT_RAW,
|
|
|
|
VNT_VNC
|
|
|
|
} vnt_cmd_t ;
|
|
|
|
|
|
|
|
void adc_vnt( vnt_cmd_t cmd, short *ptrV, short *ptrC) ;
|
|
|
|
|
2020-12-04 19:13:29 -05:00
|
|
|
/* end of system.h */
|