OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 4719|回复: 6

请教正点原子,关于__IO的用法

[复制链接]

11

主题

34

帖子

0

精华

初级会员

Rank: 2

积分
98
金钱
98
注册时间
2014-3-27
在线时间
0 小时
发表于 2014-5-11 11:37:45 | 显示全部楼层 |阅读模式
5金钱
个人初学者,实在不懂为什么有些数据结构的域要加__IO比如这个
[mw_shl_code=c,true]typedef struct { __IO uint8_t CSDStruct; /*!< CSD structure */ __IO uint8_t SysSpecVersion; /*!< System specification version */ __IO uint8_t Reserved1; /*!< Reserved */ __IO uint8_t TAAC; /*!< Data read access-time 1 */ __IO uint8_t NSAC; /*!< Data read access-time 2 in CLK cycles */ __IO uint8_t MaxBusClkFrec; /*!< Max. bus clock frequency */ __IO uint16_t CardComdClasses; /*!< Card command classes */ __IO uint8_t RdBlockLen; /*!< Max. read data block length */ __IO uint8_t PartBlockRead; /*!< Partial blocks for read allowed */ __IO uint8_t WrBlockMisalign; /*!< Write block misalignment */ __IO uint8_t RdBlockMisalign; /*!< Read block misalignment */ __IO uint8_t DSRImpl; /*!< DSR implemented */ __IO uint8_t Reserved2; /*!< Reserved */ __IO uint32_t DeviceSize; /*!< Device Size */ __IO uint8_t MaxRdCurrentVDDMin; /*!< Max. read current @ VDD min */ __IO uint8_t MaxRdCurrentVDDMax; /*!< Max. read current @ VDD max */ __IO uint8_t MaxWrCurrentVDDMin; /*!< Max. write current @ VDD min */ __IO uint8_t MaxWrCurrentVDDMax; /*!< Max. write current @ VDD max */ __IO uint8_t DeviceSizeMul; /*!< Device size multiplier */ __IO uint8_t EraseGrSize; /*!< Erase group size */ __IO uint8_t EraseGrMul; /*!< Erase group size multiplier */ __IO uint8_t WrProtectGrSize; /*!< Write protect group size */ __IO uint8_t WrProtectGrEnable; /*!< Write protect group enable */ __IO uint8_t ManDeflECC; /*!< Manufacturer default ECC */ __IO uint8_t WrSpeedFact; /*!< Write speed factor */ __IO uint8_t MaxWrBlockLen; /*!< Max. write data block length */ __IO uint8_t WriteBlockPaPartial; /*!< Partial blocks for write allowed */ __IO uint8_t Reserved3; /*!< Reserded */ __IO uint8_t ContentProtectAppli; /*!< Content protection application */ __IO uint8_t FileFormatGrouop; /*!< File format group */ __IO uint8_t CopyFlag; /*!< Copy flag (OTP) */ __IO uint8_t PermWrProtect; /*!< Permanent write protection */ __IO uint8_t TempWrProtect; /*!< Temporary write protection */ __IO uint8_t FileFormat; /*!< File Format */ __IO uint8_t ECC; /*!< ECC code */ __IO uint8_t CSD_CRC; /*!< CSD CRC */ __IO uint8_t Reserved4; /*!< always 1*/ } SD_CSD; /** * @brief Card Identification Data: CID Register */ typedef struct { __IO uint8_t ManufacturerID; /*!< ManufacturerID */ __IO uint16_t OEM_AppliID; /*!< OEM/Application ID */ __IO uint32_t ProdName1; /*!< Product Name part1 */ __IO uint8_t ProdName2; /*!< Product Name part2*/ __IO uint8_t ProdRev; /*!< Product Revision */ __IO uint32_t ProdSN; /*!< Product Serial Number */ __IO uint8_t Reserved1; /*!< Reserved1 */ __IO uint16_t ManufactDate; /*!< Manufacturing Date */ __IO uint8_t CID_CRC; /*!< CID CRC */ __IO uint8_t Reserved2; /*!< always 1 */ } SD_CID;[/mw_shl_code]
为什么它们前面都加了关键字__IO

最佳答案

查看完整内容[请看2#楼]

__IO是为了易于理解,原型就是一个volatile修饰符。
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

28

主题

1489

帖子

0

精华

论坛大神

Rank: 7Rank: 7Rank: 7

积分
1656
金钱
1656
注册时间
2013-7-24
在线时间
1 小时
发表于 2014-5-11 11:37:46 | 显示全部楼层
__IO是为了易于理解,原型就是一个volatile修饰符。
于20150522停用该账号:http://www.microstar.club
回复

使用道具 举报

120

主题

7878

帖子

13

精华

资深版主

Rank: 8Rank: 8

积分
12012
金钱
12012
注册时间
2013-9-10
在线时间
427 小时
发表于 2014-5-11 12:19:24 | 显示全部楼层
可读写操作,其实你goto一下就知道怎么回事了
现在,程序把烂铜烂铁变得智能化了,人呢,一旦离开了这烂铜烂铁就不知道干啥了
回复

使用道具 举报

11

主题

34

帖子

0

精华

初级会员

Rank: 2

积分
98
金钱
98
注册时间
2014-3-27
在线时间
0 小时
 楼主| 发表于 2014-5-11 12:39:35 | 显示全部楼层
回复【2楼】Badu_Space:
---------------------------------
goto一下确实是一个关键字volatile,好像这个跟移植有关
回复

使用道具 举报

120

主题

7878

帖子

13

精华

资深版主

Rank: 8Rank: 8

积分
12012
金钱
12012
注册时间
2013-9-10
在线时间
427 小时
发表于 2014-5-11 12:49:02 | 显示全部楼层
结合百度就明白了
现在,程序把烂铜烂铁变得智能化了,人呢,一旦离开了这烂铜烂铁就不知道干啥了
回复

使用道具 举报

11

主题

34

帖子

0

精华

初级会员

Rank: 2

积分
98
金钱
98
注册时间
2014-3-27
在线时间
0 小时
 楼主| 发表于 2014-5-11 14:07:08 | 显示全部楼层
嗯嗯,我看看
回复

使用道具 举报

1

主题

14

帖子

0

精华

初级会员

Rank: 2

积分
110
金钱
110
注册时间
2018-10-4
在线时间
22 小时
发表于 2018-10-17 09:41:34 | 显示全部楼层
谢谢 理解了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-6-20 20:32

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表