Keyboard firmwares for Atmel AVR and Cortex-M
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

usb1_function_dmacdrv.h 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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 : usb1_function_dmacdrv.h
  25. * $Rev: 1116 $
  26. * $Date:: 2014-07-09 16:29:19 +0900#$
  27. * Description : RZ/A1H R7S72100 USB Sample Program
  28. *******************************************************************************/
  29. #ifndef USB1_FUNCTION_DMACDRV_H
  30. #define USB1_FUNCTION_DMACDRV_H
  31. /*******************************************************************************
  32. Includes <System Includes> , "Project Includes"
  33. *******************************************************************************/
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. /*******************************************************************************
  38. Typedef definitions
  39. *******************************************************************************/
  40. typedef struct dmac_transinfo
  41. {
  42. uint32_t src_addr; /* Transfer source address */
  43. uint32_t dst_addr; /* Transfer destination address */
  44. uint32_t count; /* Transfer byte count */
  45. uint32_t src_size; /* Transfer source data size */
  46. uint32_t dst_size; /* Transfer destination data size */
  47. uint32_t saddr_dir; /* Transfer source address direction */
  48. uint32_t daddr_dir; /* Transfer destination address direction */
  49. } dmac_transinfo_t;
  50. /*******************************************************************************
  51. Macro definitions
  52. *******************************************************************************/
  53. /* ==== Transfer specification of the sample program ==== */
  54. #define DMAC_SAMPLE_SINGLE (0) /* Single transfer */
  55. #define DMAC_SAMPLE_CONTINUATION (1) /* Continuous transfer (use REN bit) */
  56. /* ==== DMA modes ==== */
  57. #define DMAC_MODE_REGISTER (0) /* Register mode */
  58. #define DMAC_MODE_LINK (1) /* Link mode */
  59. /* ==== Transfer requests ==== */
  60. #define DMAC_REQ_MODE_EXT (0) /* External request */
  61. #define DMAC_REQ_MODE_PERI (1) /* On-chip peripheral module request */
  62. #define DMAC_REQ_MODE_SOFT (2) /* Auto-request (request by software) */
  63. /* ==== DMAC transfer sizes ==== */
  64. #define DMAC_TRANS_SIZE_8 (0) /* 8 bits */
  65. #define DMAC_TRANS_SIZE_16 (1) /* 16 bits */
  66. #define DMAC_TRANS_SIZE_32 (2) /* 32 bits */
  67. #define DMAC_TRANS_SIZE_64 (3) /* 64 bits */
  68. #define DMAC_TRANS_SIZE_128 (4) /* 128 bits */
  69. #define DMAC_TRANS_SIZE_256 (5) /* 256 bits */
  70. #define DMAC_TRANS_SIZE_512 (6) /* 512 bits */
  71. #define DMAC_TRANS_SIZE_1024 (7) /* 1024 bits */
  72. /* ==== Address increment for transferring ==== */
  73. #define DMAC_TRANS_ADR_NO_INC (1) /* Not increment */
  74. #define DMAC_TRANS_ADR_INC (0) /* Increment */
  75. /* ==== Method for detecting DMA request ==== */
  76. #define DMAC_REQ_DET_FALL (0) /* Falling edge detection */
  77. #define DMAC_REQ_DET_RISE (1) /* Rising edge detection */
  78. #define DMAC_REQ_DET_LOW (2) /* Low level detection */
  79. #define DMAC_REQ_DET_HIGH (3) /* High level detection */
  80. /* ==== Request Direction ==== */
  81. #define DMAC_REQ_DIR_SRC (0) /* DMAREQ is the source/ DMAACK is active when reading */
  82. #define DMAC_REQ_DIR_DST (1) /* DMAREQ is the destination/ DMAACK is active when writing */
  83. /* ==== Descriptors ==== */
  84. #define DMAC_DESC_HEADER (0) /* Header */
  85. #define DMAC_DESC_SRC_ADDR (1) /* Source Address */
  86. #define DMAC_DESC_DST_ADDR (2) /* Destination Address */
  87. #define DMAC_DESC_COUNT (3) /* Transaction Byte */
  88. #define DMAC_DESC_CHCFG (4) /* Channel Confg */
  89. #define DMAC_DESC_CHITVL (5) /* Channel Interval */
  90. #define DMAC_DESC_CHEXT (6) /* Channel Extension */
  91. #define DMAC_DESC_LINK_ADDR (7) /* Link Address */
  92. /* ==== On-chip peripheral module requests ===== */
  93. typedef enum dmac_request_factor
  94. {
  95. DMAC_REQ_USB0_DMA0_TX, /* USB_0 channel 0 transmit FIFO empty */
  96. DMAC_REQ_USB0_DMA0_RX, /* USB_0 channel 0 receive FIFO full */
  97. DMAC_REQ_USB0_DMA1_TX, /* USB_0 channel 1 transmit FIFO empty */
  98. DMAC_REQ_USB0_DMA1_RX, /* USB_0 channel 1 receive FIFO full */
  99. DMAC_REQ_USB1_DMA0_TX, /* USB_1 channel 0 transmit FIFO empty */
  100. DMAC_REQ_USB1_DMA0_RX, /* USB_1 channel 0 receive FIFO full */
  101. DMAC_REQ_USB1_DMA1_TX, /* USB_1 channel 1 transmit FIFO empty */
  102. DMAC_REQ_USB1_DMA1_RX, /* USB_1 channel 1 receive FIFO full */
  103. } dmac_request_factor_t;
  104. /*******************************************************************************
  105. Exported global variables and functions (to be accessed by other files)
  106. *******************************************************************************/
  107. void usb1_function_DMAC3_PeriReqInit(const dmac_transinfo_t *trans_info, uint32_t dmamode, uint32_t continuation,
  108. uint32_t request_factor, uint32_t req_direction);
  109. int32_t usb1_function_DMAC3_Open(uint32_t req);
  110. void usb1_function_DMAC3_Close(uint32_t *remain);
  111. void usb1_function_DMAC3_Load_Set(uint32_t src_addr, uint32_t dst_addr, uint32_t count);
  112. void usb1_function_DMAC4_PeriReqInit(const dmac_transinfo_t *trans_info, uint32_t dmamode, uint32_t continuation,
  113. uint32_t request_factor, uint32_t req_direction);
  114. int32_t usb1_function_DMAC4_Open(uint32_t req);
  115. void usb1_function_DMAC4_Close(uint32_t *remain);
  116. void usb1_function_DMAC4_Load_Set(uint32_t src_addr, uint32_t dst_addr, uint32_t count);
  117. #ifdef __cplusplus
  118. }
  119. #endif
  120. #endif /* USB1_FUNCTION_DMACDRV_H */
  121. /* End of File */