1 /* Cypress West Bridge API header file (cyasmisc.h)
2 ## ===========================
3 ## Copyright (C) 2010 Cypress Semiconductor
5 ## This program is free software; you can redistribute it and/or
6 ## modify it under the terms of the GNU General Public License
7 ## as published by the Free Software Foundation; either version 2
8 ## of the License, or (at your option) any later version.
10 ## This program is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ## GNU General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with this program; if not, write to the Free Software
17 ## Foundation, Inc., 51 Franklin Street
18 ## Fifth Floor, Boston, MA 02110-1301, USA.
19 ## ===========================
22 #ifndef _INCLUDED_CYASMISC_H_
23 #define _INCLUDED_CYASMISC_H_
26 #include "cyastypes.h"
27 #include "cyasmedia.h"
29 #include "cyas_cplus_start.h"
31 #define CY_AS_LEAVE_STANDBY_DELAY_CLOCK (1)
32 #define CY_AS_RESET_DELAY_CLOCK (1)
34 #define CY_AS_LEAVE_STANDBY_DELAY_CRYSTAL (5)
35 #define CY_AS_RESET_DELAY_CRYSTAL (5)
37 /* The maximum number of buses supported */
38 #define CY_AS_MAX_BUSES (2)
40 /* The maximum number of storage devices supported per bus */
41 #define CY_AS_MAX_STORAGE_DEVICES (1)
43 #define CY_AS_FUNCTCBTYPE_DATA_MASK (0x60000000U)
44 #define CY_AS_FUNCTCBTYPE_TYPE_MASK (0x1FFFFFFFU)
46 #define cy_as_funct_c_b_type_get_type(t) \
47 ((cy_as_funct_c_b_type)((t) & CY_AS_FUNCTCBTYPE_TYPE_MASK))
48 #define cy_as_funct_c_b_type_contains_data(t) \
49 (((cy_as_funct_c_b_type)((t) & \
50 CY_AS_FUNCTCBTYPE_DATA_MASK)) == CY_FUNCT_CB_DATA)
52 /**************************************
54 **************************************/
57 Specifies a handle to an West Bridge device
60 This type represents an opaque handle to an West Bridge device.
61 This handle is created via the CyAsMiscCreateDevice() function
62 and is used in all subsequent calls that communicate to the West
66 * CyAsMiscCreateDevice
67 * CyAsMiscDestroyDevice
69 typedef void *cy_as_device_handle
;
72 This data type gives the mode for the DACK# signal
74 typedef enum cy_as_device_dack_mode
{
75 cy_as_device_dack_ack
, /* Operate in the ACK mode */
76 cy_as_device_dack_eob
/* Operate in the EOB mode */
77 } cy_as_device_dack_mode
;
80 This data structure gives the options for all hardware features.
83 This structure contains the information required to initialize the
84 West Bridge hardware. Any features of the device that can be
85 configured by the caller are specified here.
90 typedef struct cy_as_device_config
{
91 /* If TRUE, the P port is running in SRAM mode. */
93 /* If TRUE, the P port is synchronous, otherwise async */
95 /* If TRUE, DMA req will be delivered via the interrupt signal */
97 /* Mode for the DACK# signal */
98 cy_as_device_dack_mode dackmode
;
99 /* If TRUE, the DRQ line is active high, otherwise active low */
101 /* If TRUE, the DACK line is active high, otherwise active low */
103 /* If TRUE, the clock is connected to a crystal, otherwise it is
104 connected to a clock */
106 } cy_as_device_config
;
110 Specifies a resource that can be owned by either the West Bridge
111 device or by the processor.
114 This enumerated type identifies a resource that can be owned
115 either by the West Bridge device, or by the processor attached to
116 the P port of the West Bridge device.
119 * CyAsMiscAcquireResource
120 * CyAsMiscReleaseResource
122 typedef enum cy_as_resource_type
{
123 cy_as_bus_u_s_b
= 0, /* The USB D+ and D- pins */
124 cy_as_bus_1
= 1, /* The SDIO bus */
125 cy_as_bus_0
= 2 /* The NAND bus (not implemented) */
126 } cy_as_resource_type
;
129 Specifies the reset type for a software reset operation.
132 When the West Bridge device is reset, there are two types of
133 reset that arE possible. This type indicates the type of reset
137 Both of these reset types are software based resets; and are
138 distinct from a chip level HARD reset that is applied through
139 the reset pin on the West Bridge.
141 The CyAsResetSoft type resets only the on-chip micro-controller
142 in the West Bridge. In this case, the previously loaded firmware
143 will continue running. However, the Storage and USB stack
144 operations will need to be restarted, as any state relating to
145 these would have been lost.
147 The CyAsResetHard type resets the entire West Bridge chip, and will
148 need a fresh configuration and firmware download.
151 * <LINK CyAsMiscReset>
154 typedef enum cy_as_reset_type
{
155 /* Just resets the West Bridge micro-controller */
157 /* Resets entire device, firmware must be reloaded and
158 the west bridge device must be re-initialized */
165 This type specifies the polarity of the SD power pin.
168 Sets the SD power pin ( port C, bit 6) to active low or
173 typedef enum cy_as_misc_signal_polarity
{
174 cy_as_misc_active_high
,
175 cy_as_misc_active_low
177 } cy_as_misc_signal_polarity
;
182 This type specifies the type of the data returned by a Function
186 CY_FUNCT_CB_NODATA - This callback does not return any additional
187 information in the data field.
188 CY_FUNCT_CB_DATA - The data field is used, and the CyAsFunctCBType
189 will also contain the type of this data.
194 typedef enum cy_as_funct_c_b_type
{
195 CY_FUNCT_CB_INVALID
= 0x0U
,
196 /* Data from a CyAsMiscGetFirmwareVersion call. */
197 CY_FUNCT_CB_MISC_GETFIRMWAREVERSION
,
198 /* Data from a CyAsMiscHeartBeatControl call. */
199 CY_FUNCT_CB_MISC_HEARTBEATCONTROL
,
200 /* Data from a CyAsMiscAcquireResource call. */
201 CY_FUNCT_CB_MISC_ACQUIRERESOURCE
,
202 /* Data from a CyAsMiscReadMCURegister call. */
203 CY_FUNCT_CB_MISC_READMCUREGISTER
,
204 /* Data from a CyAsMiscWriteMCURegister call. */
205 CY_FUNCT_CB_MISC_WRITEMCUREGISTER
,
206 /* Data from a CyAsMiscSetTraceLevel call. */
207 CY_FUNCT_CB_MISC_SETTRACELEVEL
,
208 /* Data from a CyAsMiscStorageChanged call. */
209 CY_FUNCT_CB_MISC_STORAGECHANGED
,
210 /* Data from a CyAsMiscGetGpioValue call. */
211 CY_FUNCT_CB_MISC_GETGPIOVALUE
,
212 /* Data from a CyAsMiscSetGpioValue call. */
213 CY_FUNCT_CB_MISC_SETGPIOVALUE
,
214 /* Data from a CyAsMiscDownloadFirmware call. */
215 CY_FUNCT_CB_MISC_DOWNLOADFIRMWARE
,
216 /* Data from a CyAsMiscEnterStandby call. */
217 CY_FUNCT_CB_MISC_ENTERSTANDBY
,
218 /* Data from a CyAsMiscEnterSuspend call. */
219 CY_FUNCT_CB_MISC_ENTERSUSPEND
,
220 /* Data from a CyAsMiscLeaveSuspend call. */
221 CY_FUNCT_CB_MISC_LEAVESUSPEND
,
222 /* Data from a CyAsMiscReset call. */
223 CY_FUNCT_CB_MISC_RESET
,
224 /* Data from a CyAsMiscSetLowSpeedSDFreq or
225 * CyAsMiscSetHighSpeedSDFreq call. */
226 CY_FUNCT_CB_MISC_SETSDFREQ
,
227 /* Data from a CyAsMiscSwitchPnandMode call */
228 CY_FUNCT_CB_MISC_RESERVELNABOOTAREA
,
229 /* Data from a CyAsMiscSetSDPowerPolarity call */
230 CY_FUNCT_CB_MISC_SETSDPOLARITY
,
232 /* Data from a CyAsStorageStart call. */
233 CY_FUNCT_CB_STOR_START
,
234 /* Data from a CyAsStorageStop call. */
235 CY_FUNCT_CB_STOR_STOP
,
236 /* Data from a CyAsStorageClaim call. */
237 CY_FUNCT_CB_STOR_CLAIM
,
238 /* Data from a CyAsStorageRelease call. */
239 CY_FUNCT_CB_STOR_RELEASE
,
240 /* Data from a CyAsStorageQueryMedia call. */
241 CY_FUNCT_CB_STOR_QUERYMEDIA
,
242 /* Data from a CyAsStorageQueryBus call. */
243 CY_FUNCT_CB_STOR_QUERYBUS
,
244 /* Data from a CyAsStorageQueryDevice call. */
245 CY_FUNCT_CB_STOR_QUERYDEVICE
,
246 /* Data from a CyAsStorageQueryUnit call. */
247 CY_FUNCT_CB_STOR_QUERYUNIT
,
248 /* Data from a CyAsStorageDeviceControl call. */
249 CY_FUNCT_CB_STOR_DEVICECONTROL
,
250 /* Data from a CyAsStorageSDRegisterRead call. */
251 CY_FUNCT_CB_STOR_SDREGISTERREAD
,
252 /* Data from a CyAsStorageCreatePartition call. */
253 CY_FUNCT_CB_STOR_PARTITION
,
254 /* Data from a CyAsStorageGetTransferAmount call. */
255 CY_FUNCT_CB_STOR_GETTRANSFERAMOUNT
,
256 /* Data from a CyAsStorageErase call. */
257 CY_FUNCT_CB_STOR_ERASE
,
258 /* Data from a CyAsStorageCancelAsync call. */
259 CY_FUNCT_CB_ABORT_P2S_XFER
,
260 /* Data from a CyAsUsbStart call. */
261 CY_FUNCT_CB_USB_START
,
262 /* Data from a CyAsUsbStop call. */
263 CY_FUNCT_CB_USB_STOP
,
264 /* Data from a CyAsUsbConnect call. */
265 CY_FUNCT_CB_USB_CONNECT
,
266 /* Data from a CyAsUsbDisconnect call. */
267 CY_FUNCT_CB_USB_DISCONNECT
,
268 /* Data from a CyAsUsbSetEnumConfig call. */
269 CY_FUNCT_CB_USB_SETENUMCONFIG
,
270 /* Data from a CyAsUsbGetEnumConfig call. */
271 CY_FUNCT_CB_USB_GETENUMCONFIG
,
272 /* Data from a CyAsUsbSetDescriptor call. */
273 CY_FUNCT_CB_USB_SETDESCRIPTOR
,
274 /* Data from a CyAsUsbGetDescriptor call. */
275 CY_FUNCT_CB_USB_GETDESCRIPTOR
,
276 /* Data from a CyAsUsbCommitConfig call. */
277 CY_FUNCT_CB_USB_COMMITCONFIG
,
278 /* Data from a CyAsUsbGetNak call. */
279 CY_FUNCT_CB_USB_GETNAK
,
280 /* Data from a CyAsUsbGetStall call. */
281 CY_FUNCT_CB_USB_GETSTALL
,
282 /* Data from a CyAsUsbSignalRemoteWakeup call. */
283 CY_FUNCT_CB_USB_SIGNALREMOTEWAKEUP
,
284 /* Data from a CyAnUsbClearDescriptors call. */
285 CY_FUNCT_CB_USB_CLEARDESCRIPTORS
,
286 /* Data from a CyAnUsbSetMSReportThreshold call. */
287 CY_FUNCT_CB_USB_SET_MSREPORT_THRESHOLD
,
288 /* Data from a CyAsMTPStart call. */
289 CY_FUNCT_CB_MTP_START
,
290 /* Data from a CyAsMTPStop call. */
291 CY_FUNCT_CB_MTP_STOP
,
292 /* Data from a CyAsMTPInitSendObject call. */
293 CY_FUNCT_CB_MTP_INIT_SEND_OBJECT
,
294 /* Data from a CyAsMTPCancelSendObject call. */
295 CY_FUNCT_CB_MTP_CANCEL_SEND_OBJECT
,
296 /* Data from a CyAsMTPInitGetObject call. */
297 CY_FUNCT_CB_MTP_INIT_GET_OBJECT
,
298 /* Data from a CyAsMTPCancelGetObject call. */
299 CY_FUNCT_CB_MTP_CANCEL_GET_OBJECT
,
300 /* Data from a CyAsMTPSendBlockTable call. */
301 CY_FUNCT_CB_MTP_SEND_BLOCK_TABLE
,
302 /* Data from a CyAsMTPStopStorageOnly call. */
303 CY_FUNCT_CB_MTP_STOP_STORAGE_ONLY
,
304 CY_FUNCT_CB_NODATA
= 0x40000000U
,
305 CY_FUNCT_CB_DATA
= 0x20000000U
306 } cy_as_funct_c_b_type
;
309 This type specifies the general West Bridge function callback.
312 This callback is supplied as an argument to all asynchronous
313 functions in the API. It iS called after the asynchronous function
319 typedef void (*cy_as_function_callback
)(
320 cy_as_device_handle handle
,
321 cy_as_return_status_t status
,
323 cy_as_funct_c_b_type type
,
327 This type specifies the general West Bridge event that has
331 This type is used in the West Bridge misc callback function to
332 indicate the type of callback.
336 typedef enum cy_as_misc_event_type
{
337 /* This event is sent when West Bridge has finished
338 initialization and is ready to respond to API calls. */
339 cy_as_event_misc_initialized
= 0,
341 /* This event is sent when West Bridge has left the
342 standby state and is ready to respond to commands again. */
343 cy_as_event_misc_awake
,
345 /* This event is sent periodically from the firmware
347 cy_as_event_misc_heart_beat
,
349 /* This event is sent when the West Bridge has left the
350 suspend mode and is ready to respond to commands
352 cy_as_event_misc_wakeup
,
354 /* This event is sent when the firmware image downloaded
355 cannot run on the active west bridge device. */
356 cy_as_event_misc_device_mismatch
357 } cy_as_misc_event_type
;
360 This type is the type of a callback function that is called when a
361 West Bridge misc event occurs.
364 At times West Bridge needs to inform the P port processor of events
365 that have occurred. These events are asynchronous to the thread of
366 control on the P port processor and as such are generally delivered
367 via a callback function that is called as part of an interrupt
368 handler. This type defines the type of function that must be provided
369 as a callback function for West Bridge misc events.
374 typedef void (*cy_as_misc_event_callback
)(
375 /* Handle to the device to configure */
376 cy_as_device_handle handle
,
377 /* The event type being reported */
378 cy_as_misc_event_type ev
,
379 /* The data assocaited with the event being reported */
385 This enum provides info of various firmware trace levels.
390 * CyAsMiscSetTraceLevel
393 CYAS_FW_TRACE_LOG_NONE
= 0, /* Log nothing. */
394 CYAS_FW_TRACE_LOG_STATE
, /* Log state information. */
395 CYAS_FW_TRACE_LOG_CALLS
, /* Log function calls. */
396 CYAS_FW_TRACE_LOG_STACK_TRACE
, /* Log function calls with args. */
397 CYAS_FW_TRACE_MAX_LEVEL
/* Max trace level sentinel. */
402 This enum lists the controllable GPIOs of the West Bridge device.
405 The West Bridge device has GPIOs that can be used for user defined functions.
406 This enumeration lists the GPIOs that are available on the device.
409 All of the GPIOs except UVALID can only be accessed when using West Bridge
410 firmware images that support only SD/MMC/MMC+ storage devices. This
411 functionality is not supported in firmware images that support NAND
415 * CyAsMiscGetGpioValue
416 * CyAsMiscSetGpioValue
419 cy_as_misc_gpio_0
= 0, /* GPIO[0] pin */
420 cy_as_misc_gpio_1
, /* GPIO[1] pin */
421 cy_as_misc_gpio__nand_CE
, /* NAND_CE pin, output only */
422 cy_as_misc_gpio__nand_CE2
, /* NAND_CE2 pin, output only */
423 cy_as_misc_gpio__nand_WP
, /* NAND_WP pin, output only */
424 cy_as_misc_gpio__nand_CLE
, /* NAND_CLE pin, output only */
425 cy_as_misc_gpio__nand_ALE
, /* NAND_ALE pin, output only */
426 /* SD_POW pin, output only, do not drive low while storage is active */
427 cy_as_misc_gpio_SD_POW
,
428 cy_as_misc_gpio_U_valid
/* UVALID pin */
432 This enum lists the set of clock frequencies that are supported for
433 working with low speed SD media.
436 West Bridge firmware uses a clock frequency less than the maximum
437 possible rate for low speed SD media. This can be changed to a
438 setting equal to the maximum frequency as desired by the user. This
439 enumeration lists the different frequency settings that are
443 * CyAsMiscSetLowSpeedSDFreq
445 typedef enum cy_as_low_speed_sd_freq
{
446 /* Approx. 21.82 MHz, default value */
447 CY_AS_SD_DEFAULT_FREQ
= 0,
450 } cy_as_low_speed_sd_freq
;
453 This enum lists the set of clock frequencies that are supported
454 for working with high speed SD media.
457 West Bridge firmware uses a 48 MHz clock by default to interface
458 with high speed SD/MMC media. This can be changed to 24 MHz if
459 so desired by the user. This enum lists the different frequencies
463 * CyAsMiscSetHighSpeedSDFreq
465 typedef enum cy_as_high_speed_sd_freq
{
466 CY_AS_HS_SD_FREQ_48
, /* 48 MHz, default value */
467 CY_AS_HS_SD_FREQ_24
/* 24 MHz */
468 } cy_as_high_speed_sd_freq
;
471 Struct encapsulating all information returned by the
472 CyAsMiscGetFirmwareVersion call.
475 This struct encapsulates all return values from the asynchronous
476 CyAsMiscGetFirmwareVersion call, so that a single data argument
477 can be passed to the user provided callback function.
480 * CyAsMiscGetFirmwareVersion
482 typedef struct cy_as_get_firmware_version_data
{
483 /* Return value for major version number for the firmware */
485 /* Return value for minor version number for the firmware */
487 /* Return value for build version number for the firmware */
489 /* Return value for media types supported in the current firmware */
491 /* Return value to indicate the release or debug mode of firmware */
492 cy_bool is_debug_mode
;
493 } cy_as_get_firmware_version_data
;
496 /*****************************
497 * West Bridge Functions
498 *****************************/
501 This function creates a new West Bridge device and returns a
502 handle to the device.
505 This function initializes the API object that represents the West
506 Bridge device and returns a handle to this device. This handle is
507 required for all West Bridge related functions to identify the
508 specific West Bridge device.
510 * Valid In Asynchronous Callback: NO
513 * CY_AS_ERROR_SUCCESS
514 * CY_AS_ERROR_OUT_OF_MEMORY
516 EXTERN cy_as_return_status_t
517 cy_as_misc_create_device(
518 /* Return value for handle to created device */
519 cy_as_device_handle
*handle_p
,
520 /* The HAL specific tag for this device */
521 cy_as_hal_device_tag tag
525 This functions destroys a previously created West Bridge device.
528 When an West Bridge device is created, an opaque handle is returned
529 that represents the device. This function destroys that handle and
530 frees all resources associated with the handle.
532 * Valid In Asynchronous Callback: NO
535 * CY_AS_ERROR_SUCCESS
536 * CY_AS_ERROR_INVALID_HANDLE
537 * CY_AS_ERROR_STILL_RUNNING - The USB or STORAGE stacks are still
538 * running, they must be stopped before the device can be destroyed
539 * CY_AS_ERROR_DESTROY_SLEEP_CHANNEL_FAILED - the HAL layer failed to
540 * destroy a sleep channel
542 EXTERN cy_as_return_status_t
543 cy_as_misc_destroy_device(
544 /* Handle to the device to destroy */
545 cy_as_device_handle handle
549 This function initializes the hardware for basic communication with
553 This function initializes the hardware to establish basic
554 communication with the West Bridge device. This is always the first
555 function called to initialize communication with the West Bridge
558 * Valid In Asynchronous Callback: NO
561 * CY_AS_ERROR_SUCCESS - the basic initialization was completed
562 * CY_AS_ERROR_INVALID_HANDLE
563 * CY_AS_ERROR_IN_STANDBY
564 * CY_AS_ERROR_ALREADY_RUNNING
565 * CY_AS_ERROR_OUT_OF_MEMORY
566 * CY_AS_ERROR_NO_ANTIOCH - cannot find the West Bridge device
567 * CY_AS_ERROR_CREATE_SLEEP_CHANNEL_FAILED -
568 * the HAL layer falied to create a sleep channel
573 EXTERN cy_as_return_status_t
574 cy_as_misc_configure_device(
575 /* Handle to the device to configure */
576 cy_as_device_handle handle
,
577 /* Configuration information */
578 cy_as_device_config
*config_p
582 This function returns non-zero if West Bridge is in standby and
586 West Bridge supports a standby mode. This function is used to
587 query West Bridge to determine if West Bridge is in a standby
590 * Valid In Asynchronous Callback: YES
593 * CY_AS_ERROR_SUCCESS
594 * CY_AS_ERROR_INVALID_HANDLE
596 EXTERN cy_as_return_status_t
597 cy_as_misc_in_standby(
598 /* Handle to the device to configure */
599 cy_as_device_handle handle
,
600 /* Return value for standby state */
605 This function downloads the firmware to West Bridge device.
608 This function downloads firmware from a given location and with a
609 given size to the West Bridge device. After the firmware is
610 downloaded the West Bridge device is moved out of configuration
611 mode causing the firmware to be executed. It is an error to call
612 this function when the device is not in configuration mode. The
613 device is in configuration mode on power up and may be placed in
614 configuration mode after power up with a hard reset.
617 The firmware must be on a word align boundary.
619 * Valid In Asynchronous Callback: YES (if cb supplied)
623 * CY_AS_ERROR_SUCCESS - the firmware was successfully downloaded
624 * CY_AS_ERROR_INVALID_HANDLE
625 * CY_AS_ERROR_NOT_CONFIGURED - the West Bridge device
627 * CY_AS_ERROR_NOT_IN_CONFIG_MODE
628 * CY_AS_ERROR_INVALID_SIZE - the size of the firmware
629 * exceeded 32768 bytes
630 * CY_AS_ERROR_ALIGNMENT_ERROR
631 * CY_AS_ERROR_IN_STANDBY - trying to download
632 * while in standby mode
633 * CY_AS_ERROR_TIMEOUT
638 EXTERN cy_as_return_status_t
639 cy_as_misc_download_firmware(
640 /* Handle to the device to configure */
641 cy_as_device_handle handle
,
642 /* Pointer to the firmware to be downloaded */
644 /* The size of the firmware in bytes */
646 /* Callback to call when the operation is complete. */
647 cy_as_function_callback cb
,
648 /* Client data to be passed to the callback. */
654 This function returns the version number of the firmware running in
655 the West Bridge device.
658 This function queries the West Bridge device and retreives the
659 firmware version number. If the firmware is not loaded an error is
660 returned indicated no firmware has been loaded.
662 * Valid In Asynchronous Callback: YES (if cb supplied)
666 * CY_AS_ERROR_SUCCESS - the firmware version number was retreived
667 * CY_AS_ERROR_INVALID_HANDLE
668 * CY_AS_ERROR_NOT_CONFIGURED
669 * CY_AS_ERROR_NO_FIRMWARE - the firmware has not been downloaded
671 * CY_AS_ERROR_IN_STANDBY
672 * CY_AS_ERROR_OUT_OF_MEMORY
673 * CY_AS_ERROR_TIMEOUT - there was a timeout waiting for a response
674 * from the West Bridge firmware
676 EXTERN cy_as_return_status_t
677 cy_as_misc_get_firmware_version(
678 /* Handle to the device to configure */
679 cy_as_device_handle handle
,
680 /* Return values indicating the firmware version. */
681 cy_as_get_firmware_version_data
*data
,
682 /* Callback to call when the operation is complete. */
683 cy_as_function_callback cb
,
684 /* Client data to be passed to the callback. */
688 #if !defined(__doxygen__)
691 This function reads and returns the contents of an MCU accessible
692 register on the West Bridge.
695 This function requests the firmware to read and return the contents
696 of an MCU accessible register through the mailboxes.
698 * Valid In Asynchronous Callback: YES (if cb supplied)
702 * CY_AS_ERROR_SUCCESS - the register content was retrieved.
703 * CY_AS_ERROR_INVALID_HANDLE
704 * CY_AS_ERROR_NOT_CONFIGURED
705 * CY_AS_ERROR_NO_FIRMWARE
706 * CY_AS_ERROR_OUT_OF_MEMORY
707 * CY_AS_ERROR_TIMEOUT - there was a timeout waiting for a response
708 * from the West Bridge firmware
709 * CY_AS_ERROR_INVALID_RESPONSE - the firmware build does not
710 * support this command.
712 EXTERN cy_as_return_status_t
713 cy_as_misc_read_m_c_u_register(
714 /* Handle to the device to configure */
715 cy_as_device_handle handle
,
716 /* Address of the register to read */
718 /* Return value for the MCU register content */
720 /* Callback to call when the operation is complete. */
721 cy_as_function_callback cb
,
722 /* Client data to be passed to the callback. */
727 This function writes to an MCU accessible register on the West Bridge.
730 This function requests the firmware to write a specified value to an
731 MCU accessible register through the mailboxes.
733 * Valid In Asynchronous Callback: YES (if cb supplied)
737 This function is only for internal use by the West Bridge API layer.
738 Calling this function directly can cause device malfunction.
741 * CY_AS_ERROR_SUCCESS - the register content was updated.
742 * CY_AS_ERROR_INVALID_HANDLE
743 * CY_AS_ERROR_NOT_CONFIGURED
744 * CY_AS_ERROR_NO_FIRMWARE
745 * CY_AS_ERROR_OUT_OF_MEMORY
746 * CY_AS_ERROR_TIMEOUT - there was a timeout waiting for a response
747 * from the West Bridge firmware
748 * CY_AS_ERROR_INVALID_RESPONSE - the firmware build does not support
751 EXTERN cy_as_return_status_t
752 cy_as_misc_write_m_c_u_register(
753 /* Handle to the device to configure */
754 cy_as_device_handle handle
,
755 /* Address of the register to write */
757 /* Mask to be applied on the register contents. */
759 /* Data to be ORed with the register contents. */
761 /* Callback to call when the operation is complete. */
762 cy_as_function_callback cb
,
763 /* Client data to be passed to the callback. */
770 This function will reset the West Bridge device and software API.
773 This function will reset the West Bridge device and software API.
774 The reset operation can be a hard reset or a soft reset. A hard
775 reset will reset all aspects of the West Bridge device. The device
776 will enter the configuration state and the firmware will have to be
777 reloaded. The device will also have to be re-initialized. A soft
778 reset just resets the West Bridge micro-controller.
780 * Valid In Asynchronous Callback: NO
783 When a hard reset is issued, the firmware that may have been
784 previously loaded will be lost and any configuration information set
785 via CyAsMiscConfigureDevice() will be lost. This will be reflected
786 in the API maintained state of the device. In order to re-establish
787 communications with the West Bridge device, CyAsMiscConfigureDevice()
788 and CyAsMiscDownloadFirmware() must be called again.
790 * Valid In Asynchronous Callback: YES (if cb supplied)
794 * CY_AS_ERROR_SUCCESS - the device has been reset
795 * CY_AS_ERROR_INVALID_HANDLE
796 * CY_AS_ERROR_NOT_CONFIGURED
797 * CY_AS_ERROR_NO_FIRMWARE
798 * CY_AS_ERROR_NOT_YET_SUPPORTED - current soft reset is not supported
799 * CY_AS_ERROR_ASYNC_PENDING - Reset is unable to flush pending async
800 * reads/writes in polling mode.
806 EXTERN cy_as_return_status_t
808 /* Handle to the device to configure */
809 cy_as_device_handle handle
,
810 /* The type of reset to perform */
811 cy_as_reset_type type
,
812 /* If true, flush all pending writes to mass storage
813 before performing the reset. */
815 /* Callback to call when the operation is complete. */
816 cy_as_function_callback cb
,
817 /* Client data to be passed to the callback. */
822 This function acquires a given resource.
825 There are resources in the system that are shared between the
826 West Bridge device and the processor attached to the P port of
827 the West Bridge device. This API provides a mechanism for the
828 P port processor to acquire ownership of a resource.
831 The ownership of the resources controlled by CyAsMiscAcquireResource()
832 and CyAsMiscReleaseResource() defaults to a known state at hardware
833 reset. After the firmware is loaded and begins execution the state of
834 these resources may change. At any point if the P Port processor needs
835 to acquire a resource it should do so explicitly to be sure of
839 * CY_AS_ERROR_SUCCESS - the p port successfully acquired the
840 * resource of interest
841 * CY_AS_ERROR_INVALID_HANDLE
842 * CY_AS_ERROR_NOT_CONFIGURED
843 * CY_AS_ERROR_NO_FIRMWARE
844 * CY_AS_ERROR_INVALID_RESOURCE
845 * CY_AS_ERROR_RESOURCE_ALREADY_OWNED - the p port already
847 * CY_AS_ERROR_NOT_ACQUIRED - the resource cannot be acquired
848 * CY_AS_ERROR_OUT_OF_MEMORY
849 * CY_AS_ERROR_TIMEOUT - there was a timeout waiting for a
850 * response from the West Bridge firmware
855 EXTERN cy_as_return_status_t
856 cy_as_misc_acquire_resource(
857 /* Handle to the device to configure */
858 cy_as_device_handle handle
,
859 /* The resource to acquire */
860 cy_as_resource_type
*resource
,
861 /* If true, force West Bridge to release the resource */
863 /* Callback to call when the operation is complete. */
864 cy_as_function_callback cb
,
865 /* Client data to be passed to the callback. */
870 This function releases a given resource.
873 There are resources in the system that are shared between the
874 West Bridge device and the processor attached to the P port of
875 the West Bridge device. This API provides a mechanism for the
876 P port processor to release a resource that has previously been
877 acquired via the CyAsMiscAcquireResource() call.
879 * Valid In Asynchronous Callback: NO
882 * CY_AS_ERROR_SUCCESS - the p port successfully released
883 * the resource of interest
884 * CY_AS_ERROR_INVALID_HANDLE
885 * CY_AS_ERROR_NOT_CONFIGURED
886 * CY_AS_ERROR_NO_FIRMWARE
887 * CY_AS_ERROR_INVALID_RESOURCE
888 * CY_AS_ERROR_RESOURCE_NOT_OWNED - the p port does not own the
889 * resource of interest
893 * CyAsMiscAcquireResource
895 EXTERN cy_as_return_status_t
896 cy_as_misc_release_resource(
897 /* Handle to the device to configure */
898 cy_as_device_handle handle
,
899 /* The resource to release */
900 cy_as_resource_type resource
905 This function sets the trace level for the West Bridge firmware.
908 The West Bridge firmware has the ability to store information
909 about the state and execution path of the firmware on a mass storage
910 device attached to the West Bridge device. This function configures
911 the specific mass storage device to be used and the type of information
912 to be stored. This state information is used for debugging purposes
913 and must be interpreted by a Cypress provided tool.
916 The trace level indicates the amount of information to output.
917 * 0 = no trace information is output
918 * 1 = state information is output
919 * 2 = function call information is output
920 * 3 = function call, arguments, and return value information is output
922 * Valid In Asynchronous Callback: NO
925 The media device and unit specified in this call will be overwritten
926 and any data currently stored on this device and unit will be lost.
928 * NOT IMPLEMENTED YET
931 * CY_AS_ERROR_SUCCESS - the trace configuration has been
932 * successfully changed
933 * CY_AS_ERROR_NO_SUCH_BUS - the bus specified does not exist
934 * CY_AS_ERROR_NO_SUCH_DEVICE - the specified media/device
935 * pair does not exist
936 * CY_AS_ERROR_NO_SUCH_UNIT - the unit specified does not exist
937 * CY_AS_ERROR_INVALID_TRACE_LEVEL - the trace level requested
939 * CY_AS_ERROR_TIMEOUT - there was a timeout waiting for a
940 * response from the West Bridge firmware
942 EXTERN cy_as_return_status_t
943 cy_as_misc_set_trace_level(
944 /* Handle to the device to configure */
945 cy_as_device_handle handle
,
946 /* The trace level */
948 /* The bus for the output */
949 cy_as_bus_number_t bus
,
950 /* The device for the output */
952 /* The unit for the output */
954 /* Callback to call when the operation is complete. */
955 cy_as_function_callback cb
,
956 /* Client data to be passed to the callback. */
962 This function places West Bridge into the low power standby mode.
965 This function places West Bridge into a low power (sleep) mode, and
966 cannot be called while the USB stack is active. This function first
967 instructs the West Bridge firmware that the device is about to be
968 placed into sleep mode. This allows West Bridge to complete any pending
969 storage operations. After the West Bridge device has responded that
970 pending operations are complete, the device is placed in standby mode.
972 There are two methods of placing the device in standby mode. If the
973 WAKEUP pin of the West Bridge is connected to a GPIO on the processor,
974 the pin is de-asserted (via the HAL layer) and West Bridge enters into
975 a sleep mode. If the WAKEUP pin is not accessible, the processor can
976 write into the power management control/status register on the West
977 Bridge to put the device into sleep mode.
979 * Valid In Asynchronous Callback: YES (if cb supplied)
983 * CY_AS_ERROR_SUCCESS - the function completed and West Bridge
985 * CY_AS_ERROR_INVALID_HANDLE
986 * CY_AS_ERROR_ALREADY_STANDBY - the West Bridge device is already
988 * CY_AS_ERROR_TIMEOUT - there was a timeout waiting for a response
989 * from the West Bridge firmware
990 * CY_AS_ERROR_NOT_SUPPORTED - the HAL layer does not support changing
992 * CY_AS_ERROR_USB_RUNNING - The USB stack is still running when the
993 * EnterStandby call is made
994 * CY_AS_ERROR_ASYNC_PENDING
995 * CY_AS_ERROR_OUT_OF_MEMORY
996 * CY_AS_ERROR_INVALID_RESPONSE
997 * CY_AS_ERROR_SETTING_WAKEUP_PIN
998 * CY_AS_ERROR_ASYNC_PENDING - In polling mode EnterStandby can not
999 * be called until all pending storage read/write requests have
1003 * CyAsMiscLeaveStandby
1005 EXTERN cy_as_return_status_t
1006 cy_as_misc_enter_standby_e_x_u(
1007 /* Handle to the device to configure */
1008 cy_as_device_handle handle
,
1009 /* If true, use the wakeup pin, otherwise use the register */
1011 /* Set true to enable specific usages of the
1012 UVALID signal, please refer to AN xx or ERRATA xx */
1013 cy_bool uvalid_special
,
1014 /* Callback to call when the operation is complete. */
1015 cy_as_function_callback cb
,
1016 /* Client data to be passed to the callback. */
1021 This function is provided for backwards compatibility.
1024 Calling this function is the same as calling CyAsMiscEnterStandbyEx
1025 with True for the lowpower parameter.
1028 * CyAsMiscEnterStandbyEx
1030 EXTERN cy_as_return_status_t
1031 cy_as_misc_enter_standby(cy_as_device_handle handle
,
1033 cy_as_function_callback cb
,
1038 This function brings West Bridge out of sleep mode.
1041 This function asserts the WAKEUP pin (via the HAL layer). This
1042 brings the West Bridge out of the sleep state and allows the
1043 West Bridge firmware to process the event causing the wakeup.
1044 When all processing associated with the wakeup is complete, a
1045 callback function is called to tell the P port software that
1046 the firmware processing associated with wakeup is complete.
1048 * Valid In Asynchronous Callback: NO
1051 * CY_AS_ERROR_SUCCESS - the function completed and West Bridge
1053 * CY_AS_ERROR_INVALID_HANDLE
1054 * CY_AS_ERROR_SETTING_WAKEUP_PIN
1055 * CY_AS_ERROR_NOT_IN_STANDBY - the West Bridge device is not in
1057 * CY_AS_ERROR_TIMEOUT - there was a timeout waiting for a
1058 * response from the West Bridge firmware
1059 * CY_AS_ERROR_NOT_SUPPORTED - the HAL layer does not support
1060 * changing the WAKEUP pin
1063 * CyAsMiscEnterStandby
1065 EXTERN cy_as_return_status_t
1066 cy_as_misc_leave_standby(
1067 /* Handle to the device to configure */
1068 cy_as_device_handle handle
,
1069 /* The resource causing the wakeup */
1070 cy_as_resource_type resource
1074 This function registers a callback function to be called when an
1075 asynchronous West Bridge MISC event occurs.
1078 When asynchronous misc events occur, a callback function can be
1079 called to alert the calling program. This functions allows the
1080 calling program to register a callback.
1082 * Valid In Asynchronous Callback: NO
1085 * CY_AS_ERROR_SUCCESS
1086 * CY_AS_ERROR_INVALID_HANDLE
1088 EXTERN cy_as_return_status_t
1089 cy_as_misc_register_callback(
1090 /* Handle to the West Bridge device */
1091 cy_as_device_handle handle
,
1092 /* The function to call */
1093 cy_as_misc_event_callback callback
1097 This function sets the logging level for log messages.
1100 The API can print messages via the CyAsHalPrintMessage capability.
1101 This function sets the level of detail seen when printing messages
1104 * Valid In Asynchronous Callback:NO
1107 cy_as_misc_set_log_level(
1108 /* Level to set, 0 is fewer messages, 255 is all */
1114 This function tells West Bridge that SD or MMC media has been
1115 inserted or removed.
1118 In some hardware configurations, SD or MMC media detection is
1119 handled outside of the West Bridge device. This function is called
1120 when a change is detected to inform the West Bridge firmware to check
1121 for storage media changes.
1123 * Valid In Asynchronous Callback: NO
1126 * CY_AS_ERROR_SUCCESS
1127 * CY_AS_ERROR_INVALID_HANDLE
1128 * CY_AS_ERROR_NOT_CONFIGURED
1129 * CY_AS_ERROR_NO_FIRMWARE
1130 * CY_AS_ERROR_IN_STANDBY
1131 * CY_AS_ERROR_OUT_OF_MEMORY
1132 * CY_AS_ERROR_INVALID_RESPONSE
1135 * CyAsMiscStorageChanged
1138 EXTERN cy_as_return_status_t
1139 cy_as_misc_storage_changed(
1140 /* Handle to the West Bridge device */
1141 cy_as_device_handle handle
,
1142 /* Callback to call when the operation is complete. */
1143 cy_as_function_callback cb
,
1144 /* Client data to be passed to the callback. */
1149 This function instructs the West Bridge firmware to start/stop
1150 sending periodic heartbeat messages to the processor.
1153 The West Bridge firmware can send heartbeat messages through the
1154 mailbox register once every 500 ms. This message can be an overhead
1155 as it causes regular Mailbox interrupts to happen, and is turned
1156 off by default. The message can be used to test and verify that the
1157 West Bridge firmware is alive. This API can be used to enable or
1158 disable the heartbeat message.
1160 * Valid In Asynchronous Callback: NO
1163 * CY_AS_ERROR_SUCCESS - the function completed successfully
1164 * CY_AS_ERROR_INVALID_HANDLE
1165 * CY_AS_ERROR_NOT_CONFIGURED
1166 * CY_AS_ERROR_NO_FIRMWARE
1167 * CY_AS_ERROR_OUT_OF_MEMORY
1168 * CY_AS_ERROR_NOT_CONFIGURED - the West Bridge device has not
1169 * been configured yet
1170 * CY_AS_ERROR_NO_FIRMWARE - firmware has not been downloaded to
1171 * the West Bridge device
1174 EXTERN cy_as_return_status_t
1175 cy_as_misc_heart_beat_control(
1176 /* Handle to the West Bridge device */
1177 cy_as_device_handle handle
,
1178 /* Message enable/disable selection */
1180 /* Callback to call when the operation is complete. */
1181 cy_as_function_callback cb
,
1182 /* Client data to be passed to the callback. */
1187 This function gets the current state of a GPIO pin on the
1191 The West Bridge device has GPIO pins that can be used for user
1192 defined functions. This function gets the current state of the
1193 specified GPIO pin. Calling this function will configure the
1194 corresponding pin as an input.
1196 * Valid In Asynchronous Callback: NO
1199 Only GPIO[0], GPIO[1] and UVALID pins can be used as GP inputs.
1200 Of these pins, only the UVALID pin is supported by firmware images
1201 that include NAND storage support.
1204 * CY_AS_ERROR_SUCCESS - the function completed successfully
1205 * CY_AS_ERROR_INVALID_HANDLE
1206 * CY_AS_ERROR_NOT_CONFIGURED - the West Bridge device has not
1207 * been configured yet
1208 * CY_AS_ERROR_NO_FIRMWARE - firmware has not been downloaded
1209 * to the West Bridge device
1210 * CY_AS_ERROR_BAD_INDEX - an invalid GPIO was specified
1211 * CY_AS_ERROR_NOT_SUPPORTED - this feature is not supported
1216 * CyAsMiscSetGpioValue
1218 EXTERN cy_as_return_status_t
1219 cy_as_misc_get_gpio_value(
1220 /* Handle to the West Bridge device */
1221 cy_as_device_handle handle
,
1222 /* Id of the GPIO pin to query */
1223 cy_as_misc_gpio pin
,
1224 /* Current value of the GPIO pin */
1226 /* Callback to call when the operation is complete. */
1227 cy_as_function_callback cb
,
1228 /* Client data to be passed to the callback. */
1233 This function updates the state of a GPIO pin on the West
1237 The West Bridge device has GPIO pins that can be used for
1238 user defined functions. This function updates the output
1239 value driven on a specified GPIO pin. Calling this function
1240 will configure the corresponding pin as an output.
1242 * Valid In Asynchronous Callback: NO
1245 All of the pins listed under CyAsMiscGpio can be used as GP
1246 outputs. This feature is note supported by firmware images
1247 that include NAND storage device support.
1250 * CY_AS_ERROR_SUCCESS - the function completed successfully
1251 * CY_AS_ERROR_INVALID_HANDLE
1252 * CY_AS_ERROR_NOT_CONFIGURED - the West Bridge device has not
1253 * been configured yet
1254 * CY_AS_ERROR_NO_FIRMWARE - firmware has not been downloaded
1255 * to the West Bridge device
1256 * CY_AS_ERROR_BAD_INDEX - an invalid GPIO was specified
1257 * CY_AS_ERROR_NOT_SUPPORTED - this feature is not supported
1262 * CyAsMiscGetGpioValue
1264 EXTERN cy_as_return_status_t
1265 cy_as_misc_set_gpio_value(
1266 /* Handle to the West Bridge device */
1267 cy_as_device_handle handle
,
1268 /* Id of the GPIO pin to set */
1269 cy_as_misc_gpio pin
,
1270 /* Value to be set on the GPIO pin */
1272 /* Callback to call when the operation is complete. */
1273 cy_as_function_callback cb
,
1274 /* Client data to be passed to the callback. */
1279 Set the West Bridge device in the low power suspend mode.
1282 The West Bridge device has a low power suspend mode where the USB
1283 core and the internal microcontroller are powered down. This
1284 function sets the West Bridge device into this low power mode.
1285 This mode can only be entered when there is no active USB
1286 connection; i.e., when USB has not been connected or is suspended;
1287 and there are no pending USB or storage asynchronous calls. The
1288 device will exit the suspend mode and resume handling USB and
1289 processor requests when any activity is detected on the CE#, D+/D-
1292 * Valid In Asynchronous Callback: NO
1295 The GPIO[0] pin needs to be configured as an input for the gpio
1296 wakeup to work. This flag should not be enabled if the pin is
1297 being used as a GP output.
1300 * CY_AS_ERROR_SUCCESS - the device was placed in suspend mode.
1301 * CY_AS_ERROR_INVALID_HANDLE - the West Bridge handle passed
1303 * CY_AS_ERROR_NOT_CONFIGURED - the West Bridge device has not
1304 * yet been configured.
1305 * CY_AS_ERROR_NO_FIRMWARE - no firmware has been downloaded
1307 * CY_AS_ERROR_IN_STANDBY - the device is already in sleep mode.
1308 * CY_AS_ERROR_USB_CONNECTED - the USB connection is active.
1309 * CY_AS_ERROR_ASYNC_PENDING - asynchronous storage/USB calls
1311 * CY_AS_ERROR_OUT_OF_MEMORY - failed to allocate memory for
1313 * CY_AS_ERROR_INVALID_RESPONSE - command not recognised by
1317 * CyAsMiscLeaveSuspend
1319 EXTERN cy_as_return_status_t
1320 cy_as_misc_enter_suspend(
1321 /* Handle to the West Bridge device */
1322 cy_as_device_handle handle
,
1323 /* Control the USB wakeup source */
1324 cy_bool usb_wakeup_en
,
1325 /* Control the GPIO[0] wakeup source */
1326 cy_bool gpio_wakeup_en
,
1327 /* Callback to call when suspend mode entry is complete */
1328 cy_as_function_callback cb
,
1329 /* Client data to be passed to the callback. */
1334 Wake up the West Bridge device from suspend mode.
1337 This call wakes up the West Bridge device from suspend mode,
1338 and makes it ready for accepting other commands from the API.
1339 A CyAsEventMiscWakeup event will be delivered to the callback
1340 registered with CyAsMiscRegisterCallback to indicate that the
1341 wake up is complete.
1343 The CyAsEventMiscWakeup event will also be delivered if the
1344 wakeup happens due to USB or GPIO activity.
1346 * Valid In Asynchronous Callback: NO
1349 * CY_AS_ERROR_SUCCESS - the device was woken up from
1351 * CY_AS_ERROR_INVALID_HANDLE - invalid device handle
1353 * CY_AS_ERROR_NOT_CONFIGURED - West Bridge device has
1354 * not been configured.
1355 * CY_AS_ERROR_NO_FIRMWARE - firmware has not been
1356 * downloaded to the device.
1357 * CY_AS_ERROR_NOT_IN_SUSPEND - the device is not in
1359 * CY_AS_ERROR_OUT_OF_MEMORY - failed to allocate memory
1360 * for the operation.
1361 * CY_AS_ERROR_TIMEOUT - failed to wake up the device.
1364 * CyAsMiscEnterSuspend
1366 EXTERN cy_as_return_status_t
1367 cy_as_misc_leave_suspend(
1368 /* Handle to the West Bridge device */
1369 cy_as_device_handle handle
,
1370 /* Callback to call when device has resumed operation. */
1371 cy_as_function_callback cb
,
1372 /* Client data to be passed to the callback. */
1377 Reserve first numzones zones of nand device for storing
1378 processor boot image. LNA firmware works on the first
1379 numzones zones of nand to enable the processor to boot.
1382 This function reserves first numzones zones of nand device
1383 for storing processor boot image. This fonction MUST be
1384 completed before starting the storage stack for the setting
1385 to be taken into account.
1387 * Valid In Asynchronous Callback: YES
1390 * CY_AS_ERROR_SUCCESS- zones are reserved.
1393 EXTERN cy_as_return_status_t
1394 cy_as_misc_reserve_l_n_a_boot_area(
1395 /* Handle to the West Bridge device */
1396 cy_as_device_handle handle
,
1397 /* number of nand zones to reserve */
1399 /* Callback to call when device has resumed operation. */
1400 cy_as_function_callback cb
,
1401 /* Client data to be passed to the callback. */
1406 Select the clock frequency to be used when talking to low
1407 speed (non-high speed) SD media.
1410 West Bridge firmware uses a clock frequency less than the
1411 maximum possible rate for low speed SD media. This function
1412 selects the frequency setting from between the default speed
1413 and the maximum speed. This fonction MUST be completed before
1414 starting the storage stack for the setting to be taken into
1417 * Valid in Asynchronous Callback: Yes (if cb is non-zero)
1421 * CY_AS_ERROR_SUCCESS - the operation completed successfully.
1422 * CY_AS_ERROR_INVALID_HANDLE - invalid device handle passed in.
1423 * CY_AS_ERROR_NOT_CONFIGURED - West Bridge device has not been
1425 * CY_AS_ERROR_NO_FIRMWARE - firmware has not been downloaded
1427 * CY_AS_ERROR_OUT_OF_MEMORY - failed to allocate memory for
1429 * CY_AS_ERROR_IN_SUSPEND - West Bridge is in low power suspend
1431 * CY_AS_ERROR_INVALID_PARAMETER - invalid frequency setting
1433 * CY_AS_ERROR_TIMEOUT - West Bridge device did not respond to
1435 * CY_AS_ERROR_INVALID_RESPONSE - active firmware does not support
1439 * CyAsLowSpeedSDFreq
1441 EXTERN cy_as_return_status_t
1442 cy_as_misc_set_low_speed_sd_freq(
1443 /* Handle to the West Bridge device */
1444 cy_as_device_handle handle
,
1445 /* Frequency setting desired for low speed SD cards */
1446 cy_as_low_speed_sd_freq setting
,
1447 /* Callback to call on completion */
1448 cy_as_function_callback cb
,
1449 /* Client data to be passed to the callback */
1454 Select the clock frequency to be used when talking to high speed
1458 West Bridge firmware uses a 48 MHz clock to interface with high
1459 speed SD/MMC media. This clock rate can be restricted to 24 MHz
1460 if desired. This function selects the frequency setting to be
1461 used. This fonction MUST be completed before starting the storage
1462 stack for the setting to be taken into account.
1464 * Valid in Asynchronous Callback: Yes (if cb is non-zero)
1468 * CY_AS_ERROR_SUCCESS - the operation completed successfully.
1469 * CY_AS_ERROR_INVALID_HANDLE - invalid device handle passed in.
1470 * CY_AS_ERROR_NOT_CONFIGURED - West Bridge device has not been
1472 * CY_AS_ERROR_NO_FIRMWARE - firmware has not been downloaded to
1474 * CY_AS_ERROR_OUT_OF_MEMORY - failed to allocate memory for the
1476 * CY_AS_ERROR_IN_SUSPEND - West Bridge is in low power suspend mode.
1477 * CY_AS_ERROR_INVALID_PARAMETER - invalid frequency setting desired.
1478 * CY_AS_ERROR_TIMEOUT - West Bridge device did not respond to the
1480 * CY_AS_ERROR_INVALID_RESPONSE - active firmware does not support
1484 * CyAsLowSpeedSDFreq
1486 EXTERN cy_as_return_status_t
1487 cy_as_misc_set_high_speed_sd_freq(
1488 /* Handle to the West Bridge device */
1489 cy_as_device_handle handle
,
1490 /* Frequency setting desired for high speed SD cards */
1491 cy_as_high_speed_sd_freq setting
,
1492 /* Callback to call on completion */
1493 cy_as_function_callback cb
,
1494 /* Client data to be passed to the callback */
1498 Select the polarity of the SD_POW output driven by West Bridge.
1501 The SD_POW signal driven by West Bridge can be used to control
1502 the supply of Vcc to the SD/MMC media connected to the device.
1503 This signal is driven as an active high signal by default. This
1504 function can be used to change the polarity of this signal if
1505 required. This fonction MUST be completed before starting the
1506 storage stack for the setting to be taken into account.
1508 * Valid in Asynchronous Callback: Yes (if cb is non-zero)
1512 * CY_AS_ERROR_SUCCESS - the operation completed successfully.
1513 * CY_AS_ERROR_INVALID_HANDLE - invalid device handle passed in.
1514 * CY_AS_ERROR_NOT_CONFIGURED - West Bridge device has not been
1516 * CY_AS_ERROR_NO_FIRMWARE - firmware has not been downloaded
1518 * CY_AS_ERROR_OUT_OF_MEMORY - failed to allocate memory for
1520 * CY_AS_ERROR_IN_SUSPEND - West Bridge is in low power
1522 * CY_AS_ERROR_INVALID_PARAMETER - invalid frequency setting
1524 * CY_AS_ERROR_TIMEOUT - West Bridge device did not respond to
1526 * CY_AS_ERROR_INVALID_RESPONSE - active firmware does not
1527 * support the operation.
1530 * CyAsMiscSignalPolarity
1532 EXTERN cy_as_return_status_t
1533 cy_as_misc_set_sd_power_polarity(
1534 /* Handle to the West Bridge device */
1535 cy_as_device_handle handle
,
1536 /* Desired polarity setting to the SD_POW signal. */
1537 cy_as_misc_signal_polarity polarity
,
1538 /* Callback to call on completion. */
1539 cy_as_function_callback cb
,
1540 /* Client data to be passed to the callback. */
1544 /* For supporting deprecated functions */
1545 #include "cyasmisc_dep.h"
1547 #include "cyas_cplus_end.h"
1549 #endif /* _INCLUDED_CYASMISC_H_ */