STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
usbh_mtp.h
Go to the documentation of this file.
1 
28 /* Define to prevent recursive ----------------------------------------------*/
29 #ifndef __USBH_MTP_H
30 #define __USBH_MTP_H
31 
32 #ifdef __cplusplus
33  extern "C" {
34 #endif
35 
36 /* Includes ------------------------------------------------------------------*/
37 #include "usbh_mtp_ptp.h"
38 #include "usbh_core.h"
39 
40 
61 /*Communication Class codes*/
62 #define USB_MTP_CLASS 0x06 /* Still Image Class)*/
63 #define MTP_MAX_STORAGE_UNITS_NBR PTP_MAX_STORAGE_UNITS_NBR
64 
72 typedef enum
73 {
74  MTP_IDLE = 0,
80 }
82 
83 
84 typedef enum
85 {
88 }
90 
91 
92 typedef struct
93 {
94  MTP_EventsStateTypeDef state;
95  uint32_t timer;
96  uint16_t poll;
98 }
100 
101 typedef struct
102 {
103 
108  uint32_t Objdepth;
109 }
111 
112 
113 typedef struct
114 {
119 }
121 
122 /* Structure for MTP process */
123 typedef struct _MTP_Process
124 {
127 
128  uint8_t DataInPipe;
129  uint8_t DataOutPipe;
131 
132  uint8_t DataOutEp;
133  uint8_t DataInEp;
134  uint8_t NotificationEp;
135 
136  uint16_t DataOutEpSize;
137  uint16_t DataInEpSize;
139  MTP_StateTypeDef state;
143  uint32_t is_ready;
144 }
146 
147 #define MTP_StorageInfoTypedef PTP_StorageInfoTypedef
148 #define MTP_ObjectHandlesTypedef PTP_ObjectHandlesTypedef
149 #define MTP_ObjectInfoTypedef PTP_ObjectInfoTypedef
150 
173 #define USBH_MTP_CLASS &MTP_Class
174 
182 uint8_t USBH_MTP_IsReady (USBH_HandleTypeDef *phost);
183 USBH_StatusTypeDef USBH_MTP_SelectStorage (USBH_HandleTypeDef *phost, uint8_t storage_idx);
184 USBH_StatusTypeDef USBH_MTP_GetNumStorage (USBH_HandleTypeDef *phost, uint8_t *storage_num);
186  uint32_t storage_id,
187  uint32_t objectformatcode,
188  uint32_t associationOH,
189  uint32_t* numobs);
191  uint8_t storage_idx,
193 
195  uint32_t storage_id,
196  uint32_t objectformatcode,
197  uint32_t associationOH,
198  PTP_ObjectHandlesTypedef* objecthandles);
199 
201  uint32_t handle,
202  PTP_ObjectInfoTypedef* objectinfo);
203 
205  uint32_t handle,
206  uint32_t objectformatcode);
207 
209  uint32_t handle,
210  uint8_t *object);
211 
213  uint32_t handle,
214  uint32_t offset,
215  uint32_t maxbytes,
216  uint8_t *object,
217  uint32_t *len);
218 
220  uint16_t ofc,
221  uint32_t *propnum,
222  uint16_t *props);
223 
225  uint16_t opc,
226  uint16_t ofc,
228 
230  uint32_t handle,
231  MTP_PropertiesTypedef *pprops,
232  uint32_t *nrofprops);
233 
235  uint32_t handle,
236  uint8_t *object,
237  uint32_t size);
238 
240  uint16_t propcode,
241  PTP_DevicePropDescTypdef* devicepropertydesc);
242 
243 void USBH_MTP_EventsCallback(USBH_HandleTypeDef *phost, uint32_t event, uint32_t param);
248 #ifdef __cplusplus
249 }
250 #endif
251 
252 #endif /* __USBH_MTP_H */
253 
269 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
270 
USBH_StatusTypeDef USBH_MTP_GetNumStorage(USBH_HandleTypeDef *phost, uint8_t *storage_num)
USBH_MTP_GetNumStorage Select the storage Unit to be used.
Definition: usbh_mtp.c:525
#define MTP_StorageInfoTypedef
Definition: usbh_mtp.h:147
Header file for usbh_core.c.
uint8_t DataOutPipe
Definition: usbh_mtp.h:129
USBH_StatusTypeDef USBH_MTP_GetObjectHandles(USBH_HandleTypeDef *phost, uint32_t storage_id, uint32_t objectformatcode, uint32_t associationOH, PTP_ObjectHandlesTypedef *objecthandles)
USBH_MTP_GetStorageInfo Get the storage Unit info.
Definition: usbh_mtp.c:617
Header file for usbh_mtp_ptp.c.
uint8_t DataInEp
Definition: usbh_mtp.h:133
uint8_t ObjectHandlerNbr
Definition: usbh_mtp.h:107
uint32_t Objdepth
Definition: usbh_mtp.h:108
MTP_EventsStateTypeDef
Definition: usbh_mtp.h:84
USBH_StatusTypeDef USBH_MTP_DeleteObject(USBH_HandleTypeDef *phost, uint32_t handle, uint32_t objectformatcode)
USBH_MTP_DeleteObject Delete an object.
Definition: usbh_mtp.c:678
uint32_t ObjectFormatCode
Definition: usbh_mtp.h:105
uint8_t DataOutEp
Definition: usbh_mtp.h:132
uint32_t CurrentObjectHandler
Definition: usbh_mtp.h:106
uint32_t current_storage_unit
Definition: usbh_mtp.h:142
void USBH_MTP_EventsCallback(USBH_HandleTypeDef *phost, uint32_t event, uint32_t param)
The function informs that host has received an event.
Definition: usbh_mtp.c:1057
USBH_StatusTypeDef USBH_MTP_GetObjectPropsSupported(USBH_HandleTypeDef *phost, uint16_t ofc, uint32_t *propnum, uint16_t *props)
USBH_MTP_GetObjectPropsSupported Gets object partially.
Definition: usbh_mtp.c:770
PTP_HandleTypeDef ptp
Definition: usbh_mtp.h:141
MTP_InfoTypedef info
Definition: usbh_mtp.h:125
uint8_t USBH_MTP_IsReady(USBH_HandleTypeDef *phost)
USBH_MTP_IsReady Select the storage Unit to be used.
Definition: usbh_mtp.c:512
MTP_EventHandleTypedef events
Definition: usbh_mtp.h:140
uint16_t DataInEpSize
Definition: usbh_mtp.h:137
PTP_StorageIDsTypedef storids
Definition: usbh_mtp.h:116
USBH_StatusTypeDef USBH_MTP_GetObjectPropList(USBH_HandleTypeDef *phost, uint32_t handle, MTP_PropertiesTypedef *pprops, uint32_t *nrofprops)
USBH_MTP_GetObjectPropList Gets object partially.
Definition: usbh_mtp.c:834
USBH_StatusTypeDef USBH_MTP_GetNumObjects(USBH_HandleTypeDef *phost, uint32_t storage_id, uint32_t objectformatcode, uint32_t associationOH, uint32_t *numobs)
USBH_MTP_GetStorageInfo Get the storage Unit info.
Definition: usbh_mtp.c:584
uint8_t NotificationPipe
Definition: usbh_mtp.h:130
MTP_EventsStateTypeDef state
Definition: usbh_mtp.h:94
uint32_t is_ready
Definition: usbh_mtp.h:143
uint8_t DataInPipe
Definition: usbh_mtp.h:128
PTP_DeviceInfoTypedef devinfo
Definition: usbh_mtp.h:115
USBH_StatusTypeDef USBH_MTP_GetStorageInfo(USBH_HandleTypeDef *phost, uint8_t storage_idx, MTP_StorageInfoTypedef *info)
USBH_MTP_GetStorageInfo Get the storage Unit info.
Definition: usbh_mtp.c:565
USBH_StatusTypeDef
Definition: usbh_def.h:302
USBH_StatusTypeDef USBH_MTP_GetObjectInfo(USBH_HandleTypeDef *phost, uint32_t handle, PTP_ObjectInfoTypedef *objectinfo)
USBH_PTP_GetObjectInfo Gets objert info.
Definition: usbh_mtp.c:651
USBH_StatusTypeDef USBH_MTP_GetObject(USBH_HandleTypeDef *phost, uint32_t handle, uint8_t *object)
USBH_MTP_GetObject Gets object.
Definition: usbh_mtp.c:706
USBH_StatusTypeDef USBH_MTP_GetDevicePropDesc(USBH_HandleTypeDef *phost, uint16_t propcode, PTP_DevicePropDescTypdef *devicepropertydesc)
USBH_MTP_GetDevicePropDesc Gets object partially.
Definition: usbh_mtp.c:1031
struct _MTP_Process MTP_HandleTypeDef
uint32_t CurrentStorageId
Definition: usbh_mtp.h:104
PTP_EventContainerTypedef container
Definition: usbh_mtp.h:97
uint8_t NotificationEp
Definition: usbh_mtp.h:134
uint16_t DataOutEpSize
Definition: usbh_mtp.h:136
#define MTP_MAX_STORAGE_UNITS_NBR
Definition: usbh_mtp.h:63
MTP_ParamsTypedef params
Definition: usbh_mtp.h:126
MTP_StateTypeDef
Definition: usbh_mtp.h:72
USBH_StatusTypeDef USBH_MTP_GetObjectPropDesc(USBH_HandleTypeDef *phost, uint16_t opc, uint16_t ofc, PTP_ObjectPropDescTypeDef *opd)
USBH_MTP_GetObjectPropDesc Gets object partially.
Definition: usbh_mtp.c:802
USBH_StatusTypeDef USBH_MTP_SendObject(USBH_HandleTypeDef *phost, uint32_t handle, uint8_t *object, uint32_t size)
USBH_MTP_SendObject Send an object.
Definition: usbh_mtp.c:866
uint16_t NotificationEpSize
Definition: usbh_mtp.h:138
USBH_StatusTypeDef USBH_MTP_SelectStorage(USBH_HandleTypeDef *phost, uint8_t storage_idx)
USBH_MTP_SelectStorage Select the storage Unit to be used.
Definition: usbh_mtp.c:545
PTP_ObjectHandlesTypedef Handles
Definition: usbh_mtp.h:118
USBH_ClassTypeDef MTP_Class
Definition: usbh_mtp.c:117
MTP_StateTypeDef state
Definition: usbh_mtp.h:139
USBH_StatusTypeDef USBH_MTP_GetPartialObject(USBH_HandleTypeDef *phost, uint32_t handle, uint32_t offset, uint32_t maxbytes, uint8_t *object, uint32_t *len)
USBH_MTP_GetPartialObject Gets object.
Definition: usbh_mtp.c:734