From b90e58f763bd277b7a5285601a34818f44f2b01c Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka <gniibe@fsij.org> Date: Mon, 30 May 2016 14:39:02 +0900 Subject: Move CHIP specific things to mcu/ --- mcu/sys-mkl27z.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 mcu/sys-mkl27z.h (limited to 'mcu/sys-mkl27z.h') diff --git a/mcu/sys-mkl27z.h b/mcu/sys-mkl27z.h new file mode 100644 index 0000000..eed5d92 --- /dev/null +++ b/mcu/sys-mkl27z.h @@ -0,0 +1,41 @@ +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); + +int flash_erase_page (uint32_t addr); +int flash_program_word (uint32_t addr, uint32_t word); -- cgit v1.2.3