📄 buffers.asm
字号:
///////////////////////////////////////////////////////////////////////////////////////
//NAME: buffers.asm (ATMEL SPI Flash)
//DATE: 7/29/05
//PURPOSE: Program the SPI Flash for the ADSP-21369 Ezkit
//
//USAGE: This file contains the buffer declarations for use in this project.
//
////////////////////////////////////////////////////////////////////////////////////////
#include "SPIflash.h"
.global flash_curr_page;
.global sector_base_addr;
.global read_base_addr;
.global read_buffer_addr;
.global read_buffer_length;
.global write_buffer_addr;
.global write_base_addr;
.global write_buffer_length;
.global file_data;
.global file_data_verf;
.global flash_data_out;
.global flash_data_out.end;
.global flash_data_verf;
.global spi_setting;
.global spi_dma_setting;
.global status_register;
.global electronic_signature;
.global curr_command;
.global verf_errors;
.section/dm seg_dmda;
//Buffer to hold the (byte) address to send to the SPI Flash
//Used in bit_reverse_command subroutine and those that call it
.var flash_curr_page;
//Buffer to hold the (byte) address to indicate which sector to erase
//Used in sector_erase
.var sector_base_addr;
//Buffer to hold the (byte) address to indicate where to begin reading from the flash
//Used in read_data_bytes
.var read_base_addr;
//Buffer to hold the (normal word) address of the buffer to store after reading
//Used in read_data_bytes
.var read_buffer_addr;
//Buffer to hold the length (in 32-bit words) of the buffer to store after reading
//Used in read_data_bytes
.var read_buffer_length;
//Buffer to hold the (normal word) address of the buffer to write to the flash
//Used in page_program
.var write_buffer_addr;
//Buffer to hold the (byte) address to indicate where to begin writing to the flash
//Used in page_program
.var write_base_addr;
//Buffer to hold the length (in 32-bit words) of the buffer to send to the flash
//Used in page_program
.var write_buffer_length;
//Buffer initialized with the data to write to the flash
//Used in main.asm
.var file_data[]=FILENAME;
//Buffer to verify that the entire buffer was programmed as expected
//Length is one location more than file_data because the buffer will hold an extra word
//Corresponding to the read command and address.
//Used in main.asm
.var file_data_verf[]=FILENAME,0;
//Temporary buffer used to hold the current page to program to the flash
//First location is Write command + address
//Used in page_program
.var flash_data_out[PAGE_LENGTH+1];
//This protects the data from the possibility of an error occuring.
//When the last byte of the page is odd and the second to last byte of the
//page is even, the least significant bit of the last byte will not get set.
//Sending this word out for each half page sent will ensure that the bit pattern
//will not occur, and will allow the entire page to be programmed as desired.
//The theory behind this word is that a flash can overwrite any 1's that are programmed
//into the memory, and cannot overwrite any 0's that are programmed. Writing this word
//of 1's will not affect the content of the flash.
.var flash_data_out.end = 0xffffffff;
//Temporary buffer used to verify the current page programmed to the flash
//First location corresponds Read command + address
//Used in page_program
.var flash_data_verf[PAGE_LENGTH+1];
//Buffer to hold the desired SPICTL setting
//Used in setup_spi
.var spi_setting;
//Buffer to hold the desired SPIDMAC setting
//Used in setup_spi_dma
.var spi_dma_setting;
//Buffer to hold the current value of the flash's status register on a read
//or the desired value of the flash's status register on a write.
//Used in read_status_register and write_status_register
.var status_register[2] = 0, //dummy location for RX, command word for TX
0; //status location
//Buffer to hold the product ID of the flash
//Used in read_device_id
.var electronic_signature[3] = 0, //dummy locations
0, //Manufacturer ID
0; //Device code
//Buffer to hold the command to send to the flash
//Used in bit_reverse_command
.var curr_command;
//Buffer to hold the number of 32-bit words that don't match what was programmed
//Used in page_program
.var verf_errors=0;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -