메인 콘텐츠로 건너뛰기
Knowledgebase
Home
Renesas Korea

How should I describe in C language to access data of a specific address?

Latest Updated:12/01/2011

Question:

How should I describe in C language to access data of a specific address?

Answer:

Declare the address you want to use (with a volatile declaration) and assign a name.
For example, assume that address 10000H consists of 8-bit data and its name is PORT1.
In this case, declare as:

#define PORT1 *((volatile unsigned char *) 0x10000)

You can access this address by:

PORT1 = 0x5;
Suitable Products
  • 이 기사가 도움이 되셨나요?