]> Pileus Git - ~andy/csm213a-hw/blob - hw2/main_comm.h
Start working on serial relay
[~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_sync(uint64_t local);
23 void comm_send_event(uint16_t event, uint64_t local);
24
25 /**
26  * Handle init message
27  */
28 void comm_handle_init(header_t *head, init_msg_t *body);
29 void comm_handle_sync(header_t *head, sync_msg_t *body);
30 void comm_handle_event(header_t *head, event_msg_t *body);
31
32 #ifdef __cplusplus
33 }
34 #endif
35
36 #endif