Keyboard firmwares for Atmel AVR and Cortex-M
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

usb0_function_global.c 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /*******************************************************************************
  2. * DISCLAIMER
  3. * This software is supplied by Renesas Electronics Corporation and is only
  4. * intended for use with Renesas products. No other uses are authorized. This
  5. * software is owned by Renesas Electronics Corporation and is protected under
  6. * all applicable laws, including copyright laws.
  7. * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
  8. * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
  9. * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
  10. * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
  11. * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
  12. * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
  13. * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
  14. * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
  15. * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  16. * Renesas reserves the right, without notice, to make changes to this software
  17. * and to discontinue the availability of this software. By using this software,
  18. * you agree to the additional terms and conditions found by accessing the
  19. * following link:
  20. * http://www.renesas.com/disclaimer
  21. * Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
  22. *******************************************************************************/
  23. /*******************************************************************************
  24. * File Name : usb0_function_global.c
  25. * $Rev: 1116 $
  26. * $Date:: 2014-07-09 16:29:19 +0900#$
  27. * Device(s) : RZ/A1H
  28. * Tool-Chain :
  29. * OS : None
  30. * H/W Platform :
  31. * Description : RZ/A1H R7S72100 USB Sample Program
  32. * Operation :
  33. * Limitations :
  34. *******************************************************************************/
  35. /*******************************************************************************
  36. Includes <System Includes> , "Project Includes"
  37. *******************************************************************************/
  38. #include "usb0_function.h"
  39. /*******************************************************************************
  40. Typedef definitions
  41. *******************************************************************************/
  42. /*******************************************************************************
  43. Macro definitions
  44. *******************************************************************************/
  45. /*******************************************************************************
  46. Imported global variables and functions (from other files)
  47. *******************************************************************************/
  48. /*******************************************************************************
  49. Exported global variables and functions (to be accessed by other files)
  50. *******************************************************************************/
  51. /*******************************************************************************
  52. Private global variables and functions
  53. *******************************************************************************/
  54. const uint16_t g_usb0_function_bit_set[16] =
  55. {
  56. 0x0001, 0x0002, 0x0004, 0x0008,
  57. 0x0010, 0x0020, 0x0040, 0x0080,
  58. 0x0100, 0x0200, 0x0400, 0x0800,
  59. 0x1000, 0x2000, 0x4000, 0x8000
  60. };
  61. uint32_t g_usb0_function_data_count[USB_FUNCTION_MAX_PIPE_NO + 1];
  62. uint8_t * g_usb0_function_data_pointer[USB_FUNCTION_MAX_PIPE_NO + 1];
  63. uint16_t g_usb0_function_PipeIgnore[USB_FUNCTION_MAX_PIPE_NO + 1];
  64. uint16_t g_usb0_function_PipeTbl[USB_FUNCTION_MAX_PIPE_NO + 1];
  65. uint16_t g_usb0_function_pipe_status[USB_FUNCTION_MAX_PIPE_NO + 1];
  66. uint32_t g_usb0_function_PipeDataSize[USB_FUNCTION_MAX_PIPE_NO + 1];
  67. USB_FUNCTION_DMA_t g_usb0_function_DmaInfo[2];
  68. uint16_t g_usb0_function_DmaPipe[2];
  69. uint16_t g_usb0_function_DmaBval[2];
  70. uint16_t g_usb0_function_DmaStatus[2];
  71. uint16_t g_usb0_function_CtrZeroLengthFlag;
  72. //uint16_t g_usb0_function_ConfigNum;
  73. //uint16_t g_usb0_function_Alternate[USB_FUNCTION_ALT_NO];
  74. //uint16_t g_usb0_function_RemoteWakeupFlag;
  75. uint16_t g_usb0_function_TestModeFlag;
  76. uint16_t g_usb0_function_TestModeSelectors;
  77. //uint16_t g_usb0_function_ReqType;
  78. //uint16_t g_usb0_function_ReqTypeType;
  79. //uint16_t g_usb0_function_ReqTypeRecip;
  80. //uint16_t g_usb0_function_ReqRequest;
  81. //uint16_t g_usb0_function_ReqValue;
  82. //uint16_t g_usb0_function_ReqIndex;
  83. //uint16_t g_usb0_function_ReqLength;
  84. //uint16_t g_usb0_function_EPTableIndex[USB_FUNCTION_MAX_EP_NO + 1];
  85. uint16_t g_usb0_function_pipecfg[USB_FUNCTION_MAX_PIPE_NO + 1];
  86. uint16_t g_usb0_function_pipebuf[USB_FUNCTION_MAX_PIPE_NO + 1];
  87. uint16_t g_usb0_function_pipemaxp[USB_FUNCTION_MAX_PIPE_NO + 1];
  88. uint16_t g_usb0_function_pipeperi[USB_FUNCTION_MAX_PIPE_NO + 1];
  89. /*******************************************************************************
  90. * Function Name: usb0_function_init_status
  91. * Description : Initialization USB Sample Driver Variable.
  92. * Arguments : none
  93. * Return Value : none
  94. *******************************************************************************/
  95. void usb0_function_init_status (void)
  96. {
  97. uint16_t pipe;
  98. //g_usb0_function_ConfigNum = 0;
  99. //g_usb0_function_RemoteWakeupFlag = DEVDRV_USBF_OFF;
  100. g_usb0_function_TestModeFlag = DEVDRV_USBF_OFF;
  101. g_usb0_function_CtrZeroLengthFlag = 0;
  102. #if 0
  103. usb0_function_clear_alt();
  104. #endif
  105. for (pipe = 0; pipe < (USB_FUNCTION_MAX_PIPE_NO + 1); ++pipe)
  106. {
  107. g_usb0_function_pipe_status[pipe] = DEVDRV_USBF_PIPE_IDLE;
  108. g_usb0_function_PipeDataSize[pipe] = 0;
  109. g_usb0_function_data_count[pipe] = 0;
  110. /* pipe configuration in usb0_function_ResetEP() */
  111. g_usb0_function_pipecfg[pipe] = 0;
  112. g_usb0_function_pipebuf[pipe] = 0;
  113. g_usb0_function_pipemaxp[pipe] = 0;
  114. g_usb0_function_pipeperi[pipe] = 0;
  115. }
  116. }
  117. /* End of File */