mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
64 lines
2.6 KiB
C
64 lines
2.6 KiB
C
/*********************************************************************************************************************
|
||
* COPYRIGHT NOTICE
|
||
* Copyright (c) 2020,<2C><><EFBFBD>ɿƼ<C9BF>
|
||
* All rights reserved.
|
||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>QQȺ<51><C8BA><EFBFBD><EFBFBD>Ⱥ<EFBFBD><C8BA>824575535
|
||
*
|
||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD>Ȩ<EFBFBD><C8A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɿƼ<C9BF><C6BC><EFBFBD><EFBFBD>У<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>;<EFBFBD><CDBE>
|
||
* <20><>ӭ<EFBFBD><D3AD>λʹ<CEBB>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>뱣<EFBFBD><EBB1A3><EFBFBD><EFBFBD><EFBFBD>ɿƼ<C9BF><C6BC>İ<EFBFBD>Ȩ<EFBFBD><C8A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
*
|
||
* @file eeprom(Dflash)
|
||
* @company <09>ɶ<EFBFBD><C9B6><EFBFBD><EFBFBD>ɿƼ<C9BF><C6BC><EFBFBD><EFBFBD><EFBFBD>˾
|
||
* @author <09><><EFBFBD>ɿƼ<C9BF>(QQ3184284598)
|
||
* @version <09>鿴doc<6F><63>version<6F>ļ<EFBFBD> <20>汾˵<E6B1BE><CBB5>
|
||
* @Software ADS v1.2.2
|
||
* @Target core TC264D
|
||
* @Taobao https://seekfree.taobao.com/
|
||
* @date 2020-3-23
|
||
********************************************************************************************************************/
|
||
|
||
#ifndef _zf_eeprom_h
|
||
#define _zf_eeprom_h
|
||
|
||
#include "common.h"
|
||
#include "IfxFlash_cfg.h"
|
||
|
||
|
||
#define EEPROM_BASE_ADDR IFXFLASH_DFLASH_START
|
||
#define EEPROM_SIZE IFXFLASH_DFLASH_SIZE //һ<><D2BB><EFBFBD><EFBFBD>96KB
|
||
#define EEPROM_SECTOR_SIZE (EEPROM_SIZE / IFXFLASH_DFLASH_NUM_LOG_SECTORS)
|
||
#define EEPROM_SECTOR_NUM (IFXFLASH_DFLASH_NUM_LOG_SECTORS) //һ<><D2BB><EFBFBD><EFBFBD>12<31><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
|
||
#define EEPROM_PAGE_SIZE IFXFLASH_DFLASH_PAGE_LENGTH
|
||
#define EEPROM_SECTOR_PAGE_NUM (EEPROM_SECTOR_SIZE/EEPROM_PAGE_SIZE) //ÿ<><C3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1024ҳ
|
||
|
||
|
||
//-------------------------------------------------------------------------------------------------------------------
|
||
// @brief ʹ<>ú궨<C3BA><EAB6A8><EFBFBD><EFBFBD>flash<73><68><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݶ<EFBFBD>ȡ
|
||
// @param sector_num <09><>Ҫд<D2AA><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
// @param page_num <09><>Ҫ<EFBFBD><D2AA>ȡ<EFBFBD><C8A1>ҳ
|
||
// @param type <09><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
// @return <09><><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
// @since v1.0
|
||
// Sample usage: flash_read(0,0,uint32);//<2F><>ȡ0<C8A1><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>0Ҳ<30><D2B2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ϊuint32
|
||
//-------------------------------------------------------------------------------------------------------------------
|
||
#define flash_read(sector_num,page_num,type) (*(type *)((uint32)((EEPROM_BASE_ADDR + (sector_num)*EEPROM_SECTOR_SIZE) + (page_num*8))))
|
||
|
||
//-------------------------------------------------------------------------------------------------------------------
|
||
// @brief <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
// @param float_data <09><>Ҫת<D2AA><D7AA><EFBFBD>ĸ<EFBFBD><C4B8><EFBFBD><EFBFBD><EFBFBD>
|
||
// @return <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
// @since v1.0
|
||
// Sample usage:
|
||
//-------------------------------------------------------------------------------------------------------------------
|
||
#define float_conversion_uint32(float_data) (*(uint32 *)&float_data)
|
||
|
||
|
||
|
||
|
||
uint8 flash_check(uint32 sector_num, uint32 page_num);
|
||
void eeprom_erase_sector(uint32 sector_num);
|
||
void eeprom_page_program(uint32 sector_num, uint32 page_num, uint32 *buf);
|
||
|
||
#endif
|