亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 91x_fmi.c

?? 最新版FreeRTOS, 包擴多種開發平臺的移植
?? C
?? 第 1 頁 / 共 2 頁
字號:
/******************** (C) COPYRIGHT 2006 STMicroelectronics ********************
* File Name          : 91x_fmi.c
* Author             : MCD Application Team
* Date First Issued  : 05/18/2006 : Version 1.0
* Description        : This file provides all the FMI software functions.
********************************************************************************
* History:
* 05/24/2006 : Version 1.1
* 05/18/2006 : Version 1.0
********************************************************************************
* THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
* CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS
* A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
* OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
* OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
* CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*******************************************************************************/


/* Standard include ----------------------------------------------------------*/
#include "91x_fmi.h"

/* Include of other module interface headers ---------------------------------*/
/* Local includes ------------------------------------------------------------*/
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/

#define TIMEOUT      0xFFFFFF     /* Timeout value */

/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Interface functions -------------------------------------------------------*/
/* Private functions ---------------------------------------------------------*/


/*******************************************************************************
* Function Name  : FMI_BankRemapConfig
* Description    : Configure the addresses and sizes of bank 0 and bank 1. 
* Input1         : FMI_BootBankSize: specifies the boot bank size.
*                  This parameter can be one of the following values:
*                     - 0x0: 32KBytes.
*                     - 0x1: 64KBytes.
*                     - 0x2: 128KBytes.
*                     - 0x3: 256KBytes.
*                     - 0x4: 512KBytes.
*                     ....
*                     - 0xB: 64MBytes.
* Input2         : FMI_NonBootBankSize: specifies the non boot bank size.
*                  This parameter can be one of the following values:
*                     - 0x0: 8KBytes.
*                     - 0x1: 16KBytes.
*                     - 0x2: 32KBytes.
*                     - 0x3: 64KBytes.
*                     ....
*                     - 0xD: 64MBytes.
* Input3         : FMI_BootBankAddress: specifies the address of the boot bank.
* Input4         : FMI_NonBootBankAddress: specifies the address of the non 
*                  boot bank.
* Output         : None
* Return         : None
*******************************************************************************/
void FMI_BankRemapConfig(u8 FMI_BootBankSize, u8 FMI_NonBootBankSize, \
                         u32 FMI_BootBankAddress, u32 FMI_NonBootBankAddress)
{
    FMI->BBSR   = FMI_BootBankSize;
    FMI->NBBSR  = FMI_NonBootBankSize;
    FMI->BBADR  = (FMI_BootBankAddress >> 2);
    FMI->NBBADR = (FMI_NonBootBankAddress >> 2);
    FMI->CR     |= 0x18; /* Enable bank 1 */
}

/*******************************************************************************
* Function Name  : FMI_Config
* Description    : Configure the FMI.
* Input1         : FMI_ReadWaitState: specifies the needed read wait states.
*                  This parameter can be one of the following values:
*                     - FMI_READ_WAIT_STATE_1: One read wait state.
*                     - FMI_READ_WAIT_STATE_2: Two read wait states.
*                     - FMI_READ_WAIT_STATE_3: Three read wait states.
* Input2         : FMI_WriteWaitState: specifies the needed write wait states.
*                  This parameter can be one of the following values:
*                     - FMI_WRITE_WAIT_STATE_1: One write wait state.
*                     - FMI_WRITE_WAIT_STATE_2: Two write wait states.
* Input3         : FMI_PWD: specifies the power down mode status.
*                  This parameter can be one of the following values:
*                     - FMI_PWD_ENABLE:  Enable the PWD.
*                     - FMI_PWD_DISABLE: Disable the PWD.
* Input4         : FMI_LVDEN: specifies the low voltage detector status.
*                  This parameter can be one of the following values:
*                     - FMI_LVD_ENABLE:  Enable the LVD.
*                     - FMI_LVD_DISABLE: Disable the LVD.
* Input5         : FMI_FreqRange: specifies the working frequency range.
*                  This parameter can be one of the following values:
*                     - FMI_FREQ_LOW:  Low working frequency (up to 66MHz).
*                     - FMI_FREQ_HIGH: High working frequency (above 66MHz) .
* Output         : None
* Return         : None
*******************************************************************************/
void FMI_Config(u16 FMI_ReadWaitState, u32 FMI_WriteWaitState, u16 FMI_PWD,\
                u16 FMI_LVDEN, u16 FMI_FreqRange)
{
  /* Configure the write wait state value */
  if (FMI_WriteWaitState == FMI_WRITE_WAIT_STATE_1)
  {
    FMI->CR |= FMI_WRITE_WAIT_STATE_1;
  }
  else
  {
    FMI->CR &= FMI_WRITE_WAIT_STATE_0;
  }

  /* Write a write flash configuration register command */
  *(vu16 *)FMI_BANK_1 = 0x60;

  /* Configure the flash configuration register */
  *(vu16 *)(FMI_BANK_1|FMI_ReadWaitState|FMI_PWD|FMI_LVDEN|FMI_FreqRange) = 0x03;
}

/*******************************************************************************
* Function Name  : FMI_EraseSector
* Description    : Erase the needed sector.
* Input          : FMI_Sector: specifies the sector to be erased.  
*                  This parameter can be one of the following values:
*                     - FMI_B0S0: FMI bank 0 sector 0. 
*                     - FMI_B0S1: FMI bank 0 sector 1.
*                     - FMI_B0S2: FMI bank 0 sector 2.
*                     - FMI_B0S3: FMI bank 0 sector 3.
*                     - FMI_B0S4: FMI bank 0 sector 4.
*                     - FMI_B0S5: FMI bank 0 sector 5.
*                     - FMI_B0S6: FMI bank 0 sector 6.
*                     - FMI_B0S7: FMI bank 0 sector 7.
*                     - FMI_B1S0: FMI bank 1 sector 0.
*                     - FMI_B1S1: FMI bank 1 sector 1.
*                     - FMI_B1S2: FMI bank 1 sector 2.
*                     - FMI_B1S3: FMI bank 1 sector 3.
* Output         : None
* Return         : None
*******************************************************************************/
void FMI_EraseSector(vu32 FMI_Sector)
{ 
  /* Write an erase set-up command to the sector */
  *(vu16 *)FMI_Sector = 0x20;

  /* Write an erase confirm command to the sector */
  *(vu16 *)FMI_Sector = 0xD0;
}

/*******************************************************************************
* Function Name  : FMI_EraseBank
* Description    : Erase the needed bank.
* Input          : FMI_Bank: specifies the bank to be erased.
*                  This parameter can be one of the following values:
*                     - FMI_BANK_0: FMI bank 0.
*                     - FMI_BANK_1: FMI bank 1.
* Output         : None
* Return         : None
*******************************************************************************/
void FMI_EraseBank(vu32 FMI_Bank)
{
  /* Write a bank erase set-up command to the bank */
  *(vu16 *)FMI_Bank = 0x80;

  /* Write an erase confirm command to the sector */
  *(vu16 *)FMI_Bank = 0xD0;
}

/*******************************************************************************
* Function Name  : FMI_WriteHalfWord
* Description    : Write a halfword to the needed Flash memory address.
* Input 1        : FMI_Address: specifies the address offset where the data will 
*                  be written.
* Input 2        : FMI_Data: the needed data.
* Output         : None
* Return         : None
*******************************************************************************/
void FMI_WriteHalfWord(u32 FMI_Address, u16 FMI_Data)
{
  /* Write a program command to the sector to be written */
  *(vu16 *)(FMI_Address & 0xFFFFFFFC) = 0x40;
  
  /* Write the halfword to the destination address */
  *(vu16 *)FMI_Address = FMI_Data;
}

/*******************************************************************************
* Function Name  : FMI_WriteOTPHalfWord
* Description    : Write a halfword to the needed OTP sector address.
* Input 1        : FMI_OTPHWAddress: specifies the halfword address offset  
*                  where the data will be written.
*                  This parameter can be one of the following values:
*                     - FMI_OTP_LOW_HALFWORD_0: OTP Low halfword 0.
*                     - FMI_OTP_HIGH_HALFWORD_0: OTP High halfword 0.
*                     - FMI_OTP_LOW_HALFWORD_1: OTP Low halfword 1.
*                     - FMI_OTP_HIGH_HALFWORD_1: OTP High halfword 1.
*                     - FMI_OTP_LOW_HALFWORD_2: OTP Low halfword 2.
*                     - FMI_OTP_HIGH_HALFWORD_2: OTP High halfword 2.
*                     - FMI_OTP_LOW_HALFWORD_3: OTP Low halfword 3.
*                     - FMI_OTP_HIGH_HALFWORD_3: OTP High halfword 3.
*                     - FMI_OTP_LOW_HALFWORD_4: OTP Low halfword 4.
*                     - FMI_OTP_HIGH_HALFWORD_4: OTP High halfword 4.
*                     - FMI_OTP_LOW_HALFWORD_5: OTP Low halfword 5.
*                     - FMI_OTP_HIGH_HALFWORD_5: OTP High halfword 5.
*                     - FMI_OTP_LOW_HALFWORD_6: OTP Low halfword 6.
*                     - FMI_OTP_HIGH_HALFWORD_6: OTP High halfword 6.
*                     - FMI_OTP_LOW_HALFWORD_7: OTP Low halfword 7.
*                     - FMI_OTP_HIGH_HALFWORD_7: OTP High halfword 7.
* Input 2        : FMI_OTPData: The needed OTP data.
* Output         : None
* Return         : None
*******************************************************************************/
void FMI_WriteOTPHalfWord(u8 FMI_OTPHWAddress, u16 FMI_OTPData)
{
  /* Write a write OTP command to the needed address */
  *(vu16 *)(FMI_BANK_1) = 0xC0;
  
  /* Write the halfword to the destination address */
  *(vu16 *)(FMI_BANK_1 + FMI_OTPHWAddress) = FMI_OTPData;
}

/*******************************************************************************
* Function Name  : FMI_ReadWord
* Description    : Read the correspondent data.
* Input          : FMI_Address: specifies the needed address.
* Output         : None
* Return         : The data contained in the specified address.
*******************************************************************************/
u32 FMI_ReadWord(u32 FMI_Address)
{
  return(*(u32*)FMI_Address);
}

/*******************************************************************************
* Function Name  : FMI_ReadOTPData
* Description    : Read data from the OTP sector.
* Input          : FMI_OTPAddress: specifies the address of the data to be read.
*                  This parameter can be one of the following values:
*                     - FMI_OTP_WORD_0: FMI bank 0 sector 0. 
*                     - FMI_OTP_WORD_1: FMI bank 0 sector 1.
*                     - FMI_OTP_WORD_2: FMI bank 0 sector 2.
*                     - FMI_OTP_WORD_3: FMI bank 0 sector 3. 
*                     - FMI_OTP_WORD_4: FMI bank 0 sector 4.
*                     - FMI_OTP_WORD_5: FMI bank 0 sector 5.
*                     - FMI_OTP_WORD_6: FMI bank 0 sector 6. 
*                     - FMI_OTP_WORD_7: FMI bank 0 sector 7.
* Output         : None
* Return         : The needed OTP words.
*******************************************************************************/
u32 FMI_ReadOTPData(u8 FMI_OTPAddress)
{
  u32 OTP_Data = 0x0;
  /* write a read OTP sector command */
  *(vu16 *)(FMI_BANK_1) = 0x98;
  
  /* Read the correspondent data */
  OTP_Data = (*(vu32*)(FMI_BANK_1 + FMI_OTPAddress));

  /* Write a read array command */
  *(vu16 *)(FMI_BANK_1) = 0xFF;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品免费国产一区二区三区四区| 午夜精品123| 亚洲www啪成人一区二区麻豆| 激情文学综合丁香| 91麻豆国产在线观看| 久久综合狠狠综合久久激情| 亚洲网友自拍偷拍| av不卡在线播放| 久久精品欧美日韩精品| 免费久久99精品国产| 91极品视觉盛宴| 中文字幕免费在线观看视频一区| 男女男精品网站| 欧美性受xxxx| 亚洲精品国产高清久久伦理二区| 国产99精品在线观看| 2021国产精品久久精品| 看国产成人h片视频| 欧美日韩色综合| 亚洲精品视频观看| 成人v精品蜜桃久久一区| 久久久久国产免费免费| 精品系列免费在线观看| 欧美精品123区| 日韩国产欧美在线观看| 这里是久久伊人| 首页国产丝袜综合| 在线不卡欧美精品一区二区三区| 香蕉加勒比综合久久| 在线视频欧美精品| 亚洲h在线观看| 欧美手机在线视频| 亚洲超碰精品一区二区| 欧美日韩精品高清| 三级精品在线观看| 欧美一区二区成人6969| 久久99国产精品麻豆| 国产视频在线观看一区二区三区| 国产精品一区二区无线| 国产精品久久久久久亚洲毛片| 99久久免费视频.com| 亚洲欧美日韩国产另类专区| 色婷婷久久一区二区三区麻豆| 亚洲欧美日韩小说| 欧美午夜不卡视频| 日本vs亚洲vs韩国一区三区| 日韩免费在线观看| 成人动漫视频在线| 亚洲国产欧美另类丝袜| 欧美α欧美αv大片| 国产不卡在线一区| 亚洲欧洲www| 在线不卡一区二区| 国产精品一品二品| 亚洲一区二区三区四区在线观看 | 一个色综合av| 7777精品伊人久久久大香线蕉| 日韩成人免费电影| 国产欧美日本一区二区三区| 91久久精品国产91性色tv| 日韩高清电影一区| 国产欧美精品日韩区二区麻豆天美| 波多野结衣中文字幕一区| 午夜a成v人精品| 国产午夜精品福利| 欧美日韩一区二区三区四区| 国产一区91精品张津瑜| 亚洲视频在线一区观看| 精品国产欧美一区二区| 色综合久久综合网欧美综合网| 免费在线成人网| 中文字幕视频一区| 日韩色在线观看| 色综合中文字幕| 久久不见久久见免费视频7| 成人免费一区二区三区在线观看| 欧美丰满一区二区免费视频| 成人h版在线观看| 麻豆极品一区二区三区| 亚洲美女屁股眼交3| 26uuu精品一区二区| 欧美日韩精品一区二区三区蜜桃| 国产高清无密码一区二区三区| 亚洲成人777| 自拍偷拍国产亚洲| 日本一区二区三区dvd视频在线| 制服丝袜av成人在线看| 欧美中文字幕亚洲一区二区va在线| 国产福利一区二区| 久久99精品国产麻豆不卡| 亚洲成人免费在线观看| 亚洲精品欧美激情| 国产精品久久福利| 国产三级欧美三级| 精品久久久久99| 日韩一区二区三区在线| 欧美男同性恋视频网站| 91成人在线精品| 91色porny| 91啪九色porn原创视频在线观看| 国产凹凸在线观看一区二区| 经典三级在线一区| 精品一二三四在线| 狠狠久久亚洲欧美| 免费成人美女在线观看| 日韩电影在线观看一区| 亚洲va欧美va国产va天堂影院| 一二三区精品视频| 亚洲一区av在线| 一区av在线播放| 亚洲v中文字幕| 天天综合色天天| 日韩va亚洲va欧美va久久| 午夜精品久久久久久不卡8050| 亚洲高清中文字幕| 亚洲小说欧美激情另类| 亚洲电影中文字幕在线观看| 洋洋成人永久网站入口| 亚洲午夜激情网站| 日本aⅴ亚洲精品中文乱码| 免费观看在线综合色| 国产在线不卡一区| 国产成人a级片| 91视频在线观看免费| 欧美亚洲综合网| 欧美一区二区三区视频免费播放| 欧美变态口味重另类| 国产欧美日产一区| 一区二区在线免费| 婷婷久久综合九色综合伊人色| 天堂av在线一区| 久久狠狠亚洲综合| 成人免费看视频| 欧美日韩专区在线| 日韩欧美国产综合在线一区二区三区| 欧美成人精品二区三区99精品| 久久久久久久国产精品影院| 国产精品白丝在线| 婷婷国产在线综合| 国产自产2019最新不卡| 96av麻豆蜜桃一区二区| 欧美肥妇毛茸茸| 国产人成一区二区三区影院| 一区二区三区国产精华| 日本91福利区| 成人av免费观看| 91.麻豆视频| 国产精品区一区二区三区| 国产成人午夜精品5599| 91麻豆免费视频| 精品国产露脸精彩对白 | 欧美一区二区大片| 中文字幕欧美三区| 日韩不卡手机在线v区| 成人做爰69片免费看网站| 欧美麻豆精品久久久久久| 国产精品天美传媒| 首页亚洲欧美制服丝腿| av在线这里只有精品| 日韩欧美国产成人一区二区| ㊣最新国产の精品bt伙计久久| 日韩不卡一区二区| 91激情五月电影| 国产精品美女久久久久久| 三级久久三级久久久| 一本色道久久综合精品竹菊| 日韩欧美在线综合网| 一区二区三区四区国产精品| 国产乱码精品1区2区3区| 欧美日韩国产美| 亚洲免费观看高清完整版在线| 久久激情五月婷婷| 欧美日韩国产高清一区二区| 亚洲天堂成人在线观看| 国产夫妻精品视频| 日韩欧美视频在线| 三级成人在线视频| 欧美性猛交xxxx乱大交退制版 | 亚洲成av人片www| 99久久99久久久精品齐齐| 精品国产乱码久久久久久图片| 天天影视网天天综合色在线播放| 91一区二区三区在线观看| 久久久久久久久97黄色工厂| 麻豆成人91精品二区三区| 欧美日韩国产影片| 亚洲国产欧美日韩另类综合| 91久久精品一区二区| 亚洲另类中文字| 色综合久久66| 一区精品在线播放| 99久久夜色精品国产网站| 自拍偷自拍亚洲精品播放| www.性欧美| 亚洲三级在线观看| 在线一区二区三区做爰视频网站| 亚洲欧美在线视频观看| 色婷婷激情综合| 亚洲成人动漫精品| 3atv在线一区二区三区|