2021-10-06 09:24:09 +00:00
|
|
|
#ifndef _STM32_H_
|
|
|
|
#define _STM32_H_
|
|
|
|
|
|
|
|
/* modify bitfield */
|
2022-01-05 16:10:18 +00:00
|
|
|
#define _BMD(reg, msk, val) (reg) = (((reg) & ~(msk)) | (val))
|
2021-10-06 09:24:09 +00:00
|
|
|
/* set bitfield */
|
2022-01-05 16:10:18 +00:00
|
|
|
#define _BST(reg, bits) (reg) = ((reg) | (bits))
|
2021-10-06 09:24:09 +00:00
|
|
|
/* clear bitfield */
|
2022-01-05 16:10:18 +00:00
|
|
|
#define _BCL(reg, bits) (reg) = ((reg) & ~(bits))
|
2021-10-06 09:24:09 +00:00
|
|
|
/* wait until bitfield set */
|
2022-01-05 16:10:18 +00:00
|
|
|
#define _WBS(reg, bits) while(((reg) & (bits)) == 0)
|
2021-10-06 09:24:09 +00:00
|
|
|
/* wait until bitfield clear */
|
2022-01-05 16:10:18 +00:00
|
|
|
#define _WBC(reg, bits) while(((reg) & (bits)) != 0)
|
2021-10-06 09:24:09 +00:00
|
|
|
/* wait for bitfield value */
|
2022-01-05 16:10:18 +00:00
|
|
|
#define _WVL(reg, msk, val) while(((reg) & (msk)) != (val))
|
2021-10-06 09:24:09 +00:00
|
|
|
/* bit value */
|
2022-01-05 16:10:18 +00:00
|
|
|
#define _BV(bit) (0x01 << (bit))
|
2021-10-06 09:24:09 +00:00
|
|
|
|
2022-08-22 17:06:17 +00:00
|
|
|
#include "stm32wbxx.h"
|
2021-10-06 09:24:09 +00:00
|
|
|
|
|
|
|
#endif // _STM32_H_
|