]> Pileus Git - ~andy/csm213a-hw/blob - hw2/main_comm.h
299b223b82bce61164f23ddbd91f4dc514a6c580
[~andy/csm213a-hw] / hw2 / main_comm.h
1 #ifndef MAIN_COMM_H
2 #define MAIN_COMM_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #include <stdint.h>
9
10 #include "timer_dma.h"
11 #include "serial_irq.h"
12
13 /**
14  * Initialization
15  */
16 void comm_init(sirq_t *dbg, sirq_t *bbb, sirq_t *mbed,
17                tdma_t *rcv, tdma_t *xmt);
18
19 /**
20  * Output initialization message init message
21  */
22 void comm_send_init(uint16_t device, uint64_t local);
23 void comm_send_sync(sirq_t *port, uint64_t now);
24 void comm_send_event(sirq_t *port, uint16_t event, uint64_t local);
25
26 /**
27  * Handle init message
28  */
29 void comm_handle_init(int msgid, init_msg_t *msg);
30 void comm_handle_sync(int msgid, sync_msg_t *msg);
31 void comm_handle_event(int msgid, event_msg_t *msg);
32
33 #ifdef __cplusplus
34 }
35 #endif
36
37 #endif