OR1K support
 All Functions Typedefs Groups
Macros
OR1K macros

Macros

#define REG8(add)   *((volatile unsigned char *) (add))
 
#define REG16(add)   *((volatile unsigned short *) (add))
 
#define REG32(add)   *((volatile unsigned long *) (add))
 

Detailed Description

Macro Definition Documentation

#define REG16 (   add)    *((volatile unsigned short *) (add))

Access halfword-sized memory mapped register

Used to access a 16 byte-sized memory mapped register. It avoids usage errors when not defining register addresses volatile and handles casting correctly.

See REG8() for an example.

Parameters
addRegister address
#define REG32 (   add)    *((volatile unsigned long *) (add))

Access word-sized memory mapped register

Used to access a word-sized memory mapped register. It avoids usage errors when not defining register addresses volatile and handles casting correctly.

See REG8() for an example.

Parameters
addRegister address
#define REG8 (   add)    *((volatile unsigned char *) (add))

Access byte-sized memory mapped register

Used to access a byte-sized memory mapped register. It avoids usage errors when not defining register addresses volatile and handles casting correctly.

Example for both read and write:

uint8_t status = REG8(IPBLOCK_STATUS_REG_ADDR);
REG8(IPBLOCK_ENABLE) = 1;
Parameters
addRegister address