Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

lib_mem.h

Prototypes

Code Block
LanguageC++
CaptionTextCAPTION
languagecpp
          MEM_VAL_SET_INT08U_BIG(addr);
          MEM_VAL_SET_INT16U_BIG(addr);
          MEM_VAL_SET_INT32U_BIG(addr);
           
          MEM_VAL_SET_INT08U_LITTLE(addr);
          MEM_VAL_SET_INT16U_LITTLE(addr);
          MEM_VAL_SET_INT32U_LITTLE(addr);
           
          MEM_VAL_SET_INT08U(addr);
          MEM_VAL_SET_INT16U(addr);
          MEM_VAL_SET_INT32U(addr);


Arguments

addr

Lowest CPU memory address to encode the data value.

...

MEM_VAL_SET_xxx() macros are not atomic operations and must not be used on any non-static (i.e., volatile) variables, registers, hardware, etc.; without the caller of the macros providing some form of additional protection (e.g. mutual exclusion).

Example Usage

CAPTION
Code Block
LanguageC++
CaptionText
languagecpp
          CPU_INT08U  *pval;
          CPU_INT16U   val;
         


          pval = &SomeAddr;              /* Any CPU address */
          val =  0xABCDu;
          MEM_VAL_SET_INT16U(pval, val);