⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mc_api.h

📁 MMI层OBJ不能完全编译
💻 H
📖 第 1 页 / 共 2 页
字号:
 *                        filled by driver. See [Host Controller], 
 *                        paragraph 2.4 for an explanations of the status bits.
 * @return  RV_OK         Success
 *          RV_NOT_READY  The driver is not able to handle this request at 
 *                        this moment.
 *          RV_MEMORY_ERR Insufficient memory
 */
extern T_RV_RET mc_get_controller_status (UINT16 *status);

/**
 * Enable DMA mode
 *
 * Detailled description.
 * This function selects the DMA mode to be used by the driver. Default setting 
 * will be force CPU.
 *
 * @param   dma_mode      Indicates whether to use DMA or let the CPU handle 
 *                        the copying.
 * @return  RV_OK         Success
 *          RV_NOT_READY  The driver is not able to handle this request at 
 *                        this moment.
 *          RV_MEMORY_ERR Insufficient memory
 *          RV_INVALID_PARAMETER invalid mode.
 */
extern T_RV_RET mc_dma_mode (T_MC_DMA_MODE dma_mode);

/**
 * Update acquisition
 *
 * Detailled description.
 * This function starts an identification cycle of a card stack (acquisition 
 * procedure). The card management information in the controller will be 
 * updated. New cards will be initialised; old cards keep their configuration. 
 * At the end all active cards are in Stand-by state.
 * After this function has completed the number of cards connected can be 
 * retrieved with the mc_get_stack_size() function. The session address of 
 * each connected card can be retrieved with the mc_read_card_stack() function. 
 *
 * @param   subscriber    Subscriber identification value.
 * @return  RV_OK         Success
 *          RV_NOT_READY  The driver is not able to handle this request at 
 *                        this moment.
 */
extern T_RV_RET mc_update_acq (T_MC_SUBSCRIBER subscriber);

/**
 * Reset
 *
 * Detailled description.
 * This function resets all cards to idle state. This function executes the 
 * GO_IDLE_STATE command (CMD0) on the bus. After completion of this service 
 * the mc_update_acq() function shall be called before the MC-cards can be 
 * used.
 *
 * @param   subscriber    Subscriber identification value.
 * @return  RV_OK         Success
 *          RV_NOT_READY  The driver is not able to handle this request at 
 *                        this moment.
 */
extern T_RV_RET mc_reset (T_MC_SUBSCRIBER subscriber);

/**
 * Get stack size
 *
 * Detailled description.
 * This function returns the number of connected MC-cards.
 *
 * @param   size_p        Pointer to integer value allocated by the client, in
 *                        which the driver stores the stack size.
 * @return  RV_OK         Success
 *          RV_NOT_READY  The driver is not able to handle this request at 
 *                        this moment.
 *          RV_INVALID_PARAMETER size_p is NULL.
 */
extern T_RV_RET mc_get_stack_size (UINT16 *size_p);

/**
 * Read card stack
 *
 * Detailled description.
 * This function returns the relative card address of each individual MC-card 
 * on the MC-bus. The client needs to provide an array of T_MC_RCA. The size 
 * of the array can be determined with the mc_get_stack_size() function.
 *
 * @param   stack_p       Pointer to T_MC_RCA array.
 *          size          Array size in units of T_MC_RCA.
 * @return  RV_OK         Success
 *          RV_NOT_READY  The driver is not able to handle this request at 
 *                        this moment.
 *          RV_INVALID_PARAMETER stack_p is NULL.
 */
extern T_RV_RET mc_read_card_stack (T_MC_RCA *stack_p, UINT16 size);

/**
 * Read OCR
 *
 * Detailled description.
 * This function returns the 32-bit OCR-register from a MC-card. This register
 * is not buffered in the driver and therefore will be read directly from the 
 * card.
 *
 * @param   rca           Relative Card Address.
 *          ocr_p         Pointer to an 32-bits data location, provided by the 
 *                        client, to which the driver copies the OCR.
 *          subscriber    Subscriber identification value.
 * @return  RV_OK         Success
 *          RV_NOT_READY  The driver is not able to handle this request at 
 *                        this moment.
 *          RV_MEMORY_ERR Insufficient memory
 */
extern T_RV_RET mc_read_OCR (T_MC_RCA rca, UINT32 *ocr_p,
                              T_MC_SUBSCRIBER subscriber);

/**
 * Read CID
 *
 * Detailled description.
 * This function returns the 128-bit CID register from a MC-card. This 
 * register is not buffered in the driver and therefore will be read 
 * directly from the card.
 *
 * @param   rca           Relative Card Address.
 *          cid_p         Pointer to a 128-bit buffer, allocated by the 
 *                        client, to which the driver copies the CID. cid_p 
 *                        points to the MSB of the CID.
 *          subscriber    Subscriber identification value.
 * @return  RV_OK         Success
 *          RV_NOT_READY  The driver is not able to handle this request at 
 *                        this moment.
 *          RV_MEMORY_ERR Insufficient memory
 */
extern T_RV_RET mc_read_CID (T_MC_RCA rca, UINT8 *cid_p,
                              T_MC_SUBSCRIBER subscriber);

/**
 * Read CSD
 *
 * Detailled description.
 * This function returns the 128-bit CSD register from a MC-card. This 
 * register is not buffered in the driver and therefore will be read 
 * directly from the card.
 *
 * @param   rca           Relative Card Address.
 *          csd_p         Pointer to a 128-bit buffer, allocated by the client,
 *                        to which the driver copies the CSD. csd_p points to
 *                        the MSB of the CSD.
 *          subscriber    Subscriber identification value.
 * @return  RV_OK         Success
 *          RV_NOT_READY  The driver is not able to handle this request at 
 *                        this moment.
 *          RV_MEMORY_ERR Insufficient memory
 */
extern T_RV_RET mc_read_CSD (T_MC_RCA rca, UINT8 *csd_p,
                              T_MC_SUBSCRIBER subscriber);

/**
 * Write CSD
 *
 * Detailled description.
 * This function can be used to write one the programmable fields of the 
 * CSD-register.
 *
 * @param   rca           Relative Card Address.
 *          field         CSD field to write.
 *          value         Value to write.
 *          subscriber    Subscriber identification value.
 * @return  RV_OK         Success
 *          RV_NOT_READY  The driver is not able to handle this request at 
 *                        this moment.
 *          RV_MEMORY_ERR Insufficient memory
 */
extern T_RV_RET mc_write_CSD (T_MC_RCA rca, T_MC_CSD_FIELD field, 
                               UINT8 value, T_MC_SUBSCRIBER subscriber);

/**
 * Erase CSD
 *
 * Detailled description.
 * This function can be used to erase one the programmable fields of the 
 * CSD-register.
 *
 * @param   rca           Relative Card Address.
 *          field         CSD field to erase.
 *          subscriber    Subscriber identification value.
 * @return  RV_OK         Success
 *          RV_NOT_READY  The driver is not able to handle this request at 
 *                        this moment.
 *          RV_MEMORY_ERR Insufficient memory
 */
extern T_RV_RET mc_erase_CSD (T_MC_RCA rca, T_MC_CSD_FIELD field,
                               T_MC_SUBSCRIBER subscriber);

/**
 * Get SW version
 *
 * Detailled description.
 * This function returns the software version of the driver.
 *
 * @return  UINT32  The 32-bit software version
 */
extern UINT32 mc_get_sw_version (void);

/**
 * Get HW version
 *
 * Detailled description.
 * This function returns the hardware version number (module revision ) 
 * of the controller. This number is stored in the Module Revision 
 * Register (MC_REV) of the controller.
 *
 * @return  UINT16  The 16-bit hardware version
 */
extern UINT16 mc_get_hw_version (void);

/**
 * Subscribes the subscriber to MC events
 *
 * This function will subscribe the subscriber to certain events
 *  
 *
 * @param   events      desired events:
 *                      MC_EVENT_INSERTION
 *                      MC_EVENT_REMOVAL
 * @param   subscriber  Subscriber ID
 *                      
 * @return  RV_OK
 *          RV_NOT_READY
 *          RV_INVALID_PARAMETER
 *          RV_MEMORY_ERR
 */
extern T_RV_RET  mc_send_notification(T_MC_EVENTS events, T_MC_SUBSCRIBER subscriber);


/**
 * Will retreive the 512 bit Status register of a SD card
 *
 * This function will retreive the 512 bit Status register of a SD card
 *
 * @param   relative card address number
 *                      
 * @return  RV_INVALID_PARAMETER  no card is available at given address (or invalid address)
            RV_INVALID_PARAMETER  there is a SD card attached
            MC_CARD there is a MC card attached
 */
extern T_RV_RET mc_sd_get_card_status(T_MC_RCA rca,UINT8 *sd_status_p,T_MC_SUBSCRIBER subscriber); 
 /**
 * Returns the card type belonging to the given rca
 *
 * This function will return the card type belonging to the given
 * relative card address (rca).
 * 
 *
 * @param   relative card address number
 *                      
 * @return  NO_CARD  no card is available at given address (or invalid address)
            SD_CARD  there is a SD card attached
            MC_CARD there is a MC card attached
 */
extern T_MC_CARD_TYPE mc_get_card_type(T_MC_RCA rca);

/**
 * Will retreive the 64 bit SCR register of a SD card
 *
 * This function will retreive the 64 bit SCR  register of a SD card
 *
 * @param   rca     relative card address number
 * @param   scr_p   reference to location where scr register can be stored
 * @param   subscriber id
 *                      
 * @return  RV_INVALID_PARAMETER  no card is available at given address (or invalid address)
            RV_INVALID_PARAMETER  there is no SD card attached
            MC_CARD there is a MC card attached
 */
extern T_RV_RET mc_read_scr(T_MC_RCA rca, UINT8 *scr_p,T_MC_SUBSCRIBER subscriber);

/*@}*/



/**defines needed by other components to use MC api*/
/*
#define T_MC_EVENTS                T_MC_EVENTS              
#define MC_EVENT_INSERTION  MC_EVENT_INSERTION
#define MC_EVENT_REMOVAL  MC_EVENT_REMOVAL
#define MC_CLK_SPEED  MC_CLK_SPEED
#define T_MC_CARD_TYPE  T_MC_CARD_TYPE
#define T_MC_SD_MECH_WP  T_MC_SD_MECH_WP
#define T_MC_RCA  T_MC_RCA
#define T_MC_SUBSCRIBER  T_MC_SUBSCRIBER
#define MC_RW_STREAM MC_RW_STREAM
#define MC_RW_BLOCK MC_RW_BLOCK
#define T_MC_RW_MODE  T_MC_RW_MODE
#define T_MC_CSD_ACTION  T_MC_CSD_ACTION
#define MC_FORCE_CPU MC_FORCE_CPU
#define MC_FORCE_DMA MC_FORCE_DMA 
#define MC_DMA_AUTO MC_DMA_AUTO 
#define T_MC_DMA_MODE  T_MC_DMA_MODE
#define T_MC_CSD_FIELD  T_MC_CSD_FIELD
#define mc_subscribe  mc_subscribe
#define mc_unsubscribe   mc_unsubscribe 
#define mc_read   mc_read 
#define mc_write   mc_write 
#define mc_erase   mc_erase 
#define mc_set_write_protect   mc_set_write_protect 
#define mc_clr_write_protect   mc_clr_write_protect 
#define mc_sd_get_mech_wp  mc_sd_get_mech_wp
#define mc_get_write_protect   mc_get_write_protect 
#define mc_get_card_status  mc_get_card_status
#define mc_get_controller_status   mc_get_controller_status 
#define mc_dma_mode   mc_dma_mode 
#define mc_update_acq   mc_update_acq 
#define mc_reset   mc_reset 
#define mc_get_stack_size   mc_get_stack_size 
#define mc_read_card_stack   mc_read_card_stack 
#define mc_read_OCR   mc_read_OCR 
#define mc_read_CID   mc_read_CID 
#define mc_read_CSD   mc_read_CSD 
#define mc_write_CSD  mc_write_CSD
#define mc_erase_CSD  mc_erase_CSD
#define mc_get_sw_version   mc_get_sw_version 
#define mc_get_hw_version   mc_get_hw_version 
#define mc_send_notification  mc_send_notification
#define mc_sd_get_card_status  mc_sd_get_card_status
#define mc_get_card_type  mc_get_card_type
#define mc_read_scr  mc_read_scr
*/
/*@}*/
#ifdef __cplusplus
}
#endif


#endif /*__MC_API_H_*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -