Home

Bitfield / Register Viewer

Inspect a register bit by bit, toggle / set / clear, and emit HEX plus C macros.

Register
Click the cells to set, clear or flip individual bits and watch HEX, BIN, decimal and the two's-complement reading update; name your fields and export C macros.
bit 31
bit 23
bit 15
bit 7

Left to right runs from the most significant bit down; click a cell to flip that bit.

HEX
00 00 23 01
BIN
0000 0000 0000 0000 0010 0011 0000 0001
DEC
8961
Signed
8961

The top bit (bit 32) is 0, so as a 32-bit two's-complement value this is non-negative.

Fields
Give a name and a bit range (MSB : LSB); the extracted value shows up as you type.
1 (0x1)
C macros
Paste straight into a header; absolute masks are used, so no shift arithmetic is needed.
/* EmbedKit · 32 位寄存器 */
#define RCC_CFGR_VALUE   0x00002301u

/* 字段 */
#define RCC_CFGR_PLLM_Pos   0u
#define RCC_CFGR_PLLM_Msk   0x0000003Fu
#define RCC_CFGR_PLLM_Val   0x00000001u
Notes

All bit twiddling happens locally with BigInt; the width only affects display and truncation.

HEX, BIN and decimal are the unsigned view; the signed row reads it as a 32-bit two's-complement value.

Everything is computed locally in your browser — nothing is uploaded.