Then you can simply set the value to 1
for stop or 2
for start.
in essance, that is
bit | hex | binary | decimal |
---|---|---|---|
0 | 0x0001 | 0000 0000 0000 0001 |
1 |
1 | 0x0002 | 0000 0000 0000 0010 |
2 |
The difficulty comes when you need to track actual value and set/clear bits before writing.
The 2nd difficulty is when you need to set multiple bits.
I recommend you make a helper function using this code - probably a good candidate for a link-call or subflow.