MSP device support complete. NOT TESTED YET! Preliminary python host lib
[cerebrum.git] / msp / comm.h
blob82161006810a6ac5431b80eb8d9ea076b2a96760
2 #ifndef __COMM_H__
3 #define __COMM_H__
5 void comm_loop(void);
6 void putc_escaped(char c);
8 /*
9 *comm callback function pointer type.
10 *function signature:
11 *uint8_t callback(uint8_t arglen, uint8_t* argbuf, uint8_t respbuflen, uint8_t* respbuf);
12 * arglen: length of the argument string passed to the function
13 * argbuf: buffer containing the argument string
14 * respbuflen: length of the response buffer (maximum response length)
15 * respbuf: response buffer (write your return value *here*)
17 * return value: amount of data written to respbuf (in bytes)
19 typedef void (*comm_callback)(uint16_t, uint8_t*);
20 extern comm_callback comm_callbacks[];
22 #ifndef NUM_CALLBACKS
23 #define NUM_CALLBACKS 0
24 #endif//NUM_CALLBACKS
26 #ifndef ARGBUF_SIZE
27 #define ARGBUF_SIZE 32
28 #endif//ARGBUF_SIZE
30 #endif//__COMM_H__