custom-allocators
Custom allocator skill for memory allocation strategies. Use when implementing pool/slab/arena allocators, tuning…
Bare-metal timer and PWM skill. Use when configuring general-purpose timers for PWM, input capture, or periodic ticks without RTOS. Activates on queries about timer prescaler, PWM duty cycle, input capture, or SysTick bare-metal.
Claude Code
$ npx -y skills add mohitmishra786/low-level-dev-skills --skill timers-pwm-baremetal --agent claude-code
Codex
$ npx skills add mohitmishra786/low-level-dev-skills --skill timers-pwm-baremetal -a codex -y
Cursor
$ npx skills add mohitmishra786/low-level-dev-skills --skill timers-pwm-baremetal -a cursor -y
Gemini CLI
$ npx skills add mohitmishra786/low-level-dev-skills --skill timers-pwm-baremetal -a gemini-cli -y
GitHub Copilot
$ npx skills add mohitmishra786/low-level-dev-skills --skill timers-pwm-baremetal -a github-copilot -y
OpenCode
$ npx skills add mohitmishra786/low-level-dev-skills --skill timers-pwm-baremetal -a opencode -y
Windsurf
$ npx skills add mohitmishra786/low-level-dev-skills --skill timers-pwm-baremetal -a windsurf -y
name: timers-pwm-baremetal description: Bare-metal timer and PWM skill. Use when configuring general-purpose timers for PWM, input capture, or periodic ticks without RTOS. Activates on queries about timer prescaler, PWM duty cycle, input capture, or SysTick bare-metal.
Configure MCU timers for PWM output, input capture, and periodic scheduling: prescaler/ARR setup, compare channels, and SysTick as a simple tick source.
f_pwm = f_timer_clk / ((PSC+1) * (ARR+1)) duty = (CCR / (ARR+1)) * 100%
RCC->APB1ENR |= RCC_APB1ENR_TIM2EN; TIM2->PSC = 83; /* 84MHz / 84 = 1 MHz tick */ TIM2->ARR = 999; /* 1 kHz PWM */ TIM2->CCR1 = 500; /* 50% duty */ TIM2->CCMR1 |= (6U << TIM_CCMR1_OC1M_Pos); /* PWM mode 1 */ TIM2->CCER |= TIM_CCER_CC1E; TIM2->CR1 |= TIM_CR1_CEN;
GPIO: PA0 AF1 TIM2_CH1.
volatile uint32_t tick_ms;
void SysTick_Handler(void) {
tick_ms++;
}
void systick_init(uint32_t hz) {
SysTick_Config(SystemCoreClock / hz);
}Configure channel in `CCMR` as input, set `CCER` polarity, read `CCR` on interrupt when edge captured.
/timers-pwm-baremetal 1 kHz 25% duty PWM on TIM2 channel 1
| Symptom | Cause | Fix | |---------|-------|-----| | Wrong frequency | APB timer clock doubling | Check RM timer clock x2 rule | | No PWM output | CCER/CCMR not enabled | Enable channel output | | Jittery tick | SysTick overridden | One owner for SysTick |
A curated suite of AI agent skills for systems and low-level programming — C/C++, Rust, Zig, GPU, bare-metal firmware, Linux kernel/driver development, computer architecture, compiler internals, HPC, and more.
Custom allocator skill for memory allocation strategies. Use when implementing pool/slab/arena allocators, tuning…
NUMA programming skill for multi-socket memory locality. Use when detecting NUMA topology, binding processes with numactl, using…
AF_XDP skill for high-performance XDP sockets. Use when creating AF_XDP sockets, configuring UMEM and XSK rings, XDP_REDIRECT…
DPDK skill for userspace packet I/O. Use when initializing EAL, configuring PMD drivers, using mbuf pools and rte_ring, setting…
io_uring skill for Linux async I/O. Use when building high-performance servers with liburing, multi-shot operations, provided…
Bare-metal ADC and DAC skill. Use when configuring analog sampling, DMA-driven ADC, calibration, or DAC output on MCUs. Activates…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.