Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>McuBitsNew to Visual Studio Code? Get it now.
McuBits

McuBits

EG

|
39 installs
| (0) | Free
MCU Bitfield Compositor
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

MCU Bit Compositor


Prerequisites

Your Brain and some MCU Resource Manuals ;-)

Usage

It's usable for all C-Language Files (*.c , *.h , *.cpp , *.s etc.)
entering 0x. will open an Input Field on Top - You may enter some Stuff shown below, typing ENTER will replace '.' by its Number
N1[:N2]=[~]N3 [(comment)][,N1[:N2]=[~]N3 [(comment)][, ]]
N1 is the First Bit-Number (int)0...31
N2 is the Second Bit-Number (int)0...31, OPTIONAL, its possible to interchange N1 & N2
N3 is the Value, can be written as 0xHEX, 0bBIN, \OCT, %BIN, $HEX or INT , if preceeded by '~' the Value will be negated
OPTIONAL You may enter a Comment, enclosed in '(' ')'

SAMPLES

31:0=~0 , 0=0 (Comment for Bit 0) , 31=0 gives ---> 0x7ffffffe /*BITS: 31:0=~0 , 0=0 (Comment for Bit 0) , 31=0 (Comment for Bit 31)*/
4:3=%01 , 5:6=$3 , 0=1h gives ---> 0x69 /*BITS: 4:3=%01 , 5:6=$3 , 0=1h*/
an Error will occur if a Bit-Range is smaller than its given Value: 5:3=1024 is impossible ;-)
if You enter only a Value ( that means without any '=' ) it shows You it's Bit- Layout, entering 0x41 for Example gives You ---> 0x41 /*BITS: 6=1,0=1*/,
or entering \0666 ( rw-rw-rw ;-) gives --> 0x1b6 /*BITS: 8:7=3,5:4=3,2:1=3*/

Others

By default the whole Input will be selected once You type "0x." again, if You dont want that write into settings.json:
"Bits.SelectAllIfNoError" : false
If You dont like the Attention Message in case of Error write into settings.json:
"Bits.ShowAttentionIfError" : false

License

MIT

Any Suggestions ?

Pls let me know ;-) --> eg@okmdetectors.com

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft