mirror of
git://soft.sys114.com/klipper
synced 2026-02-09 18:34:23 +09:00
It's common for boards to have restrictions on the type of each endpoint. So, make it possible for the board to select the endpoint ids for each endpoint. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
30 lines
823 B
C
30 lines
823 B
C
#ifndef __GENERIC_USB_CDC_H
|
|
#define __GENERIC_USB_CDC_H
|
|
|
|
#include <stdint.h> // uint_fast8_t
|
|
|
|
// endpoint sizes
|
|
enum {
|
|
USB_CDC_EP0_SIZE = 16,
|
|
USB_CDC_EP_ACM_SIZE = 8,
|
|
USB_CDC_EP_BULK_OUT_SIZE = 64,
|
|
USB_CDC_EP_BULK_IN_SIZE = 64,
|
|
};
|
|
|
|
// callbacks provided by board specific code
|
|
int_fast8_t usb_read_bulk_out(void *data, uint_fast8_t max_len);
|
|
int_fast8_t usb_send_bulk_in(void *data, uint_fast8_t len);
|
|
int_fast8_t usb_read_setup(void *data, uint_fast8_t max_len);
|
|
int_fast8_t usb_send_setup(const void *data, uint_fast8_t len);
|
|
void usb_send_pgm_setup(void *data, uint_fast8_t len);
|
|
void usb_set_stall(void);
|
|
void usb_set_address(uint_fast8_t addr);
|
|
void usb_set_configure(void);
|
|
|
|
// usb_cdc.c
|
|
void usb_notify_bulk_in(void);
|
|
void usb_notify_bulk_out(void);
|
|
void usb_notify_setup(void);
|
|
|
|
#endif // usb_cdc.h
|