Rev 41 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 41 | Rev 92 | ||
---|---|---|---|
1 | /******************** (C) COPYRIGHT 2006 STMicroelectronics ******************** |
1 | /******************** (C) COPYRIGHT 2006 STMicroelectronics ******************** |
2 | * File Name : usb_endp.c |
2 | * File Name : usb_endp.c |
3 | * Author : MCD Application Team |
3 | * Author : MCD Application Team |
4 | * Date First Issued : 10/01/2006 : V1.0 |
4 | * Date First Issued : 10/01/2006 : V1.0 |
5 | * Description : Endpoint routines |
5 | * Description : Endpoint routines |
6 | ******************************************************************************** |
6 | ******************************************************************************** |
7 | * History: |
7 | * History: |
8 | * 10/01/2006 : V1.0 |
8 | * 10/01/2006 : V1.0 |
9 | ******************************************************************************** |
9 | ******************************************************************************** |
10 | * THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS |
10 | * THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS |
11 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. |
11 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. |
12 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, |
12 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, |
13 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE |
13 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE |
14 | * CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING |
14 | * CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING |
15 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. |
15 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. |
16 | *******************************************************************************/ |
16 | *******************************************************************************/ |
17 | /* Includes ------------------------------------------------------------------*/ |
17 | /* Includes ------------------------------------------------------------------*/ |
18 | #include <stdio.h> |
18 | #include <stdio.h> |
19 | #include "91x_lib.h" |
19 | #include "91x_lib.h" |
20 | #include "uart1.h" |
20 | #include "uart1.h" |
21 | #include "usb_lib.h" |
21 | #include "usb_lib.h" |
22 | #include "usb_desc.h" |
22 | #include "usb_desc.h" |
23 | 23 | ||
24 | /* Private typedef -----------------------------------------------------------*/ |
24 | /* Private typedef -----------------------------------------------------------*/ |
25 | /* Private define ------------------------------------------------------------*/ |
25 | /* Private define ------------------------------------------------------------*/ |
26 | /* Private macro -------------------------------------------------------------*/ |
26 | /* Private macro -------------------------------------------------------------*/ |
27 | /* Private variables ---------------------------------------------------------*/ |
27 | /* Private variables ---------------------------------------------------------*/ |
28 | u8 USB_BufferRx[VIRTUAL_COM_PORT_DATA_SIZE]; |
28 | u8 USB_BufferRx[VIRTUAL_COM_PORT_DATA_SIZE]; |
29 | u8 USB_BufferTx[VIRTUAL_COM_PORT_DATA_SIZE]; |
29 | u8 USB_BufferTx[VIRTUAL_COM_PORT_DATA_SIZE]; |
30 | u32 USB_BufferRxCount =0; |
30 | u32 USB_BufferRxCount =0; |
31 | u32 count_in = 0; |
31 | u32 count_in = 0; |
32 | /* Private function prototypes -----------------------------------------------*/ |
32 | /* Private function prototypes -----------------------------------------------*/ |
33 | /* Private functions ---------------------------------------------------------*/ |
33 | /* Private functions ---------------------------------------------------------*/ |
34 | /******************************************************************************* |
34 | /******************************************************************************* |
35 | * Function Name : EP3_IN_Callback |
35 | * Function Name : EP3_IN_Callback |
36 | * Description : |
36 | * Description : |
37 | * Input : None. |
37 | * Input : None. |
38 | * Output : None. |
38 | * Output : None. |
39 | * Return : None. |
39 | * Return : None. |
40 | *******************************************************************************/ |
40 | *******************************************************************************/ |
41 | void EP3_OUT_Callback(void) |
41 | void EP3_OUT_Callback(void) |
42 | { |
42 | { |
43 | USB_BufferRxCount= GetEPRxCount(ENDP3); |
43 | USB_BufferRxCount= GetEPRxCount(ENDP3); |
44 | //ReceivedBytes = GetEPRxCount(ENDP3); |
- | |
45 | PMAToUserBufferCopy(USB_BufferRx, ENDP3_RXADDR, USB_BufferRxCount ); |
44 | PMAToUserBufferCopy(USB_BufferRx, ENDP3_RXADDR, USB_BufferRxCount ); |
46 | //PMAToUserBufferCopy((u8*) rxd_buffer, ENDP3_RXADDR, ReceivedBytes); |
- | |
47 | //rxd_buffer_locked = 1; |
- | |
48 | USB_BufferRx[USB_BufferRxCount] = 0; // terminate buffer contents |
45 | USB_BufferRx[USB_BufferRxCount] = 0; // terminate buffer contents |
49 | SetEPRxValid(ENDP3); |
46 | SetEPRxValid(ENDP3); |
50 | sprintf(text,"USB (%ld): %s\n\r", USB_BufferRxCount, USB_BufferRx); |
47 | sprintf(text,"USB (%ld): %s\n\r", USB_BufferRxCount, USB_BufferRx); |
51 | SerialPutString(text); |
48 | SerialPutString(text); |
52 | 49 | ||
53 | // USB_Send_Data(RxdBuffer, AnzahlEmpfangsBytes); |
50 | // USB_Send_Data(RxdBuffer, AnzahlEmpfangsBytes); |
54 | // USB_Send_String("Rx.\0"); |
51 | // USB_Send_String("Rx.\0"); |
55 | } |
52 | } |
56 | /******************************************************************************* |
53 | /******************************************************************************* |
57 | * Function Name : EP1_IN_Callback |
54 | * Function Name : EP1_IN_Callback |
58 | * Description : |
55 | * Description : |
59 | * Input : None. |
56 | * Input : None. |
60 | * Output : None. |
57 | * Output : None. |
61 | * Return : None. |
58 | * Return : None. |
62 | *******************************************************************************/ |
59 | *******************************************************************************/ |
63 | void EP1_IN_Callback(void) |
60 | void EP1_IN_Callback(void) |
64 | { |
61 | { |
65 | count_in =0; |
62 | count_in =0; |
66 | } |
63 | } |
67 | /******************* (C) COPYRIGHT 2006 STMicroelectronics *****END OF FILE****/ |
64 | /******************* (C) COPYRIGHT 2006 STMicroelectronics *****END OF FILE****/ |
68 | 65 | ||
69 | 66 |