aboutsummaryrefslogtreecommitdiff
path: root/example-fs-bb48/sys.h
blob: c13978c3d56b60b03b039c8144a9bdc3dade1c41 (plain)
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
37
38
extern const uint8_t sys_version[8];
extern const uint32_t sys_board_id;
extern const char *const sys_board_name;

typedef void (*handler)(void);
extern handler sys_vector[16];

/*
 * Users can override INLINE by 'attribute((used))' to have an
 * implementation defined.
 */
#if !defined(INLINE)
#define INLINE __inline__
#endif

static INLINE void
clock_init (void)
{
  (*sys_vector[0]) ();
}

static INLINE void
gpio_init (void)
{
  (*sys_vector[1]) ();
}

static inline void
set_led (int on)
{
  void (*func) (int) = (void (*)(int))sys_vector[2];

  return (*func) (on);
}

void crc32_init (unsigned int *);
void crc32_u8 (unsigned int *, unsigned char);
void crc32_u32 (unsigned int *, unsigned int);