ucmb: Add more documentation and example code for AVR8
[openwrt/svn-archive/archive.git] / utils / ucmb / microcontroller_examples / atmel_avr8 / ucmb.h
1 #ifndef UCMB_AVR8_H_
2 #define UCMB_AVR8_H_
3
4 #include <stdint.h>
5
6
7 /* Max length of the message payload. */
8 #define UCMB_MAX_MSG_LEN 0x200
9
10 /* ucmb_rx_message - Message receive callback.
11 * Define this elsewhere. It's called on successful retrieval
12 * of a new message.
13 * If a reply message has to be transferred after this one, put the
14 * message payload into the "payload" buffer and return the number
15 * of bytes to transmit. If no reply message is needed, return 0.
16 * Note that the "payload" buffer always has a size of UCMB_MAX_MSG_LEN.
17 */
18 extern uint16_t ucmb_rx_message(uint8_t *payload,
19 uint16_t payload_length);
20
21 /* Initialize the UCMB subsystem. */
22 void ucmb_init(void);
23
24 #endif /* UCMB_AVR8_H_ */