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

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

?? f411_vr_sstflash.c

?? 用c8051f410和FLASH(SPI接口)實現的數字錄音機。
?? C
?? 第 1 頁 / 共 2 頁
字號:
//-----------------------------------------------------------------------------
// F411_VR_SSTFlash.c
//-----------------------------------------------------------------------------
// Copyright 2006 Silicon Laboratories, Inc.
// http://www.silabs.com
//
// Program Description:
//
// This file contains the interfacing functions to the SST Flash, allowing the
// user to Read memory, Write memory, and Erase memory.
//
// How To Use:    See Readme.txt
//
// FID:            41X000010
// Target:         C8051F411
// Tool chain:     Keil C51 7.50 / Keil EVAL C51
//                 Silicon Laboratories IDE version 2.6
// Project Name:   F411_VR
//
// Release 1.3
//    -All changes by TP
//    -02 Feb 2006
//    -added Read_MEM_Init (duplicate of Read_MEM) to avoid
//       the compiler warning (multiple calls to segment)
//
// Release 1.2
//    -All changes by TP
//    -21 Nov 2005
//    -project version updated, no changes to this file.
//
// Release 1.1
//    -All changes by TP
//    -16 Aug 2004
//    -added SPIF polling while sending the WREN command
//
// Release 1.0
//    -Initial Revision (TP)
//    -15 AUG 2004
//

//-----------------------------------------------------------------------------
// Includes
//-----------------------------------------------------------------------------
#include <c8051f410.h>                 // SFR declarations

//-----------------------------------------------------------------------------
// Global CONSTANTS
//-----------------------------------------------------------------------------
// SST Instruction Opcodes (as shown in the datasheet)
#define EWSR 0x50                      // enable write status register
#define WRSR 0x01                      // write status register
#define RDSR 0x05                      // read status register
#define WREN 0x06                      // write enable
#define BPROG 0x02                     // byte program
#define READ 0x03                      // read
#define CERASE 0x60                    // chip erase
#define READID 0x90                    // chip ID

// Address definition
typedef union ADDRESS {                // access an address as a
   unsigned long ULong;                // unsigned long variable or
   unsigned char UByte[4];             // 4 unsigned byte variables
   // [0] = A31-24, [1] = A23-16, [2] = A15-8, [3] = A7-0
} ADDRESS;

//-----------------------------------------------------------------------------
// Function PROTOTYPES
//-----------------------------------------------------------------------------
void SSTFlash_Init (void);

void Write_MEM (unsigned long address, unsigned char data_byte);
unsigned char Read_MEM (unsigned long address);
void Erase_MEM (void);
char ReadID_MEM (void);

//-----------------------------------------------------------------------------
// SSTFlash_Init
//-----------------------------------------------------------------------------
//
// Return Value : None
// Parameters   : None
//
// Unprotect the memory so that all of memory may be written and read.
// NOTE: The SPI must be initialized before this function is called.
//
void SSTFlash_Init (void)
{
   NSSMD0 = 0;                         // enable the flash

   // send the enable write status register command
   SPI0DAT = EWSR;                     // load the XMIT register
   while (TXBMT != 1)                  // wait until EWSR command is moved into
   {                                   // the XMIT buffer
   }
   SPIF = 0;
   while (SPIF != 1)                   // wait until the SPI finishes sending
   {                                   // the EWSR command to the flash
   }
   SPIF = 0;

   NSSMD0 = 1;                         // allow the command to execute

   NSSMD0 = 0;                         // enable the flash

   // send the write status register command and clear the BP bits
   SPI0DAT = WRSR;                     // load the XMIT register
   while (TXBMT != 1)                  // wait until the XMIT register can
   {                                   // accept more data
   }
   SPI0DAT = 0x00;                     // set the block protection bits to 0
   while (TXBMT != 1)                  // wait until the data is moved into
   {                                   // the XMIT buffer
   }
   SPIF = 0;
   while (SPIF != 1)                   // wait until the SPI finishes sending
   {                                   // the data to the flash
   }
   SPIF = 0;

   NSSMD0 = 1;                         // allow the command to execute
}

//-----------------------------------------------------------------------------
// Write_MEM
//-----------------------------------------------------------------------------
//
// Return Value : None
// Parameters   :
//   1)  long address - address in the 512 kB external SST Flash
//                      range is postive values up to 2^19: 0 to 524287,
//                           or, 0 to 0x7FFFF
//   2)  char data_byte - the data to be written to memory
//                      range is positive range of character: 0 to 255
//
// Write one byte of data to a 24-bit address in the SST Flash Memory using
// the SPI.
//
void Write_MEM (unsigned long address, unsigned char data_byte)
{
   ADDRESS temp_addr;
   temp_addr.ULong = address;

   NSSMD0 = 0;                         // enable the flash

   // send the write enable command
   SPI0DAT = WREN;                     // load the XMIT register
   while (TXBMT != 1)                  // wait until the command is moved into
   {                                   // the XMIT buffer
   }
   SPIF = 0;
   while (SPIF != 1)                   // wait until the command reaches the
   {                                   // flash
   }
   SPIF = 0;

   NSSMD0 = 1;                         // allow the WREN to execute

   NSSMD0 = 0;                         // enable the flash

   // send the byte-program command
   SPI0DAT = BPROG;                    // load the XMIT register
   while (TXBMT != 1)                  // wait until the command is moved into
   {                                   // the XMIT buffer
   }
   SPI0DAT = temp_addr.UByte[1];       // load the high byte of the address
   while (TXBMT != 1)                  // wait until the addr is moved into
   {                                   // the XMIT buffer
   }
   SPI0DAT = temp_addr.UByte[2];       // load the middle byte of the address
   while (TXBMT != 1)                  // wait until the addr is moved into
   {                                   // the XMIT buffer
   }
   SPI0DAT = temp_addr.UByte[3];       // load the low byte of the address
   while (TXBMT != 1)                  // wait until the addr is moved into
   {                                   // the XMIT buffer
   }
   SPI0DAT = data_byte;                // load the byte of data
   while (TXBMT != 1)                  // wait until the data is moved into
   {                                   // the XMIT buffer
   }
   SPIF = 0;
   while (SPIF != 1)                   // wait until the last byte of the
   {                                   // write instruction reaches the flash
   }
   SPIF = 0;

   NSSMD0 = 1;                         // allow the WR instruction to execute
}

//-----------------------------------------------------------------------------
// Read_MEM
//-----------------------------------------------------------------------------
//
// Return Value :
//   1)  char data_byte - the data byte read from memory
//                      range is positive range of character: 0 to 255
// Parameters   :
//   1)  long address - address in the 512 kB external SST Flash
//                      range is postive values up to 2^19: 0 to 524287,
//                           or, 0 to 0x7FFFF
//
// Read one byte of data from a 24-bit address in the SST Flash Memory using
// the SPI.
//
unsigned char Read_MEM (unsigned long address)
{
   ADDRESS temp_addr;
   temp_addr.ULong = address;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费久久精品视频| 国产精品护士白丝一区av| 色综合久久综合网97色综合| 精品一区二区成人精品| 另类调教123区| 久久国产精品99精品国产 | 国产精品99久久久久久久女警 | 欧美精品一区在线观看| 精品国产123| 欧美国产日韩a欧美在线观看| 26uuu精品一区二区在线观看| 久久久久国色av免费看影院| 久久久久久电影| 国产精品入口麻豆原神| 最新高清无码专区| 亚洲精品免费播放| 视频在线观看一区二区三区| 免费久久99精品国产| 国产一区二区三区久久久| 成人一区二区三区视频在线观看| 成人综合在线视频| 欧美吞精做爰啪啪高潮| 欧美一二三四区在线| 国产日产精品1区| 亚洲精品欧美综合四区| 亚洲一二三专区| 久久国产日韩欧美精品| 成人av在线一区二区| 欧美系列日韩一区| 久久精品欧美一区二区三区不卡 | 亚洲国产精品久久人人爱| 日本亚洲三级在线| 国产精品白丝jk白祙喷水网站| 99久久综合国产精品| 欧美情侣在线播放| 国产色综合久久| 亚洲国产一区二区视频| 国产精品99久久久久久似苏梦涵 | 日产国产欧美视频一区精品| 国产一区二区三区av电影| 97se狠狠狠综合亚洲狠狠| 91精品国产综合久久久久| 国产日本欧洲亚洲| 亚洲成a天堂v人片| 成人妖精视频yjsp地址| 欧美顶级少妇做爰| 中文字幕一区二区三区精华液 | 国产精品三级电影| 五月天欧美精品| 波多野结衣亚洲一区| 91精品国产色综合久久久蜜香臀| 国产亚洲视频系列| 日韩激情视频在线观看| 91色乱码一区二区三区| 国产三级一区二区| 另类中文字幕网| 欧美日韩久久久| 国产精品久久久久婷婷二区次| 日韩精品一二三四| 欧美日精品一区视频| 中文字幕一区二区三区不卡在线| 国产乱码精品一品二品| 日韩一级片在线播放| 亚洲综合一区在线| 91浏览器打开| 国产欧美日韩在线视频| 精品在线亚洲视频| 欧美精品一二三| 午夜国产不卡在线观看视频| 91久久人澡人人添人人爽欧美| 国产精品无码永久免费888| 精品亚洲免费视频| 精品久久久网站| 毛片不卡一区二区| 欧美xxxxx裸体时装秀| 午夜精品福利在线| 91麻豆精品国产| 午夜不卡av在线| 欧美日韩一区高清| 男女视频一区二区| 日韩精品一区在线| 久久国产精品99久久人人澡| 日韩欧美一区中文| 激情综合色综合久久| 国产视频一区二区在线| 不卡一二三区首页| 亚洲自拍偷拍综合| 91精品久久久久久蜜臀| 久久99精品久久久| 中文字幕欧美日本乱码一线二线 | 国产精品国产自产拍高清av| 成人理论电影网| 一区二区三区精品视频在线| 欧美综合亚洲图片综合区| 天堂影院一区二区| 精品国产乱码久久久久久牛牛| 国内偷窥港台综合视频在线播放| 久久综合色一综合色88| 国产麻豆一精品一av一免费| 亚洲欧洲性图库| 欧美三级中文字| 韩国v欧美v亚洲v日本v| 日本一区二区动态图| 在线免费观看日本一区| 欧美aⅴ一区二区三区视频| 国产午夜亚洲精品羞羞网站| 91视频精品在这里| 日韩福利视频网| 国产精品日韩精品欧美在线| 91国产丝袜在线播放| 美女脱光内衣内裤视频久久网站| 中文字幕av一区二区三区免费看 | 蜜桃精品视频在线| 亚洲国产高清在线| 欧美猛男男办公室激情| 国产精品资源网站| 亚洲成人激情综合网| 久久久久国产免费免费| 欧美性猛片aaaaaaa做受| 国产自产高清不卡| 亚洲国产精品久久人人爱蜜臀| 国产亚洲女人久久久久毛片| 欧美日韩在线不卡| 成人国产精品免费网站| 麻豆91精品视频| 亚洲综合另类小说| 亚洲国产精品黑人久久久| 精品久久久久久久久久久久久久久| 91网页版在线| 国产九色sp调教91| 毛片av一区二区| 亚洲va韩国va欧美va精品| 亚洲色图另类专区| 欧美激情中文字幕| 精品理论电影在线观看| 欧美日韩国产电影| 在线日韩国产精品| 91麻豆自制传媒国产之光| 国产成人精品免费一区二区| 美腿丝袜亚洲综合| 日日欢夜夜爽一区| 亚洲国产日韩综合久久精品| 日韩伦理免费电影| 国产精品乱码久久久久久| 精品欧美一区二区在线观看| 欧美日韩国产精品成人| 欧美视频三区在线播放| 91成人在线精品| 91久久精品一区二区三区| 93久久精品日日躁夜夜躁欧美| 国产a久久麻豆| 成人午夜大片免费观看| 成人不卡免费av| 成人a区在线观看| 91在线看国产| 在线一区二区三区做爰视频网站| 97精品超碰一区二区三区| 91视频在线观看| 欧美午夜电影在线播放| 欧美日韩不卡在线| 91精品在线免费| 日韩欧美在线网站| 久久夜色精品一区| 国产婷婷色一区二区三区| 国产欧美在线观看一区| 久久久国产午夜精品| 国产精品视频线看| 亚洲欧美激情一区二区| 亚洲午夜精品在线| 美女国产一区二区| 激情综合五月天| 91在线视频免费91| 欧美日韩一区二区电影| 8x8x8国产精品| 欧美成人精品二区三区99精品| 成人在线视频首页| 日韩欧美123| 欧美成人一区二区三区| 26uuu国产电影一区二区| 国产日本欧美一区二区| 亚洲日本va午夜在线影院| 久久成人精品无人区| 国产成人亚洲精品狼色在线| 97久久精品人人澡人人爽| 欧美三日本三级三级在线播放| 日韩一区二区三区四区| 国产精品美女一区二区三区| 亚洲一区二区三区三| 美国一区二区三区在线播放| 国产成人午夜精品5599| 在线观看不卡一区| 日韩美女一区二区三区四区| 国产精品女人毛片| 五月天精品一区二区三区| 国产乱码精品一品二品| 欧美理论片在线| 国产精品久久久久桃色tv| 日本美女一区二区| 一本到高清视频免费精品| 久久五月婷婷丁香社区|