📄 dvb_usb.h
字号:
#ifndef _DVB_USB_H_
#define _DVB_USB_H_
/*! \file
* This module provides the usb and file system control API.
*
*/
#include "ct_type.h"
//--------------------------------------------------------------------
// State
#define USB_STATUS_UNKNOWN 0
#define USB_STATUS_NO_DEVICE 1
#define USB_STATUS_NOT_SUPPORTED_DEVICE 2
#define USB_STATUS_MASS_STORAGE_DEVICE 3
#define USB_STATUS_NO_DISC 4
#define USB_STATUS_CARD_ABNORMAL 5
//#define USB_PORT_0 0x30
//#define USB_PORT_1 0x40
//--------------------------------------------------------------------
typedef struct
{
// bit 0: LUN0, bit 1: LUN1, ..., bit 31: LUN31
u32 u32LUNs;
u8 u8MaxLUN;
bool8 b8Connect;
s8 s8CurrentLUN;
} ST_USB_LUN_INFO;
typedef struct
{
u32 u32Node;
} ST_USB_LUN_LIST_NODT;
typedef enum
{
EN_USB_DEVICE_NOT_READY,
EN_USB_DETECTING,
EN_USB_INITIALIZING,
EN_USB_READY
} EN_USB_CONDITION;
//--------------------------------------------------------------------
void DVB_USB_Power(bool8 b8Enable);
/*! \fn void DVB_USB_Power(bool8 b8Enable)
\brief
\return
*/
bool8 DVB_USB_ForceFullSpeed(u8 u8enable);
bool8 DVB_USB_Initial(void);
/*! \fn bool8 DVB_USB_Initial(void)
\brief Initial the usb hardware device.
\return This is initial status. If this value is 0, the initial status of usb is fail.
*/
void DVB_USB_SectorInfo(u32 *pu32TotalSectors, u32 *pu32SectorBytes);
/*! \fn void DVB_USB_SectorInfo(u32 *pu32TotalSectors, u32 *pu32SectorBytes)
\brief
\return
*/
u32 DVB_USB_Status(void);
/*! \fn u32 DVB_USB_Status(void)
\brief
\return
*/
bool8 DVB_USB_Read(u32 u32SectorIndex, u16 u16SectorLengths, u8 *pu8Buffer);
/*! \fn bool8 DVB_USB_Read(u32 u32SectorIndex, u16 u16SectorLengths, u8 *pu8Buffer)
\brief
\param u32SectorIndex (Input)
\param u8SectorLengths (Input)
\param pu8Buffer (Input)
\return
*/
bool8 DVB_USB_Write(u32 u32SectorIndex, u16 u16SectorLengths, u8 *pu8Buffer);
/*! \fn bool8 DVB_USB_Write(u32 u32SectorIndex, u16 u16SectorLengths, u8 *pu8Buffer)
\brief
\param u32SectorIndex (Input)
\param u8SectorLengths (Input)
\param pu8Buffer (Input)
\return
*/
//--------------------------------------------------------------------
bool8 DVB_USB_InitPolling(void);
/*! \fn bool8 DVB_USB_InitPolling(void)
\brief
\return
*/
bool8 DVB_USB_Change_LUN(u8 u8LUN);
/*! \fn bool8 DVB_USB_Change_LUN(u8 u8LUN)
\brief
\return
*/
void DVB_USB_Get_LUN(u8 u8Port, ST_USB_LUN_INFO *pstUSBLUNInfo);
/*! \fn void DVB_USB_Get_LUN(u8 u8Port, ST_USB_LUN_INFO *pstUSBLUNInfo)
\brief
\return
*/
bool8 DVB_USB_Ready(u8 u8LUN);
/*! \fn bool8 DVB_USB_Ready(u8 u8LUN)
\brief
\return
*/
bool8 DVB_USB_Reset(void);
/*! \fn bool8 DVB_USB_Reset(void)
\brief
\return
*/
bool8 DVB_USB_Standby(void);
/*! \fn bool8 DVB_USB_Standby(void)
\brief
\return
*/
bool8 DVB_USB_Recovery(void);
/*! \fn bool8 DVB_USB_Recovery(void)
\brief
\return
*/
bool8 DVB_USB_SetChunkSize(u32 u32chunksize);
bool8 DVB_USB_GetChunkSize(void);
bool8 DVB_USB_GetDescriptorInfo(void);
void DVB_USB_DebugInfo(u8 *pu8PreBuffer, u8 *pu8TstBuffer);
/*! \fn void DVB_USB_DebugInfo(void)
\brief
\return
*/
//u32 DVB_USB_GetInternalTaskPriority(u32 index);
//void DVB_USB_SetInternalTaskPriority(u32 index, u32 priority);
#if 0
bool8 DVB_USB_Ready(void);
#ifdef ENABLE_WASTE_TIME
void DVB_USB_InitWasteTime(void);
void DVB_USB_SetStartReadTime(u32 u32Time);
u32 DVB_USB_GetWasteTime(void);
#endif
void DVB_USB_SetFSReady(bool8 b8Flag);
bool8 DVB_USB_GetFSReady(void);
void DVB_USB_SetFSInitDone(bool8 b8Flag);
bool8 DVB_USB_GetFSInitDone(void);
void DVB_USB_Clean_FS_Info(bool8 b8Flag);
EN_USB_CONDITION DVB_USB_CheckDeviceFSReady(void);
void DVB_USB_CheckWait(u32 u32Time);
bool8 DVB_USB_ReInsert(void);
void DVB_USB_ClearReInsert(void);
void DVB_USB_Set_Allow_FS_Init(bool8 b8Flag);
bool8 DVB_USB_Get_Allow_FS_Init(void);
void DVB_USB_Set_Device(u32 u32Port, u8 u8LUN);
u32 DVB_USB_Get_Device(void);
bool8 DVB_USB_Get_Scan(void);
#endif
#endif /* _DVB_USB_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -