summaryrefslogtreecommitdiffstats
path: root/usb/endpt1.c
blob: b29c3bb49fa2fb995166a20fdba7e10a59cb6a98 (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
#include <reg/usbotg.h>
#include <stdint.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;

	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);*/
}