#include <stdio.h>
#include <stdint.h>
#define BASE_ADDRESS 0x80000000
#define FLASH_SIZE 0x1000000
volatile uint16_t *nor_flash = (volatile uint16_t *)BASE_ADDRESS;
void nor_flash_write_word(uint32_t address, uint16_t data) {
nor_flash[address >> 1] = data;
}
uint16_t nor_flash_read_word(uint32_t address) {
return nor_flash[address >> 1];
}
void nor_flash_erase_sector(uint32_t address) {
nor_flash[address >> 1] = 0x30;
nor_flash[address >> 1] = 0xD0;
}
int main() {
uint32_t address = BASE_ADDRESS;
uint16_t data = 0xABCD;
// 写入数据到 NOR Flash
nor_flash_write_word(address, data);
printf("Data 0x%04X written to address 0x%08X\n", data, address);
S3C2440 NOR Flash编程指南
最新推荐文章于 2024-11-14 08:46:29 发布
本文提供S3C2440 NOR Flash编程示例,包括写入、读取和扇区擦除操作。通过定义函数执行相应操作,并在示例中展示如何使用这些函数进行实际操作,提醒读者在实际应用中需参照具体芯片规格和数据手册进行调整。
摘要由CSDN通过智能技术生成