RTEMS  5.1
Macros
SoCAL Memory Read/Write Utilities

Macros

#define alt_write_byte(dest, src)   (*ALT_CAST(volatile uint8_t *, (dest)) = (src))
 
#define alt_read_byte(src)   (*ALT_CAST(volatile uint8_t *, (src)))
 
#define alt_write_hword(dest, src)   (*ALT_CAST(volatile uint16_t *, (dest)) = (src))
 
#define alt_read_hword(src)   (*ALT_CAST(volatile uint16_t *, (src)))
 
#define alt_write_word(dest, src)   (*ALT_CAST(volatile uint32_t *, (dest)) = (src))
 
#define alt_read_word(src)   (*ALT_CAST(volatile uint32_t *, (src)))
 
#define alt_write_dword(dest, src)   (*ALT_CAST(volatile uint64_t *, (dest)) = (src))
 
#define alt_read_dword(src)   (*ALT_CAST(volatile uint64_t *, (src)))
 

Detailed Description

This section implements read and write functionality for various memory untis. The memory unit terms used for these functions are consistent with those used in the ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition manual. The terms used for units of memory are:

Unit of Memory Abbreviation Size in Bits
Byte byte 8
Half Word hword 16
Word word 32
Double Word dword 64

Macro Definition Documentation

◆ alt_read_byte

#define alt_read_byte (   src)    (*ALT_CAST(volatile uint8_t *, (src)))

Read and return the 8 bit byte from the source address in device memory.

Parameters
srcRead source pointer address
Returns
8 bit data byte value

◆ alt_read_dword

#define alt_read_dword (   src)    (*ALT_CAST(volatile uint64_t *, (src)))

Read and return the 64 bit double word from the source address in device memory.

Parameters
srcRead source pointer address
Returns
64 bit data double word value

◆ alt_read_hword

#define alt_read_hword (   src)    (*ALT_CAST(volatile uint16_t *, (src)))

Read and return the 16 bit half word from the source address in device memory.

Parameters
srcRead source pointer address
Returns
16 bit data half word value

◆ alt_read_word

#define alt_read_word (   src)    (*ALT_CAST(volatile uint32_t *, (src)))

Read and return the 32 bit word from the source address in device memory.

Parameters
srcRead source pointer address
Returns
32 bit data word value

◆ alt_write_byte

#define alt_write_byte (   dest,
  src 
)    (*ALT_CAST(volatile uint8_t *, (dest)) = (src))

Write the 8 bit byte to the destination address in device memory.

Parameters
dest- Write destination pointer address
src- 8 bit data byte to write to memory

◆ alt_write_dword

#define alt_write_dword (   dest,
  src 
)    (*ALT_CAST(volatile uint64_t *, (dest)) = (src))

Write the 64 bit double word to the destination address in device memory.

Parameters
dest- Write destination pointer address
src- 64 bit data double word to write to memory

◆ alt_write_hword

#define alt_write_hword (   dest,
  src 
)    (*ALT_CAST(volatile uint16_t *, (dest)) = (src))

Write the 16 bit half word to the destination address in device memory.

Parameters
dest- Write destination pointer address
src- 16 bit data half word to write to memory

◆ alt_write_word

#define alt_write_word (   dest,
  src 
)    (*ALT_CAST(volatile uint32_t *, (dest)) = (src))

Write the 32 bit word to the destination address in device memory.

Parameters
dest- Write destination pointer address
src- 32 bit data word to write to memory