📄 dvb_flash.h
字号:
/**************************************************************************
(C)Copyright Cheertek Inc. 2005,
K000, all right reserved.
Product: STB Firmware
****************************************************************************/
/*!
\file
This module provides the flash access API.
*/
#ifndef __DVB_FLASH_H
#define __DVB_FLASH_H
#include "dvb_type.h"
/*!
* Define flash device information structure.
*/
typedef struct _ST_FLASH_INFO_T
{
u16 u16Manufacture; /*!< The manufacturer ID of flash. */
u16 u16Device; /*!< The device ID of flash. */
u32 u32FlashSize; /*!< The number of byte for flash size. */
u8 u8Num_Bank; /*!< The number of bank. One bank is 64KBytes for each flash type. */
}_Pack_Struct_ ST_FLASH_INFO_T;
typedef enum
{
EN_FLASH_APPLACTION_TYPE_FLASH, /**< the applaction is run at flash */
EN_FLASH_APPLACTION_TYPE_DRAM, /**< the applaction is run at dram */
}EN_FLASH_APPLACTION_TYPE;
bool8 DVB_FlashCheckID(ST_FLASH_INFO_T *pstFlashInfo);
/*! \fn bool8 DVB_FlashCheckID(ST_FLASH_INFO_T *pstFlashInfo)
\brief check on board flash ID. this function only check flash id at first time, after that return local variable only.
\param pstFlashInfo (Output) refer to ST_FLASH_INFO_T structure.
\return TRUE - success
\return FALSE - flash not found
*/
bool8 DVB_FlashErase(u8 u8Bank);
/*! \fn bool8 DVB_FlashErase(u8 u8Bank)
\brief Erase a flash bank
\param u8Bank (Input) the bank want to erase
\return TRUE - success
\return FALSE - erase fail
*/
bool8 DVB_FlashChipErase(void);
/*! \fn bool8 DVB_FlashChipErase(void)
\brief Erase total data in flash
\return TRUE - success
\return FALSE - erase fail
*/
bool8 DVB_FlashWrite(u8 u8Bank, u32 u32Address, u8* pu8Buffer, u32 u32BufferSize);
/*! \fn bool8 DVB_FlashWrite(u8 u8Bank, u32 u32Address, u8* pu8Buffer, u32 u32BufferSize)
\brief write data to specific bank and address
\param u8Bank (Input) the bank want to write
\param u32Address (Input) the bank address of start writing
\param pu8Buffer (Input) data pointer of write buffer
\param u32BufferSize (Input) bytes of write buffer
\return TRUE - success
\return FALSE - write fail
*/
bool8 DVB_FlashRead(u8 u8Bank, u32 u32Address, u8* pu8Buffer, u32 u32BufferSize);
/*! \fn bool8 DVB_FlashRead(u8 u8Bank, u32 u32Address, u8* pu8Buffer, u32 u32BufferSize)
\brief read data from specific bank and address
\param u8Bank (Input) the bank want to read
\param u32Address (Input) the bank address of start reading
\param pu8Buffer (Output) data pointer of read buffer
\param u32BufferSize (Output) bytes of read buffer
\return TRUE - success
\return FALSE - read fail
*/
u32 DVB_FlashGetBankAddress(u8 u8Bank);
/*! \fn u32 DVB_FlashGetBankAddress(u8 u8Bank)
\brief Get address of bank in flash.
\param u8Bank (Input) Indicate which bank.
\return address of bank
*/
bool8 DVB_FlashReadBank(u8 u8Bank, u32 u32DramAddress);
bool8 DVB_FlashWriteBank(u8 u8Bank, u32 u32DramAddress);
bool8 DVB_FlashReadData( u32 u32Address, u8* pu8Buffer, u32 u32BufferSize);
bool8 DVB_FlashWriteData(u32 u32Address, u8* pu8Buffer, u32 u32BufferSize);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -