-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusbotgfs_fifos.h
70 lines (52 loc) · 2.3 KB
/
usbotgfs_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
/*
*
* Copyright 2019 The wookey project team <wookey@ssi.gouv.fr>
* - 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 USBOTGFS_FIFOS_H_
#define USBOTGFS_FIFOS_H_
#include "libc/types.h"
#include "api/libusbotgfs.h"
#include "usbotgfs.h"
/*
* Size of the USB OTG HS core internal FIFO (global config, not per EP)
*/
#define USBOTG_FS_RX_CORE_FIFO_SZ 128
#define USBOTG_FS_TX_CORE_FIFO_SZ 128
mbed_error_t usbotgfs_init_global_fifo(void);
mbed_error_t usbotgfs_reset_epx_fifo(usbotgfs_ep_t *ep);
/* FIFO RAM buffers are EP contexts informations, and don't need to be passed as
* parameters */
mbed_error_t usbotgfs_read_epx_fifo(uint32_t size, usbotgfs_ep_t *ep);
/* FIFO RAM buffers are EP contexts informations, and don't need to be passed as
* parameters */
mbed_error_t usbotgfs_write_epx_fifo(uint32_t size, usbotgfs_ep_t *ep);
mbed_error_t usbotgfs_set_recv_fifo(uint8_t *dst, uint32_t size, uint8_t epid);
mbed_error_t usbotgfs_set_xmit_fifo(uint8_t *src, uint32_t size, uint8_t epid);
void usbotgfs_read_core_fifo(volatile uint8_t *dest, volatile 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 usbotgfs_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 usbotgfs_txfifo_flush_all(void);
mbed_error_t usbotgfs_rxfifo_flush(uint8_t ep_id);
#endif/*!USBOTGFS_FIFOS_H_*/