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