blob: ca954fc30589866f3ee01517381004f430a6fa4c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#include <reg/usbotg.h>
#include <stdint.h>
#include "../uart/uart.h"
#include "bdt.h"
#include "endpt1.h"
#define MAX_PACKET 64
static unsigned char buf[2][MAX_PACKET];
void usb_endpt1_enable(void)
{
}
void usb_endpt1_disable(void)
{
}
void usb_endpt1_token(uint8_t state)
{
struct usb0_bd *bd;
uart_puts(" endpt1 token");
bd = &BDT_ENDPT(1, GET_BIT(state, STAT_TX), GET_BIT(state, STAT_ODD));
switch (GET_BITS(bd->desc, BD_TOK_PID)) {
case BD_TOK_PID_OUT:
bd->desc = USB0_BD_INIT(sizeof buf[0], 1);
/* should never happen */
break;
case BD_TOK_PID_IN:
/*pushtx();*/
break;
}
/*USB0_CTL = BV(CTL_USBENSOFEN);*/
}
|