tinyusb  0.4
Click here to lend your support to tinyusb donation and make a donation at pledgie.com
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
custom_class.h
Go to the documentation of this file.
1 /**************************************************************************/
37 /**************************************************************************/
38 
43 #ifndef _TUSB_CUSTOM_CLASS_H_
44 #define _TUSB_CUSTOM_CLASS_H_
45 
46 #include "common/common.h"
47 #include "host/usbh.h"
48 
49 #ifdef __cplusplus
50  extern "C" {
51 #endif
52 
53 typedef struct {
54  pipe_handle_t pipe_in;
55  pipe_handle_t pipe_out;
57 
58 //--------------------------------------------------------------------+
59 // USBH-CLASS DRIVER API
60 //--------------------------------------------------------------------+
61 STATIC_ INLINE_ bool tusbh_custom_is_mounted(uint8_t dev_addr, uint16_t vendor_id, uint16_t product_id) ATTR_PURE ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
62 STATIC_ INLINE_ bool tusbh_custom_is_mounted(uint8_t dev_addr, uint16_t vendor_id, uint16_t product_id)
63 {
64  (void) vendor_id; // TODO check this later
65  (void) product_id;
66 // return (tusbh_device_get_mounted_class_flag(dev_addr) & BIT_(TUSB_CLASS_MAPPED_INDEX_END-1) ) != 0;
67  return false;
68 }
69 
70 tusb_error_t tusbh_custom_read(uint8_t dev_addr, uint16_t vendor_id, uint16_t product_id, void * p_buffer, uint16_t length);
71 tusb_error_t tusbh_custom_write(uint8_t dev_addr, uint16_t vendor_id, uint16_t product_id, void const * p_data, uint16_t length);
72 
73 #ifdef _TINY_USB_SOURCE_FILE_
74 
75 void cush_init(void);
76 tusb_error_t cush_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t const *p_interface_desc, uint16_t *p_length) ATTR_WARN_UNUSED_RESULT;
77 void cush_isr(pipe_handle_t pipe_hdl, tusb_event_t event);
78 void cush_close(uint8_t dev_addr);
79 
80 #endif
81 
82 #ifdef __cplusplus
83  }
84 #endif
85 
86 #endif /* _TUSB_CUSTOM_CLASS_H_ */
87 
USB Standard Interface Descriptor (section 9.6.1 table 9-12)
#define ATTR_WARN_UNUSED_RESULT
The warn_unused_result attribute causes a warning to be emitted if a caller of the function with this...
Definition: compiler_gcc.h:118
#define ATTR_PURE
Many functions have no effects except the return value and their return value depends only on the par...
Definition: compiler_gcc.h:96
tusb_error_t
Error Code returned.
Definition: tusb_errors.h:100
#define ATTR_ALWAYS_INLINE
Generally, functions are not inlined unless optimization is specified. For functions declared inline...
Definition: compiler_gcc.h:89