mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-04 02:09:12 +00:00
ffa3996a5e
* clang-format: AllowShortEnumsOnASingleLine: false * clang-format: InsertNewlineAtEOF: true * clang-format: Standard: c++20 * clang-format: AlignConsecutiveBitFields * clang-format: AlignConsecutiveMacros * clang-format: RemoveParentheses: ReturnStatement * clang-format: RemoveSemicolon: true * Restored RemoveParentheses: Leave, retained general changes for it * formatting: fixed logging TAGs * Formatting update for dev Co-authored-by: あく <alleteam@gmail.com>
21 lines
640 B
C
21 lines
640 B
C
#ifndef _STM32_H_
|
|
#define _STM32_H_
|
|
|
|
/* modify bitfield */
|
|
#define _BMD(reg, msk, val) (reg) = (((reg) & ~(msk)) | (val))
|
|
/* set bitfield */
|
|
#define _BST(reg, bits) (reg) = ((reg) | (bits))
|
|
/* clear bitfield */
|
|
#define _BCL(reg, bits) (reg) = ((reg) & ~(bits))
|
|
/* wait until bitfield set */
|
|
#define _WBS(reg, bits) while(((reg) & (bits)) == 0)
|
|
/* wait until bitfield clear */
|
|
#define _WBC(reg, bits) while(((reg) & (bits)) != 0)
|
|
/* wait for bitfield value */
|
|
#define _WVL(reg, msk, val) while(((reg) & (msk)) != (val))
|
|
/* bit value */
|
|
#define _BV(bit) (0x01 << (bit))
|
|
|
|
#include "stm32wbxx.h"
|
|
|
|
#endif // _STM32_H_
|