Mmio and Bit Manipulation

MMIO and register access skill for bare-metal firmware. Use when accessing memory-mapped peripherals with volatile, bit masks, RMW patterns, or endianness concerns. Activates on queries about MMIO, volatile register, bit manipulation, read-modify-write, or register alignment.

293 stars 36 forksWriting & Content

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add mohitmishra786/low-level-dev-skills --skill mmio-and-bit-manipulation
Manual install
git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills.git /tmp/low-level-dev-skills
mkdir -p ~/.claude/skills
cp -r /tmp/low-level-dev-skills/skills/baremetal/mmio-and-bit-manipulation ~/.claude/skills/mmio-and-bit-manipulation

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# MMIO and Bit Manipulation

## Purpose

Guide agents through safe memory-mapped I/O: `volatile` semantics, read-modify-write patterns, bitfield pitfalls, alignment and endianness, and portable register access macros for bare-metal drivers.

## When to Use

- Writing peripheral register drivers without HAL
- Fixing intermittent register corruption or stale reads
- Replacing C bitfields with explicit masks
- Porting drivers between little-endian MCUs
- Auditing ISR vs main-line register access

## Workflow

### 1. MMIO fundamentals

Peripheral registers live at fixed addresses in the CPU memory map. The compiler must not cache reads/writes.

```c
#include <stdint.h>

#define PERIPH_BASE   0x40000000U
#define GPIOA_MODER   (*(volatile uint32_t *)(PERIPH_BASE + 0x20000U))
```

| Qualifier | Effect |
|-----------|--------|
| `volatile` | Forces load/store each access — required for hardware |
| `const volatile` | Read-only hardware (rare) |
| Plain `uint32_t *` | **Wrong** — compiler may optimize away |

### 2. Read-modify-write macros

```c
#define REG32(addr)        (*(volatile uint32_t *)(addr))
#define REG_SET(addr, mask)   (REG32(addr) |= (mask))
#define REG_CLR(addr, mask)   (REG32(addr) &= ~(mask))
#define REG_TOGGLE(addr, mask) (REG32(addr) ^= (mask))
#define REG_WRITE(addr, val)  (REG32(addr) = (val))
#define REG_READ(addr)        (REG32(addr))
```

**Good** — atomic intent for single-bit updates when register supports it:
Read the full skill on GitHub

Details

Skill name
mmio-and-bit-manipulation
Path
skills/baremetal/mmio-and-bit-manipulation/SKILL.md
License
MIT
Repo updated
14 November 2026

FAQ

What does the Mmio and Bit Manipulation skill do?

MMIO and register access skill for bare-metal firmware. Use when accessing memory-mapped peripherals with volatile, bit masks, RMW patterns, or endianness concerns. Activates on queries about MMIO, volatile register, bit manipulation, read-modify-write, or register alignment.

How do I install the Mmio and Bit Manipulation skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add mohitmishra786/low-level-dev-skills --skill mmio-and-bit-manipulation. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Mmio and Bit Manipulation popular?

It lives in mohitmishra786/low-level-dev-skills, which has 293 GitHub stars and 36 forks.

Related skills

Abi and Calling Conventions

293

mohitmishra786/low-level-dev-skills

ABI and calling conventions skill for cross-language boundaries. Use when explaining System V AMD64, ARM AAPCS, RISC-V psABI, stack frames, variadic calls, or FFI register rules. Activates on queries about calling convention, ABI, System V AMD64, AAPCS, stack frame, variadic function, or FFI registers.

Software Development36

Adc Dac Baremetal

293

mohitmishra786/low-level-dev-skills

Bare-metal ADC and DAC skill. Use when configuring analog sampling, DMA-driven ADC, calibration, or DAC output on MCUs. Activates on queries about ADC bare-metal, sampling time, DMA ADC, or DAC channel setup.

Other36

Af Xdp

293

mohitmishra786/low-level-dev-skills

AF_XDP skill for high-performance XDP sockets. Use when creating AF_XDP sockets, configuring UMEM and XSK rings, XDP_REDIRECT programs, copy vs zero-copy mode, or comparing with DPDK. Activates on queries about AF_XDP, xsk_umem, XDP_REDIRECT, libbpf xsk, or zero-copy XDP.

Software Development36

Os Dev Scratch

293

mohitmishra786/low-level-dev-skills

OS development from scratch skill for bootloader through context switching. Use when building a minimal x86-64 OS, setting up GDT/IDT/page tables, writing keyboard/serial drivers, or using QEMU for kernel boot. Activates on queries about bootloader, long mode, page tables, IDT, PIC/APIC, xv6, or x86_64-elf-gcc.

Writing & Content36

Mlir

293

mohitmishra786/low-level-dev-skills

MLIR skill for multi-level intermediate representation. Use when writing custom dialects, defining ops with ODS, writing lowering passes, running mlir-opt, or building ML compilers with Torch-MLIR/IREE. Activates on queries about MLIR, dialect, ODS, mlir-opt, linalg, lowering pass, or Torch-MLIR.

Writing & Content36

Peripherals From Datasheet

293

mohitmishra786/low-level-dev-skills

Peripheral driver methodology skill from MCU reference manuals. Use when reading register maps, timing diagrams, and writing drivers from vendor documentation. Activates on queries about reference manual, register map, peripheral init sequence, or datasheet-driven driver design.

Writing & Content36

Browse the most popular Claude skills, all writing & content skills, or write your own with the skills generator.