/* Minimal polled USB CDC-ACM device stack for ATmega8U2 (no LUFA, no interrupts) */ #ifndef USB_H #define USB_H #include #include #define USB_PACKET 64 void usb_init(void); void usb_task(void); /* call often: reset + EP0 handling */ bool usb_ready(void); /* true once host configured device */ uint8_t usb_rx(uint8_t *buf); /* copy one OUT packet (<=64B), 0=none */ void usb_tx(const uint8_t *buf, uint8_t n); /* send one IN packet (<=64B), drops on timeout */ #endif