diff --git a/include/hexagram/schedule.h b/include/hexagram/schedule.h new file mode 100644 index 0000000..c462a2c --- /dev/null +++ b/include/hexagram/schedule.h @@ -0,0 +1,27 @@ +#ifndef _HEXAGRAM_SCHEDULE_H +#define _HEXAGRAM_SCHEDULE_H + +#include +#include +#include + +#include + +typedef struct _hexagram_schedule_slot { + time_t interval_us; + hexagram_table_entry *entry; +} hexagram_schedule_slot; + +typedef struct _hexagram_schedule { + size_t current; + timer_t timer; +} hexagram_schedule; + +hexagram_schedule *hexagram_schedule_create(hexagram_table_entry *table, + size_t count); + +int hexagram_schedule_run(hexagram_schedule *schedule); + +int hexagram_schedule_stop(hexagram_schedule *schedule); + +#endif /* _HEXAGRAM_SCHEDULE_H */ diff --git a/include/hexagram/table.h b/include/hexagram/table.h new file mode 100644 index 0000000..ada1b0f --- /dev/null +++ b/include/hexagram/table.h @@ -0,0 +1,15 @@ +#ifndef _HEXAGRAM_TABLE_H +#define _HEXAGRAM_TABLE_H + +#include +#include + +typedef struct _hexagram_table_entry { + time_t freq_us; + hexagram_can_if *iface; + struct can_frame frame; +} hexagram_table_entry; + +int hexagram_table_entry_send(hexagram_table_entry *entry); + +#endif /* _HEXAGRAM_TABLE_H */