完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
//***********************************************************************************************************
// File Function: N76E003 APROM program DATAFLASH as EEPROM way //*********************************************************************************************************** #include "N76E003.h" #include "Common.h" #include "Delay.h" #include "SFR_Macro.h" #include "Function_define.h" #define ADDR_BASE 0x4700 #define FLASH_L_LOW ADDR_BASE+1 #define FLASH_L_HIGH ADDR_BASE+2 #define FLASH_H_LOW ADDR_BASE+3 #define FLASH_H_HIGH ADDR_BASE+4 volatile unsigned char xdata page_buffer[128]; UINT8 Read_APROM_BYTE(UINT16 code *u16_addr) { UINT8 rdata; rdata = *u16_addr>>8; return rdata; } *u16_addr>>8;为什么要右移的? |
|
相关推荐
1个回答
|
|
|
The shift right by 8 bits (>>) is used to obtain the high byte of the data stored in the flash memory. In this specific code, it is used to read the data from the EEPROM (which is emulated using the flash memory of the N76E003 controller), since it is stored in a word (2-byte) format with the high byte stored first followed by the low byte. Therefore, shifting right by 8 bits will get the high byte of the data and shifting left by 8 bits will get the low byte of the data.
|
|
|
|
|
只有小组成员才能发言,加入小组>>
1934 浏览 0 评论
imx6ull 和 lan8742 工作起来不正常, ping 老是丢包
4776 浏览 0 评论
4256 浏览 9 评论
3845 浏览 16 评论
4419 浏览 1 评论
4246浏览 3评论
2405浏览 0评论
3423浏览 0评论
1184浏览 0评论
2873浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-11 08:26 , Processed in 0.779332 second(s), Total 77, Slave 55 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
450