omap3530/beagle_drivers/wb/api/include/cyasmtp.h
changeset 27 117faf51deac
equal deleted inserted replaced
26:b7e488c49d0d 27:117faf51deac
       
     1 /* Cypress West Bridge API header file (cyasmtp.h)
       
     2  ## ===========================
       
     3  ##
       
     4  ##  Copyright Cypress Semiconductor Corporation, 2006-2009,
       
     5  ##  All Rights Reserved
       
     6  ##  UNPUBLISHED, LICENSED SOFTWARE.
       
     7  ##
       
     8  ##  CONFIDENTIAL AND PROPRIETARY INFORMATION
       
     9  ##  WHICH IS THE PROPERTY OF CYPRESS.
       
    10  ##
       
    11  ##  Use of this file is governed
       
    12  ##  by the license agreement included in the file
       
    13  ##
       
    14  ##     <install>/license/license.txt
       
    15  ##
       
    16  ##  where <install> is the Cypress software
       
    17  ##  installation root directory path.
       
    18  ##
       
    19  ## ===========================
       
    20 */
       
    21 
       
    22 #ifndef _INCLUDED_CYASMTP_H_
       
    23 #define _INCLUDED_CYASMTP_H_
       
    24 
       
    25 #include "cyasmisc.h"
       
    26 
       
    27 #include "cyas_cplus_start.h"
       
    28 
       
    29 /*@@Media Transfer Protocol (MTP) Overview
       
    30   Summary
       
    31   The MTP API has been designed to allow MTP enabled West Bridge devices to implement
       
    32   the MTP protocol while maintaining high performance. West Bridge has the capability
       
    33   to enter into a Turbo mode during a MTP SendObject or GetObject operation enabling
       
    34   it to directly stream the data into or out of the attached SD card with minimal 
       
    35   involvement from the Processor.
       
    36 
       
    37   Description
       
    38   The MTP API is designed to act as a pass through implementation of the MTP protocol
       
    39   for all operations. Each MTP transaction received from the Host is passed through West Bridge
       
    40   and along to the Processor. The Processor can then respond to the transaction and pass 
       
    41   data and/or responses back to the Host through West Bridge. 
       
    42 
       
    43   The MTP API also allows for a high speed handling of MTP SendObject and GetObject operations,
       
    44   referred to as Turbo MTP. During a Turbo MTP operation West Bridge is responsible for reading
       
    45   or writing the data for the MTP operation directly from or to the SD card with minimal
       
    46   interaction from the Processor. The is done by having the Processor transfer a Block Table
       
    47   to West Bridge which contains the locations on the SD card that need to be read or written.
       
    48   During the handling of a Turbo Operation the Processor will then only periodically need to send
       
    49   a new Block Table to West Bridge when the first is used up. See the CyAsMTPInitSendObject and
       
    50   CyAsMTPInitGetObject functions for more details.
       
    51 
       
    52   In order to enable the MTP API you must first have a MTP enabled West Bridge loaded with
       
    53   MTP firmware. You then must start the USB and Storage APIs before starting the MTP API. See
       
    54   CyAsMTPStart for more details.
       
    55 */
       
    56 
       
    57 /*@@Endpoints
       
    58   Summary
       
    59   When using MTP firmware endpoints 2 and 6 are dedicated to bulk MTP traffic
       
    60   and endpoint 1 is available for MTP events.
       
    61 
       
    62   Description
       
    63   When using a MTP enabled West Brdige device endpoints 2 and 6 are made available for
       
    64   use to implement the MTP protocol. These endpoints have a few special restrictions noted
       
    65   below but otherwise the existing USB APIs can be used normally with these endpoints.
       
    66 
       
    67   1. CyAsUsbSetNak, CyAsUsbClearNak, and CyAsUsbGetNak are disabled for these endpoints
       
    68   2. During a turbo operation CyAsUsbSetStall, CyAsUsbClearStall, and CyAsUsbGetStall are disabled.
       
    69   
       
    70 */
       
    71 
       
    72 
       
    73 /* Summary
       
    74    This constants defines the maximum number of
       
    75    entries in the Block Table used to describe
       
    76    the locations for Send/GetObject operations.
       
    77 
       
    78    See Also
       
    79    * CyAsMtpSendObject
       
    80    * CyAsMtpGetObject
       
    81 */
       
    82 #define CY_AS_MAX_BLOCK_TABLE_ENTRIES 64
       
    83 
       
    84 /* Summary
       
    85    Endpoint to be used for MTP reads from the USB host.
       
    86  */
       
    87 #define CY_AS_MTP_READ_ENDPOINT         (2)
       
    88 
       
    89 /* Summary
       
    90    Endpoint to be used fro MTP writes to the USB host.
       
    91  */
       
    92 #define CY_AS_MTP_WRITE_ENDPOINT        (6)
       
    93 
       
    94 /*****************************************************************************
       
    95  * MTP Types
       
    96  ****************************************************************************/
       
    97 
       
    98 /* Summary
       
    99    The BlockTable used for turbo operations.
       
   100 
       
   101    Description
       
   102    This struct is used to specify the blocks
       
   103    to be used for both read/write and send/getObject 
       
   104    operations. 
       
   105 
       
   106    The start block is a starting Logical Block Address
       
   107    and num block is the number of blocks in that contiguous
       
   108    region.
       
   109 			
       
   110    start_blocks[i]->[-------] <- start_blocks[i] + num_blocks[i]
       
   111    
       
   112    If you need fewer than CY_AS_MAX_BLOCK_TABLE_ENTRIES 
       
   113    the remainder should be left empty. Empty is defined
       
   114    as num_blocks equal to 0. 
       
   115 
       
   116    See Also
       
   117    * CyAsMTPInitSendObject
       
   118    * CyAsMTPInitGetObject
       
   119 
       
   120 */
       
   121 typedef struct CyAsMTPBlockTable
       
   122 {
       
   123     uint32_t start_blocks[CY_AS_MAX_BLOCK_TABLE_ENTRIES] ;
       
   124     uint16_t num_blocks[CY_AS_MAX_BLOCK_TABLE_ENTRIES] ;
       
   125 } CyAsMTPBlockTable ;
       
   126 
       
   127 /* Summary
       
   128    This type specifies the type of MTP event that has occurred.
       
   129 
       
   130    Description
       
   131    MTP events are used to communicate that West Bridge has
       
   132    either finished the handling of the given operation, or
       
   133    that it requires additional data to complete the operation.
       
   134 
       
   135    In no case does West Bridge send any MTP protocol responses,
       
   136    this always remain the responsibility of the client.
       
   137 
       
   138    See Also
       
   139    * CyAsMTPInitSendObject
       
   140    * CyAsMTPInitGetObject
       
   141    * CyAsMTPSendBlockTable
       
   142 
       
   143 */
       
   144 typedef enum CyAsMTPEvent
       
   145 {
       
   146     CyAsMTPSendObjectComplete,	/* This event is sent when West Bridge
       
   147 				has finished writing the data from a
       
   148 				SendObject. West Bridge will -not- send
       
   149 				the MTP response. */
       
   150     CyAsMTPGetObjectComplete,	/* This event is sent when West Bridge 
       
   151 				has finished sending the data for a
       
   152 				GetObject operation. West Bridge will
       
   153 				-not- send the MTP response. */
       
   154     CyAsMTPBlockTableNeeded	/* This event is called when West Bridge
       
   155 				needs a new BlockTable. This is only a
       
   156 				notification, to transfer a BlockTable
       
   157 				to West Bridge the CyAsMTPSendBlockTable 
       
   158 				use the function. While West Bridge is waiting
       
   159 				for a BlockTable during a SendObject it 
       
   160 				may need to NAK the Endpoint. It is important
       
   161 				that the CyAsMTPSendBlockTable call is made
       
   162 				in a timely manner as eventually a delay
       
   163 				will result in an USB reset. This event has 
       
   164 				no data */
       
   165 } CyAsMTPEvent ;
       
   166 
       
   167 /* Summary
       
   168    Data for the CyAsMTPSendObjectComplete event.
       
   169 
       
   170    Description
       
   171    Notification that a SendObject operation has been completed. The
       
   172    status of the operation is given (to distinguish between a cancelled
       
   173    and a success for example) as well as the block count. The blocks
       
   174    are used in order based on the current block table. If more than
       
   175    one block table was used for a given SendObject the count will
       
   176    include the total number of blocks written.
       
   177 
       
   178    This callback will be made only once per SendObject operation 
       
   179    and it will only be called after all of the data has been 
       
   180    committed to the SD card.
       
   181 
       
   182    See Also
       
   183    * CyAsMTPEvent
       
   184 
       
   185  */
       
   186 typedef struct CyAsMTPSendObjectCompleteData
       
   187 {
       
   188     CyAsReturnStatus_t status ;
       
   189     uint32_t byte_count ;
       
   190     uint32_t transaction_id ;
       
   191 } CyAsMTPSendObjectCompleteData ;
       
   192 
       
   193 /*  Summary 
       
   194     Data for the CyAsMTPGetObjectComplete event.
       
   195 
       
   196     Description
       
   197     Notification that a GetObject has finished. This
       
   198     event allows the P side to know when to send the MTP
       
   199     response for the GetObject operation.
       
   200 
       
   201     See Also
       
   202     * CyAsMTPEvent
       
   203 
       
   204 */
       
   205 typedef struct CyAsMTPGetObjectCompleteData
       
   206 {
       
   207     CyAsReturnStatus_t status ;
       
   208     uint32_t byte_count ;
       
   209 } CyAsMTPGetObjectCompleteData ;
       
   210 
       
   211 /*  Summary
       
   212     MTP Event callback.
       
   213     
       
   214     Description
       
   215     Callback used to communicate that a SendObject
       
   216     operation has finished.
       
   217 
       
   218     See Also
       
   219     * CyAsMTPEvent
       
   220 */
       
   221 typedef void (*CyAsMTPEventCallback)(
       
   222     CyAsDeviceHandle handle,
       
   223     CyAsMTPEvent evtype,
       
   224     void* evdata
       
   225     ) ;
       
   226 
       
   227 /* Summary
       
   228    This is the callback function called after asynchronous API functions have completed.
       
   229 
       
   230    Description
       
   231    When calling API functions from callback routines (interrupt handlers usually) the async version of
       
   232    these functions must be used.  This callback is called when an asynchronous API function has completed.
       
   233 */
       
   234 typedef void (*CyAsMTPFunctionCallback)(
       
   235     CyAsDeviceHandle			handle,		/* Handle to the device to configure */
       
   236     CyAsReturnStatus_t			status,		/* The error status of the operation */
       
   237     uint32_t				client		/* A client supplied 32 bit tag */
       
   238 ) ;
       
   239 
       
   240 /*****************************************************************************
       
   241  * MTP Functions
       
   242  ****************************************************************************/
       
   243 
       
   244 /* Summary
       
   245    This function starts the MTP stack.
       
   246   
       
   247    Description
       
   248    Initializes West Bridge for MTP activity and registers the MTP 
       
   249    event callback.
       
   250 
       
   251    Before calling CyAsMTPStart, CyAsUsbStart and CyAsStorageStart must be
       
   252    called (in either order).
       
   253 
       
   254    MTPStart must be called before the device is enumerated. Please
       
   255    see the documentation for CyAsUsbSetEnumConfig and CyAsUsbEnumControl
       
   256    for details on enumerating a device for MTP. 
       
   257 
       
   258    Calling MTPStart will not affect any ongoing P<->S traffic.
       
   259 
       
   260    This requires a MTP firmware image to be loaded on West Bridge.
       
   261 
       
   262    Returns
       
   263    * CY_AS_ERROR_SUCCESS
       
   264    * CY_AS_ERROR_INVALID_HANDLE
       
   265    * CY_AS_ERROR_NOT_CONFIGURED
       
   266    * CY_AS_ERROR_NO_FIRMWARE
       
   267    * CY_AS_ERROR_IN_SUSPEND
       
   268    * CY_AS_ERROR_INVALID_IN_CALLBACK
       
   269    * CY_AS_ERROR_STARTSTOP_PENDING
       
   270    * CY_AS_ERROR_NOT_RUNNING - CyAsUsbStart or CyAsStorageStart have not been called
       
   271    * CY_AS_ERROR_NOT_SUPPORTED - West Bridge is not running firmware with MTP support
       
   272    * CY_AS_ERROR_OUT_OF_MEMORY
       
   273    * CY_AS_ERROR_INVALID_RESPONSE
       
   274 
       
   275 
       
   276    See Also
       
   277    * CyAsMTPStop
       
   278    * CyAsUsbStart
       
   279    * CyAsStorageStart
       
   280    * CyAsUsbSetEnumConfig
       
   281    * CyAsUsbEnumControl
       
   282 */
       
   283 CyAsReturnStatus_t 
       
   284 CyAsMTPStart(
       
   285     CyAsDeviceHandle handle,
       
   286     CyAsMTPEventCallback eventCB,
       
   287     CyAsFunctionCallback cb,
       
   288     uint32_t client
       
   289     ) ;
       
   290 
       
   291 
       
   292 /*  Summary 
       
   293     This function stops the MTP stack.
       
   294 
       
   295     Description
       
   296     Stops all MTP activity. Any ongoing transfers are
       
   297     canceled. 
       
   298 
       
   299     This will not cause a UsbDisconnect but all
       
   300     MTP activity (both pass through and turbo) will
       
   301     stop. 
       
   302 
       
   303     Returns
       
   304    * CY_AS_ERROR_SUCCESS
       
   305    * CY_AS_ERROR_INVALID_HANDLE
       
   306    * CY_AS_ERROR_NOT_CONFIGURED
       
   307    * CY_AS_ERROR_NO_FIRMWARE
       
   308    * CY_AS_ERROR_NOT_RUNNING
       
   309    * CY_AS_ERROR_IN_SUSPEND
       
   310    * CY_AS_ERROR_INVALID_IN_CALLBACK
       
   311    * CY_AS_ERROR_STARTSTOP_PENDING
       
   312    * CY_AS_ERROR_OUT_OF_MEMORY
       
   313    * CY_AS_ERROR_INVALID_RESPONSE
       
   314 
       
   315 
       
   316     See Also
       
   317     * CyAsMTPStart
       
   318 */
       
   319 CyAsReturnStatus_t 
       
   320 CyAsMTPStop(
       
   321     CyAsDeviceHandle handle,
       
   322     CyAsFunctionCallback cb,
       
   323     uint32_t client
       
   324     ) ;
       
   325 
       
   326 /*  Summary 
       
   327     This function sets up a Turbo SendObject operation.
       
   328     
       
   329     Description
       
   330     Calling this function will setup West Bridge to
       
   331     enable Tubo handling of the next SendObject
       
   332     operation received. This will pass down the initial
       
   333     block table to the firmware and setup a direct u->s
       
   334     write for the SendObject operation. 
       
   335     
       
   336     If this function is not called before a SendObject 
       
   337     operation is seen  the SendObject operation and data 
       
   338     will be passed along to the P port like any other MTP 
       
   339     command. It would then be the responsibility of the 
       
   340     client to perform a normal StorageWrite call to 
       
   341     store the data on the SD card. N.B. This will be
       
   342     very slow compared with the Turbo handling.
       
   343 
       
   344     The completion of this function only signals that
       
   345     West Bridge has been set up to receive the next SendObject
       
   346     operation. When the SendObject operation has been fully
       
   347     handled and the data written to the SD card a separate
       
   348     event will be triggered.
       
   349 
       
   350     Returns
       
   351     * CY_AS_ERROR_SUCCESS
       
   352     * CY_AS_ERROR_INVALID_HANDLE
       
   353     * CY_AS_ERROR_NOT_CONFIGURED
       
   354     * CY_AS_ERROR_NO_FIRMWARE
       
   355     * CY_AS_ERROR_IN_SUSPEND
       
   356     * CY_AS_ERROR_NOT_RUNNING
       
   357     * CY_AS_ERROR_OUT_OF_MEMORY
       
   358     * CY_AS_ERROR_ASYNC_PENDING
       
   359     * CY_AS_ERROR_INVALID_RESPONSE
       
   360     * CY_AS_ERROR_NOT_SUPPORTED - West Bridge is not running firmware with MTP support
       
   361 
       
   362     See Also
       
   363     * CyAsMTPCancelSendObject
       
   364     * CyAsMTPInitGetObject
       
   365     * CyAsMTPEvent
       
   366     * CyAsMTPSendBlockTable
       
   367 */
       
   368 CyAsReturnStatus_t 
       
   369 CyAsMTPInitSendObject(
       
   370     CyAsDeviceHandle handle,
       
   371     CyAsMTPBlockTable* blk_table,
       
   372     uint32_t num_bytes,	
       
   373     CyAsFunctionCallback cb,
       
   374     uint32_t client
       
   375     ) ;
       
   376 
       
   377 /* Summary
       
   378    This function cancels an ongoing MTP operation.
       
   379 
       
   380    Description
       
   381    Causes West Bridge to cancel an ongoing SendObject
       
   382    operation. Note this is only a cancel to West Bridge,
       
   383    the MTP operation still needs to be canceled by
       
   384    sending a response.
       
   385 
       
   386    West Bridge will automatically set a Stall on the endpoint
       
   387    when the cancel is received. 
       
   388 
       
   389    This function is only valid after CyAsMTPInitSendObject
       
   390    has been called, but before the CyAsMTPSendObjectComplete
       
   391    event has been sent.
       
   392 
       
   393    Returns
       
   394    * CY_AS_ERROR_SUCCESS
       
   395    * CY_AS_ERROR_INVALID_HANDLE
       
   396    * CY_AS_ERROR_NOT_RUNNING
       
   397    * CY_AS_ERROR_OUT_OF_MEMORY
       
   398    * CY_AS_ERROR_INVALID_RESPONSE
       
   399    * CY_AS_ERROR_NOT_SUPPORTED - West Bridge is not running firmware with MTP support
       
   400    * CY_AS_ERROR_NO_OPERATION_PENDING
       
   401 
       
   402    See Also
       
   403    * CyAsMTPInitSendObject
       
   404 */
       
   405 CyAsReturnStatus_t 
       
   406 CyAsMTPCancelSendObject(
       
   407     CyAsDeviceHandle handle,
       
   408     CyAsFunctionCallback cb,
       
   409     uint32_t client
       
   410     ) ;
       
   411 
       
   412 /* Summary
       
   413    This function sets up a turbo GetObject operation.
       
   414 
       
   415    Description
       
   416    Called by the P in response to a GetObject
       
   417    operation. This provides West Bridge with the block
       
   418    addresses for the Object data that needs to be 
       
   419    transferred.
       
   420 
       
   421    It is the responsibility of the Processor to send the MTP operation
       
   422    before calling CyAsMTPInitGetObject. West Bridge will then send the
       
   423    data phase of the transaction, automatically creating the required container for
       
   424    Data. Once all of the Data has been transferred a callback will be issued to
       
   425    inform the Processor that the Data phase has completed allowing it to send
       
   426    the required MTP response.
       
   427 
       
   428    If an entire Block Table is used then after the
       
   429    last block is transferred the CyAsMTPBtCallback
       
   430    will be called to allow an additional Block Table(s)
       
   431    to be specified.
       
   432 
       
   433    Returns
       
   434    * CY_AS_ERROR_SUCCESS
       
   435    * CY_AS_ERROR_INVALID_HANDLE
       
   436    * CY_AS_ERROR_NOT_CONFIGURED
       
   437    * CY_AS_ERROR_NO_FIRMWARE
       
   438    * CY_AS_ERROR_NOT_RUNNING
       
   439    * CY_AS_ERROR_IN_SUSPEND
       
   440    * CY_AS_ERROR_OUT_OF_MEMORY
       
   441    * CY_AS_ERROR_ASYNC_PENDING
       
   442    * CY_AS_ERROR_INVALID_RESPONSE
       
   443    * CY_AS_ERROR_NOT_SUPPORTED - West Bridge is not running firmware with MTP support
       
   444 
       
   445    See Also
       
   446    * CyAsMTPInitSendObject
       
   447    * CyAsMTPCancelGetObject
       
   448    * CyAsMTPEvent
       
   449    * CyAsMTPSendBlockTable
       
   450 */
       
   451 CyAsReturnStatus_t 
       
   452 CyAsMTPInitGetObject(
       
   453     CyAsDeviceHandle handle,
       
   454     CyAsMTPBlockTable* table_p,
       
   455     uint32_t num_bytes,
       
   456     uint32_t transaction_id,
       
   457     CyAsFunctionCallback cb,
       
   458     uint32_t client
       
   459     ) ;
       
   460 
       
   461 /* Summary
       
   462    This function cancels an ongoing turbo GetObject 
       
   463    operation.
       
   464 
       
   465    Description
       
   466    Causes West Bridge to cancel an ongoing GetObject
       
   467    operation. Note this is only a cancel to West Bridge,
       
   468    the MTP operation still needs to be canceled by
       
   469    sending a response.
       
   470 
       
   471    This function is only valid after CyAsMTPGetSendObject
       
   472    has been called, but before the CyAsMTPGetObjectComplete
       
   473    event has been sent.
       
   474 
       
   475    Returns
       
   476    * CY_AS_ERROR_SUCCESS
       
   477    * CY_AS_ERROR_INVALID_HANDLE
       
   478    * CY_AS_ERROR_NOT_RUNNING
       
   479    * CY_AS_ERROR_OUT_OF_MEMORY
       
   480    * CY_AS_ERROR_INVALID_RESPONSE
       
   481    * CY_AS_ERROR_NOT_SUPPORTED - West Bridge is not running firmware with MTP support
       
   482    * CY_AS_ERROR_NO_OPERATION_PENDING
       
   483 
       
   484    See Also
       
   485    * CyAsMTPInitGetObject
       
   486 */
       
   487 CyAsReturnStatus_t 
       
   488 CyAsMTPCancelGetObject(
       
   489     CyAsDeviceHandle handle,
       
   490     CyAsFunctionCallback cb,
       
   491     uint32_t client
       
   492     ) ;
       
   493 
       
   494 /* Summary
       
   495    This function is used to transfer a BlockTable as part of 
       
   496    an ongoing MTP operation.
       
   497 
       
   498    Description
       
   499    This function is called in response to the CyAsMTPBlockTableNeeded
       
   500    event. This allows the client to pass in a BlockTable structure to
       
   501    West Bridge.
       
   502 
       
   503    The memory associated with the table will be copied and can be
       
   504    safely disposed of when the function returns if called synchronously,
       
   505    or when the callback is made if called asynchronously.
       
   506 
       
   507    This function is used for both SendObject and GetObject as both
       
   508    can generate the CyAsMTPBlockTableNeeded event.
       
   509 
       
   510    Returns
       
   511    * CY_AS_ERROR_SUCCESS
       
   512    * CY_AS_ERROR_INVALID_HANDLE
       
   513    * CY_AS_ERROR_NOT_CONFIGURED
       
   514    * CY_AS_ERROR_NO_FIRMWARE
       
   515    * CY_AS_ERROR_NOT_RUNNING
       
   516    * CY_AS_ERROR_IN_SUSPEND
       
   517    * CY_AS_ERROR_OUT_OF_MEMORY
       
   518    * CY_AS_ERROR_ASYNC_PENDING
       
   519    * CY_AS_ERROR_INVALID_RESPONSE
       
   520    * CY_AS_ERROR_NOT_SUPPORTED - West Bridge is not running firmware with MTP support
       
   521 
       
   522    See Also
       
   523    * CyAsMTPInitSendObject
       
   524    * CyAsMTPInitGetObject
       
   525 */
       
   526 CyAsReturnStatus_t 
       
   527 CyAsMTPSendBlockTable(
       
   528     CyAsDeviceHandle handle,
       
   529     CyAsMTPBlockTable* table,
       
   530     CyAsFunctionCallback cb,
       
   531     uint32_t client
       
   532     ) ;
       
   533 
       
   534 /* Summary
       
   535    This function is used to mark the start of a storage read/write burst from the
       
   536    P port processor.
       
   537 
       
   538    Description
       
   539    This function is used to mark the start of a storage read/write burst from the
       
   540    processor.  All USB host access into the mass storage / MTP endpoints will be
       
   541    blocked while the read/write burst is ongoing, and will be allowed to resume
       
   542    only after CyAsMTPStorageOnlyStop is called.  The burst mode is used to
       
   543    reduce the firmware overhead due to configuring the internal data paths repeatedly,
       
   544    and can help improve performance when a sequence of read/writes is performed in
       
   545    a burst.
       
   546 
       
   547    This function will not generate a special mailbox request, it will only set a flag
       
   548    on the next Storage Read/Write operation. Until such a call is made West Bridge will
       
   549    continue to accept incoming packets from the Host.
       
   550 
       
   551    * Valid in Asynchronous Callback: YES
       
   552 
       
   553    Returns
       
   554    * CY_AS_ERROR_INVALID_HANDLE - Invalid West Bridge device handle was passed in.
       
   555    * CY_AS_ERROR_NOT_CONFIGURED - West Bridge device has not been configured.
       
   556    * CY_AS_ERROR_NO_FIRMWARE - Firmware is not active on West Bridge device.
       
   557    * CY_AS_ERROR_NOT_RUNNING - Storage stack is not running.
       
   558    * CY_AS_ERROR_SUCCESS - Burst mode has been started.
       
   559 
       
   560    See Also
       
   561    * CyAsStorageReadWriteBurstStop
       
   562  */
       
   563 CyAsReturnStatus_t
       
   564 CyAsMTPStorageOnlyStart (
       
   565         CyAsDeviceHandle handle                         /* Handle to the West Bridge device. */
       
   566         );
       
   567 
       
   568 /* Summary
       
   569    This function is used to mark the end of a storage read/write burst from the
       
   570    P port processor.
       
   571 
       
   572    Description
       
   573    This function is used to mark the end of a storage read/write burst from the
       
   574    processor.  At this point, USB access to the mass storage / MTP endpoints on
       
   575    the West Bridge device will be re-enabled.
       
   576 
       
   577    * Valid in Asynchronous Callback: NO
       
   578 
       
   579    Returns
       
   580    * CY_AS_ERROR_INVALID_HANDLE - Invalid West Bridge device handle was passed in.
       
   581    * CY_AS_ERROR_NOT_CONFIGURED - West Bridge device has not been configured.
       
   582    * CY_AS_ERROR_NO_FIRMWARE - Firmware is not active on West Bridge device.
       
   583    * CY_AS_ERROR_NOT_RUNNING - Storage stack is not running.
       
   584    * CY_AS_ERROR_INVALID_IN_CALLBACK - This API cannot be called from a callback.
       
   585    * CY_AS_ERROR_OUT_OF_MEMORY - Failed to allocate memory to process the request.
       
   586    * CY_AS_ERROR_TIMEOUT - Failed to send request to firmware.
       
   587    * CY_AS_ERROR_SUCCESS - Burst mode has been stopped.
       
   588 
       
   589    See Also
       
   590    * CyAsStorageReadWriteBurstStart
       
   591  */
       
   592 CyAsReturnStatus_t
       
   593 CyAsMTPStorageOnlyStop (
       
   594         CyAsDeviceHandle handle,                         /* Handle to the West Bridge device. */
       
   595 	CyAsFunctionCallback cb,
       
   596 	uint32_t client
       
   597         );
       
   598 
       
   599 #include "cyas_cplus_end.h"
       
   600 
       
   601 #endif
       
   602