-
Notifications
You must be signed in to change notification settings - Fork 0
/
usbotghs_fifos.h
71 lines (54 loc) · 2.36 KB
/
usbotghs_fifos.h
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
*
* Copyright 2019 The wookey project team <[email protected]>
* - Ryad Benadjila
* - Arnauld Michelizza
* - Mathieu Renard
* - Philippe Thierry
* - Philippe Trebuchet
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* the Free Software Foundation; either version 3 of the License, or (at
* ur option) any later version.
*
* This package is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this package; if not, write to the Free Software Foundation, Inc., 51
* Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef USBOTGHS_FIFOS_H_
#define USBOTGHS_FIFOS_H_
#include "libc/types.h"
#include "api/libusbotghs.h"
#include "usbotghs.h"
#ifndef __FRAMAC__
/*
* Size of the USB OTG HS core internal FIFO (global config, not per EP)
*/
#define USBOTG_HS_RX_CORE_FIFO_SZ 512 /* RX is shared */
#define USBOTG_HS_TX_CORE_FIFO_SZ 512 /* 128 bytes, unit is 32bits DWORD here */
#endif
mbed_error_t usbotghs_init_global_fifo(void);
mbed_error_t usbotghs_reset_epx_fifo(usbotghs_ep_t *ep);
/* FIFO RAM buffers are EP contexts informations, and don't need to be passed as
* parameters */
mbed_error_t usbotghs_read_epx_fifo(uint32_t size, uint8_t ep_id);
/* FIFO RAM buffers are EP contexts informations, and don't need to be passed as
* parameters */
mbed_error_t usbotghs_write_epx_fifo(uint32_t size, uint8_t ep_id);
mbed_error_t usbotghs_set_recv_fifo(uint8_t *dst, uint32_t size, uint8_t epid);
mbed_error_t usbotghs_set_xmit_fifo(uint8_t *src, uint32_t size, uint8_t epid);
mbed_error_t usbotghs_read_core_fifo(uint8_t *dest, uint32_t size, uint8_t ep);
/* flush the Core TxFIFO of the given EP. This functions does *not* upate the
* associated EP ctx (fifo_idx, fifo_size) */
mbed_error_t usbotghs_txfifo_flush(uint8_t ep_id);
/* flush the Core TxFIFO of all the IN (Tx in device mode) EP.
* This functions does *not* upate the associated EP ctx (fifo_idx, fifo_size) */
mbed_error_t usbotghs_txfifo_flush_all(void);
mbed_error_t usbotghs_rxfifo_flush(uint8_t ep_id);
#endif/*!USBOTGHS_FIFOS_H_*/