Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

usb0_host_api.h 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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_host_api.h
  25. * $Rev: 1116 $
  26. * $Date:: 2014-07-09 16:29:19 +0900#$
  27. * Description : RZ/A1H R7S72100 USB Sample Program
  28. *******************************************************************************/
  29. #ifndef USB0_HOST_API_H
  30. #define USB0_HOST_API_H
  31. /*******************************************************************************
  32. Typedef definitions
  33. *******************************************************************************/
  34. /*******************************************************************************
  35. Macro definitions
  36. *******************************************************************************/
  37. /*******************************************************************************
  38. Variable Externs
  39. *******************************************************************************/
  40. /*******************************************************************************
  41. Functions Prototypes
  42. *******************************************************************************/
  43. void usb0_host_interrupt(uint32_t int_sense);
  44. void usb0_host_dma_interrupt_d0fifo(uint32_t int_sense);
  45. void usb0_host_dma_interrupt_d1fifo(uint32_t int_sense);
  46. uint16_t usb0_api_host_init(uint8_t int_level, uint16_t mode, uint16_t clockmode);
  47. int32_t usb0_api_host_enumeration(uint16_t devadr);
  48. int32_t usb0_api_host_detach(void);
  49. int32_t usb0_api_host_data_in(uint16_t devadr, uint16_t Pipe, uint32_t Size, uint8_t *data_buf);
  50. int32_t usb0_api_host_data_out(uint16_t devadr, uint16_t Pipe, uint32_t Size, uint8_t *data_buf);
  51. int32_t usb0_api_host_control_transfer(uint16_t devadr, uint16_t Req, uint16_t Val, uint16_t Indx, uint16_t Len, uint8_t *Buf);
  52. int32_t usb0_api_host_set_endpoint(uint16_t devadr, USB_HOST_CFG_PIPETBL_t *user_table, uint8_t *configdescriptor);
  53. int32_t usb0_api_host_clear_endpoint(USB_HOST_CFG_PIPETBL_t *user_table);
  54. int32_t usb0_api_host_clear_endpoint_pipe(uint16_t pipe_sel, USB_HOST_CFG_PIPETBL_t *user_table);
  55. uint16_t usb0_api_host_SetEndpointTable(uint16_t devadr, USB_HOST_CFG_PIPETBL_t *user_table, uint8_t* Table);
  56. int32_t usb0_api_host_data_count(uint16_t pipe, uint32_t *data_count);
  57. int32_t usb0_api_host_GetDeviceDescriptor(uint16_t devadr, uint16_t size, uint8_t *buf);
  58. int32_t usb0_api_host_GetConfigDescriptor(uint16_t devadr, uint16_t size, uint8_t *buf);
  59. int32_t usb0_api_host_SetConfig(uint16_t devadr, uint16_t confignum);
  60. int32_t usb0_api_host_SetInterface(uint16_t devadr, uint16_t interface_alt, uint16_t interface_index);
  61. int32_t usb0_api_host_ClearStall(uint16_t devadr, uint16_t ep_dir);
  62. uint16_t usb0_api_host_GetUsbDeviceState(void);
  63. void usb0_api_host_elt_4_4(void);
  64. void usb0_api_host_elt_4_5(void);
  65. void usb0_api_host_elt_4_6(void);
  66. void usb0_api_host_elt_4_7(void);
  67. void usb0_api_host_elt_4_8(void);
  68. void usb0_api_host_elt_4_9(void);
  69. void usb0_api_host_elt_get_desc(void);
  70. void usb0_host_EL_ModeInit(void);
  71. void usb0_host_EL_SetUACT(void);
  72. void usb0_host_EL_ClearUACT(void);
  73. void usb0_host_EL_SetTESTMODE(uint16_t mode);
  74. void usb0_host_EL_ClearNRDYSTS(uint16_t pipe);
  75. uint16_t usb0_host_EL_GetINTSTS1(void);
  76. void usb0_host_EL_UsbBusReset(void);
  77. void usb0_host_EL_UsbAttach(void);
  78. void usb0_host_EL_SetupStage(uint16_t Req, uint16_t Val, uint16_t Indx, uint16_t Len);
  79. void usb0_host_EL_StatusStage(void);
  80. void usb0_host_EL_CtrlReadStart(uint32_t Bsize, uint8_t *Table);
  81. int32_t usb0_host_EL_UsbSuspend(void);
  82. int32_t usb0_host_EL_UsbResume(void);
  83. #if 0 /* prototype in devdrv_usb_host_api.h */
  84. uint16_t Userdef_USB_usb0_host_d0fifo_dmaintid(void);
  85. uint16_t Userdef_USB_usb0_host_d1fifo_dmaintid(void);
  86. void Userdef_USB_usb0_host_attach(void);
  87. void Userdef_USB_usb0_host_detach(void);
  88. void Userdef_USB_usb0_host_delay_1ms(void);
  89. void Userdef_USB_usb0_host_delay_xms(uint32_t msec);
  90. void Userdef_USB_usb0_host_delay_10us(uint32_t usec);
  91. void Userdef_USB_usb0_host_delay_500ns(void);
  92. void Userdef_USB_usb0_host_start_dma(USB_HOST_DMA_t *dma, uint16_t dfacc);
  93. uint32_t Userdef_USB_usb0_host_stop_dma0(void);
  94. uint32_t Userdef_USB_usb0_host_stop_dma1(void);
  95. #endif
  96. #endif /* USB0_HOST_API_H */
  97. /* End of File */