Basic Native CMSIS Register Access Documentation 1.0
The Common Microcontroller Software Interface Standard (CMSIS) simplifies microcontroller software development, providing a consistent and efficient interface for developers working with Cortex-M and entry-level Cortex-A processors. It promotes code reuse, portability, and interoperability, enabling developers to focus on application-level logic rather than dealing with low-level hardware details.
Loading...
Searching...
No Matches
Exported_macro
Collaboration diagram for Exported_macro:

Macros

#define SET_BIT(REG, BIT)   ((REG) |= (BIT))
 
#define CLEAR_BIT(REG, BIT)   ((REG) &= ~(BIT))
 
#define READ_BIT(REG, BIT)   ((REG) & (BIT))
 
#define CLEAR_REG(REG)   ((REG) = (0x0))
 
#define WRITE_REG(REG, VAL)   ((REG) = (VAL))
 
#define READ_REG(REG)   ((REG))
 
#define MODIFY_REG(REG, CLEARMASK, SETMASK)   WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
 
#define POSITION_VAL(VAL)   (__CLZ(__RBIT(VAL)))
 
#define ATOMIC_SET_BIT(REG, BIT)
 
#define ATOMIC_CLEAR_BIT(REG, BIT)
 
#define ATOMIC_MODIFY_REG(REG, CLEARMSK, SETMASK)
 
#define ATOMIC_SETH_BIT(REG, BIT)
 
#define ATOMIC_CLEARH_BIT(REG, BIT)
 
#define ATOMIC_MODIFYH_REG(REG, CLEARMSK, SETMASK)
 

Detailed Description

Macro Definition Documentation

◆ ATOMIC_CLEAR_BIT

#define ATOMIC_CLEAR_BIT (   REG,
  BIT 
)

#include <stm32f7xx.h>

Value:
do { \
uint32_t val; \
do { \
val = __LDREXW((__IO uint32_t *)&(REG)) & ~(BIT); \
} while ((__STREXW(val,(__IO uint32_t *)&(REG))) != 0U); \
} while(0)
#define __IO
Definition core_cm7.h:254

◆ ATOMIC_CLEARH_BIT

#define ATOMIC_CLEARH_BIT (   REG,
  BIT 
)

#include <stm32f7xx.h>

Value:
do { \
uint16_t val; \
do { \
val = __LDREXH((__IO uint16_t *)&(REG)) & ~(BIT); \
} while ((__STREXH(val,(__IO uint16_t *)&(REG))) != 0U); \
} while(0)

◆ ATOMIC_MODIFY_REG

#define ATOMIC_MODIFY_REG (   REG,
  CLEARMSK,
  SETMASK 
)

#include <stm32f7xx.h>

Value:
do { \
uint32_t val; \
do { \
val = (__LDREXW((__IO uint32_t *)&(REG)) & ~(CLEARMSK)) | (SETMASK); \
} while ((__STREXW(val,(__IO uint32_t *)&(REG))) != 0U); \
} while(0)

◆ ATOMIC_MODIFYH_REG

#define ATOMIC_MODIFYH_REG (   REG,
  CLEARMSK,
  SETMASK 
)

#include <stm32f7xx.h>

Value:
do { \
uint16_t val; \
do { \
val = (__LDREXH((__IO uint16_t *)&(REG)) & ~(CLEARMSK)) | (SETMASK); \
} while ((__STREXH(val,(__IO uint16_t *)&(REG))) != 0U); \
} while(0)

◆ ATOMIC_SET_BIT

#define ATOMIC_SET_BIT (   REG,
  BIT 
)

#include <stm32f7xx.h>

Value:
do { \
uint32_t val; \
do { \
val = __LDREXW((__IO uint32_t *)&(REG)) | (BIT); \
} while ((__STREXW(val,(__IO uint32_t *)&(REG))) != 0U); \
} while(0)

◆ ATOMIC_SETH_BIT

#define ATOMIC_SETH_BIT (   REG,
  BIT 
)

#include <stm32f7xx.h>

Value:
do { \
uint16_t val; \
do { \
val = __LDREXH((__IO uint16_t *)&(REG)) | (BIT); \
} while ((__STREXH(val,(__IO uint16_t *)&(REG))) != 0U); \
} while(0)

◆ CLEAR_BIT

#define CLEAR_BIT (   REG,
  BIT 
)    ((REG) &= ~(BIT))

#include <stm32f7xx.h>

◆ CLEAR_REG

#define CLEAR_REG (   REG)    ((REG) = (0x0))

#include <stm32f7xx.h>

◆ MODIFY_REG

#define MODIFY_REG (   REG,
  CLEARMASK,
  SETMASK 
)    WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))

#include <stm32f7xx.h>

◆ POSITION_VAL

#define POSITION_VAL (   VAL)    (__CLZ(__RBIT(VAL)))

#include <stm32f7xx.h>

◆ READ_BIT

#define READ_BIT (   REG,
  BIT 
)    ((REG) & (BIT))

#include <stm32f7xx.h>

◆ READ_REG

#define READ_REG (   REG)    ((REG))

#include <stm32f7xx.h>

◆ SET_BIT

#define SET_BIT (   REG,
  BIT 
)    ((REG) |= (BIT))

#include <stm32f7xx.h>

◆ WRITE_REG

#define WRITE_REG (   REG,
  VAL 
)    ((REG) = (VAL))

#include <stm32f7xx.h>