在嵌入式平台上由 C 中的整数制成的指针 [英] Pointer made from an integer in C on an embedded platform

查看:16
本文介绍了在嵌入式平台上由 C 中的整数制成的指针的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了以下代码行:

    #define ADCA (*(volatile ADC_t*)0x200)

它适用于 AVR 微控制器的嵌入式 C 代码.ADC_t 是一个联合体.

It is for embedded C code for an AVR microcontroller. ADC_t is a union.

我知道 (volatile ADC_t*)0x200 它是一个指向绝对内存地址的指针,但我仍然不太确定第一个 * 是什么意思.

I know that (volatile ADC_t*)0x200 its a pointer to an absolute memory address but I am still not quite sure what the first * means.

推荐答案

第一个 * 取消引用指针.换句话说,ADCA0x200 处内存的内容.

That first * dereferences the pointer. In other words ADCA is the contents of the memory at 0x200.

这篇关于在嵌入式平台上由 C 中的整数制成的指针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆