1 /* Cypress West Bridge API header file (cyanerr.h)
2 ## Symbols for backward compatibility with previous releases of Antioch SDK.
3 ## ===========================
4 ## Copyright (C) 2010 Cypress Semiconductor
6 ## This program is free software; you can redistribute it and/or
7 ## modify it under the terms of the GNU General Public License
8 ## as published by the Free Software Foundation; either version 2
9 ## of the License, or (at your option) any later version.
11 ## This program is distributed in the hope that it will be useful,
12 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ## GNU General Public License for more details.
16 ## You should have received a copy of the GNU General Public License
17 ## along with this program; if not, write to the Free Software
18 ## Foundation, Inc., 51 Franklin Street
19 ## Fifth Floor, Boston, MA 02110-1301, USA.
20 ## ===========================
23 #ifndef _INCLUDED_CYANERR_H_
24 #define _INCLUDED_CYANERR_H_
31 * Function completed successfully.
33 #define CY_AN_ERROR_SUCCESS (CY_AS_ERROR_SUCCESS)
36 * A function trying to acquire a resource was unable to do so.
38 #define CY_AN_ERROR_NOT_ACQUIRED (CY_AS_ERROR_NOT_ACQUIRED)
41 * A function trying to acquire a resource was unable to do so.
43 #define CY_AN_ERROR_NOT_RELEASED (CY_AS_ERROR_NOT_RELEASED)
46 * The West Bridge firmware is not loaded.
48 #define CY_AN_ERROR_NO_FIRMWARE (CY_AS_ERROR_NO_FIRMWARE)
51 * A timeout occurred waiting on a response from the West Bridge device
53 #define CY_AN_ERROR_TIMEOUT (CY_AS_ERROR_TIMEOUT)
56 * A request to download firmware was made while not in the CONFIG mode
58 #define CY_AN_ERROR_NOT_IN_CONFIG_MODE (CY_AS_ERROR_NOT_IN_CONFIG_MODE)
61 * This error is returned if the firmware size specified is too invalid.
63 #define CY_AN_ERROR_INVALID_SIZE (CY_AS_ERROR_INVALID_SIZE)
66 * This error is returned if a request is made to acquire a resource that has
67 * already been acquired.
69 #define CY_AN_ERROR_RESOURCE_ALREADY_OWNED (CY_AS_ERROR_RESOURCE_ALREADY_OWNED)
72 * This error is returned if a request is made to release a resource that has
73 * not previously been acquired.
75 #define CY_AN_ERROR_RESOURCE_NOT_OWNED (CY_AS_ERROR_RESOURCE_NOT_OWNED)
78 * This error is returned when a request is made for a media that does not
81 #define CY_AN_ERROR_NO_SUCH_MEDIA (CY_AS_ERROR_NO_SUCH_MEDIA)
84 * This error is returned when a request is made for a device that does
87 #define CY_AN_ERROR_NO_SUCH_DEVICE (CY_AS_ERROR_NO_SUCH_DEVICE)
90 * This error is returned when a request is made for a unit that does
93 #define CY_AN_ERROR_NO_SUCH_UNIT (CY_AS_ERROR_NO_SUCH_UNIT)
96 * This error is returned when a request is made for a block that does
99 #define CY_AN_ERROR_INVALID_BLOCK (CY_AS_ERROR_INVALID_BLOCK)
102 * This error is returned when an invalid trace level is set.
104 #define CY_AN_ERROR_INVALID_TRACE_LEVEL (CY_AS_ERROR_INVALID_TRACE_LEVEL)
107 * This error is returned when West Bridge is already in the standby state
108 * and an attempt is made to put West Bridge into this state again.
110 #define CY_AN_ERROR_ALREADY_STANDBY (CY_AS_ERROR_ALREADY_STANDBY)
113 * This error is returned when the API needs to set a pin on the
114 * West Bridge device, but this is not supported by the underlying HAL
117 #define CY_AN_ERROR_SETTING_WAKEUP_PIN (CY_AS_ERROR_SETTING_WAKEUP_PIN)
120 * This error is returned when a module is being started that has
121 * already been started.
123 #define CY_AN_ERROR_ALREADY_RUNNING (CY_AS_ERROR_ALREADY_RUNNING)
126 * This error is returned when a module is being stopped that has
127 * already been stopped.
129 #define CY_AN_ERROR_NOT_RUNNING (CY_AS_ERROR_NOT_RUNNING)
132 * This error is returned when the caller tries to claim a media that has
133 * already been claimed.
135 #define CY_AN_ERROR_MEDIA_ALREADY_CLAIMED (CY_AS_ERROR_MEDIA_ALREADY_CLAIMED)
138 * This error is returned when the caller tries to release a media that
139 * has already been released.
141 #define CY_AN_ERROR_MEDIA_NOT_CLAIMED (CY_AS_ERROR_MEDIA_NOT_CLAIMED)
144 * This error is returned when canceling trying to cancel an asynchronous
145 * operation when an async operation is not pending.
147 #define CY_AN_ERROR_NO_OPERATION_PENDING (CY_AS_ERROR_NO_OPERATION_PENDING)
150 * This error is returned when an invalid endpoint number is provided
153 #define CY_AN_ERROR_INVALID_ENDPOINT (CY_AS_ERROR_INVALID_ENDPOINT)
156 * This error is returned when an invalid descriptor type
157 * is specified in an API call.
159 #define CY_AN_ERROR_INVALID_DESCRIPTOR (CY_AS_ERROR_INVALID_DESCRIPTOR)
162 * This error is returned when an invalid descriptor index
163 * is specified in an API call.
165 #define CY_AN_ERROR_BAD_INDEX (CY_AS_ERROR_BAD_INDEX)
168 * This error is returned if trying to set a USB descriptor
169 * when in the P port enumeration mode.
171 #define CY_AN_ERROR_BAD_ENUMERATION_MODE (CY_AS_ERROR_BAD_ENUMERATION_MODE)
174 * This error is returned when the endpoint configuration specified
177 #define CY_AN_ERROR_INVALID_CONFIGURATION (CY_AS_ERROR_INVALID_CONFIGURATION)
180 * This error is returned when the API cannot verify it is connected
181 * to an West Bridge device.
183 #define CY_AN_ERROR_NO_ANTIOCH (CY_AS_ERROR_NO_ANTIOCH)
186 * This error is returned when an API function is called and
187 * CyAnMiscConfigureDevice has not been called to configure West
188 * Bridge for the current environment.
190 #define CY_AN_ERROR_NOT_CONFIGURED (CY_AS_ERROR_NOT_CONFIGURED)
193 * This error is returned when West Bridge cannot allocate memory required for
194 * internal API operations.
196 #define CY_AN_ERROR_OUT_OF_MEMORY (CY_AS_ERROR_OUT_OF_MEMORY)
199 * This error is returned when a module is being started that has
200 * already been started.
202 #define CY_AN_ERROR_NESTED_SLEEP (CY_AS_ERROR_NESTED_SLEEP)
205 * This error is returned when an operation is attempted on an endpoint that has
208 #define CY_AN_ERROR_ENDPOINT_DISABLED (CY_AS_ERROR_ENDPOINT_DISABLED)
211 * This error is returned when a call is made to an API function when the device
214 #define CY_AN_ERROR_IN_STANDBY (CY_AS_ERROR_IN_STANDBY)
217 * This error is returned when an API call is made with an invalid handle value.
219 #define CY_AN_ERROR_INVALID_HANDLE (CY_AS_ERROR_INVALID_HANDLE)
222 * This error is returned when an invalid response is returned from the West
225 #define CY_AN_ERROR_INVALID_RESPONSE (CY_AS_ERROR_INVALID_RESPONSE)
228 * This error is returned from the callback function for any asynchronous
229 * read or write request that is canceled.
231 #define CY_AN_ERROR_CANCELED (CY_AS_ERROR_CANCELED)
234 * This error is returned when the call to create sleep channel fails
237 #define CY_AN_ERROR_CREATE_SLEEP_CHANNEL_FAILED \
238 (CY_AS_ERROR_CREATE_SLEEP_CHANNEL_FAILED)
241 * This error is returned when the call to CyAnMiscLeaveStandby
242 * is made and the device is not in standby.
244 #define CY_AN_ERROR_NOT_IN_STANDBY (CY_AS_ERROR_NOT_IN_STANDBY)
247 * This error is returned when the call to destroy sleep channel fails
250 #define CY_AN_ERROR_DESTROY_SLEEP_CHANNEL_FAILED \
251 (CY_AS_ERROR_DESTROY_SLEEP_CHANNEL_FAILED)
254 * This error is returned when an invalid resource is specified to a call
255 * to CyAnMiscAcquireResource() or CyAnMiscReleaseResource()
257 #define CY_AN_ERROR_INVALID_RESOURCE (CY_AS_ERROR_INVALID_RESOURCE)
260 * This error occurs when an operation is requested on an endpoint that has
261 * a currently pending async operation.
263 #define CY_AN_ERROR_ASYNC_PENDING (CY_AS_ERROR_ASYNC_PENDING)
266 * This error is returned when a call to CyAnStorageCancelAsync() or
267 * CyAnUsbCancelAsync() is made when no asynchronous request is pending.
269 #define CY_AN_ERROR_ASYNC_NOT_PENDING (CY_AS_ERROR_ASYNC_NOT_PENDING)
272 * This error is returned when a request is made to put the West Bridge device
273 * into standby mode while the USB stack is still active.
275 #define CY_AN_ERROR_USB_RUNNING (CY_AS_ERROR_USB_RUNNING)
278 * A request for in the wrong direction was issued on an endpoint.
280 #define CY_AN_ERROR_USB_BAD_DIRECTION (CY_AS_ERROR_USB_BAD_DIRECTION)
283 * An invalid request was received
285 #define CY_AN_ERROR_INVALID_REQUEST (CY_AS_ERROR_INVALID_REQUEST)
288 * An ACK request was requested while no setup packet was pending.
290 #define CY_AN_ERROR_NO_SETUP_PACKET_PENDING \
291 (CY_AS_ERROR_NO_SETUP_PACKET_PENDING)
294 * A call was made to a API function that cannot be called from a callback.
296 #define CY_AN_ERROR_INVALID_IN_CALLBACK (CY_AS_ERROR_INVALID_IN_CALLBACK)
299 * A call was made to CyAnUsbSetEndPointConfig() before
300 * CyAnUsbSetPhysicalConfiguration() was called.
302 #define CY_AN_ERROR_ENDPOINT_CONFIG_NOT_SET \
303 (CY_AS_ERROR_ENDPOINT_CONFIG_NOT_SET)
306 * The physical endpoint referenced is not valid in the current
307 * physical configuration
309 #define CY_AN_ERROR_INVALID_PHYSICAL_ENDPOINT \
310 (CY_AS_ERROR_INVALID_PHYSICAL_ENDPOINT)
313 * The data supplied to the CyAnMiscDownloadFirmware() call is not aligned on a
314 * WORD (16 bit) boundary.
316 #define CY_AN_ERROR_ALIGNMENT_ERROR (CY_AS_ERROR_ALIGNMENT_ERROR)
319 * A call was made to destroy the West Bridge device, but the USB stack or the
320 * storage stack was will running.
322 #define CY_AN_ERROR_STILL_RUNNING (CY_AS_ERROR_STILL_RUNNING)
325 * A call was made to the API for a function that is not yet supported.
327 #define CY_AN_ERROR_NOT_YET_SUPPORTED (CY_AS_ERROR_NOT_YET_SUPPORTED)
330 * A NULL callback was provided where a non-NULL callback was required
332 #define CY_AN_ERROR_NULL_CALLBACK (CY_AS_ERROR_NULL_CALLBACK)
335 * This error is returned when a request is made to put the West Bridge device
336 * into standby mode while the storage stack is still active.
338 #define CY_AN_ERROR_STORAGE_RUNNING (CY_AS_ERROR_STORAGE_RUNNING)
341 * This error is returned when an operation is attempted that cannot be
342 * completed while the USB stack is connected to a USB host.
344 #define CY_AN_ERROR_USB_CONNECTED (CY_AS_ERROR_USB_CONNECTED)
347 * This error is returned when a USB disconnect is attempted and the
348 * West Bridge device is not connected.
350 #define CY_AN_ERROR_USB_NOT_CONNECTED (CY_AS_ERROR_USB_NOT_CONNECTED)
353 * This error is returned when an P2S storage operation attempted and
354 * data could not be read or written to the storage media.
356 #define CY_AN_ERROR_MEDIA_ACCESS_FAILURE (CY_AS_ERROR_MEDIA_ACCESS_FAILURE)
359 * This error is returned when an P2S storage operation attempted and
360 * the media is write protected.
362 #define CY_AN_ERROR_MEDIA_WRITE_PROTECTED (CY_AS_ERROR_MEDIA_WRITE_PROTECTED)
365 * This error is returned when an attempt is made to cancel a request
366 * that has already been sent to the West Bridge.
368 #define CY_AN_ERROR_OPERATION_IN_TRANSIT (CY_AS_ERROR_OPERATION_IN_TRANSIT)
371 * This error is returned when an invalid parameter is passed to one of
374 #define CY_AN_ERROR_INVALID_PARAMETER (CY_AS_ERROR_INVALID_PARAMETER)
377 * This error is returned if an API is not supported by the current
378 * West Bridge device or the active firmware version.
380 #define CY_AN_ERROR_NOT_SUPPORTED (CY_AS_ERROR_NOT_SUPPORTED)
383 * This error is returned when a call is made to one of the Storage or
384 * USB APIs while the device is in suspend mode.
386 #define CY_AN_ERROR_IN_SUSPEND (CY_AS_ERROR_IN_SUSPEND)
389 * This error is returned when the call to CyAnMiscLeaveSuspend
390 * is made and the device is not in suspend mode.
392 #define CY_AN_ERROR_NOT_IN_SUSPEND (CY_AS_ERROR_NOT_IN_SUSPEND)
395 * This error is returned when a command that is disabled by USB is called.
397 #define CY_AN_ERROR_FEATURE_NOT_ENABLED (CY_AS_ERROR_FEATURE_NOT_ENABLED)
400 * This error is returned when an Async storage read or write is called before a
401 * query device call is issued.
403 #define CY_AN_ERROR_QUERY_DEVICE_NEEDED (CY_AS_ERROR_QUERY_DEVICE_NEEDED)
406 * This error is returned when a call is made to USB or STORAGE Start or
407 * Stop before a prior Start or Stop has finished.
409 #define CY_AN_ERROR_STARTSTOP_PENDING (CY_AS_ERROR_STARTSTOP_PENDING)
412 * This error is returned when a request is made for a bus that does not exist
414 #define CY_AN_ERROR_NO_SUCH_BUS (CY_AS_ERROR_NO_SUCH_BUS)
416 #endif /* __doxygen__ */
418 #endif /* _INCLUDED_CYANERR_H_ */