-
Notifications
You must be signed in to change notification settings - Fork 0
/
usb_endp.c
55 lines (48 loc) · 1.29 KB
/
usb_endp.c
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
#include "usb_lib.h"
#include "usb_mem.h"
#include "hw_config.h"
#include "usb_istr.h"
#include "main.h"
/*******************************************************************************
* Function Name : EP_IN_Callback
* Description :
* Input : None.
* Output : None.
* Return : None.
*******************************************************************************/
void EP2_IN_Callback(void)
{
USB_USART1_Data.count_in = 0;
}
void EP4_IN_Callback(void)
{
USB_USART2_Data.count_in = 0;
}
void EP6_IN_Callback(void)
{
USB_USART3_Data.count_in = 0;
}
/*******************************************************************************
* Function Name : EP_OUT_Callback
* Description :
* Input : None.
* Output : None.
* Return : None.
*******************************************************************************/
void EPx_OUT_Callback(USB_USART_Data_t * data)
{
// Get the received data buffer and update the counter
data->count_out = USB_SIL_Read(data->EP_OUT_ADDR, data->buffer_out);
}
void EP2_OUT_Callback(void)
{
EPx_OUT_Callback(&USB_USART1_Data);
}
void EP4_OUT_Callback(void)
{
EPx_OUT_Callback(&USB_USART2_Data);
}
void EP6_OUT_Callback(void)
{
EPx_OUT_Callback(&USB_USART3_Data);
}