diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2016-05-27 17:17:44 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2016-05-27 17:17:44 +0900 |
commit | 960921f537adf6424c266664dcf1575c08ef0623 (patch) | |
tree | 799a2bbed8b436542e73035b1b2f2ee4908a1690 /example-fs-bb48/sys.h | |
parent | f2a8b01607aca8f41cc5f50b18bea74d65766731 (diff) |
example-fs-bb48: SYS implementation
Diffstat (limited to 'example-fs-bb48/sys.h')
-rw-r--r-- | example-fs-bb48/sys.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/example-fs-bb48/sys.h b/example-fs-bb48/sys.h new file mode 100644 index 0000000..c13978c --- /dev/null +++ b/example-fs-bb48/sys.h @@ -0,0 +1,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); |