digital-power-embedded-c

Generate STM32G4xx embedded C code for digital power control with real-time scheduling.

Updated Apr 27, 2026
One-click install
npx skills add https://github.com/KunYi/Skills --skill digital-power-embedded-c
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: digital-power-embedded-c
Source: https://github.com/KunYi/Skills/tree/main/digital-power-embedded-c
Command: npx skills add https://github.com/KunYi/Skills --skill digital-power-embedded-c

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It helps you produce production-grade embedded C for STM32G4xx digital power systems by enforcing physics-first real-time constraints (ADC/PWM timing, scheduling ownership, and protection priority) instead of generating generic code that may not work on hardware.

Core Features & Use Cases

  • Deterministic real-time design: Prescribes fast-loop/slow-loop/1ms layering with ISR hot-path discipline for cycle-budgeted control.
  • Control algorithm implementation guidance: PI/PR/LPF/NOTCH/IIR 2P2Z/PLL and dq/Clarke/Park transform patterns tailored for embedded execution.
  • Protection and recovery integration: Fault detect/confirm/shutdown/recovery chains with explicit shutdown ownership and integrator reset rules.
  • Hardware acceptance criteria: Every output includes concrete what-to-measure oscilloscope/validation limits to verify behavior.

Quick Start

Use this skill when you need an STM32G4xx-ready C implementation for a PFC/Vienna/DC-DC/LLC/PSFB/inverter control path with MISRA-oriented embedded constraints and explicit ADC-PWM synchronization.

Frequently Asked Questions about digital-power-embedded-c

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement MISRA-compliant STM32G4xx embedded C for digital power control?

To implement MISRA-compliant STM32G4xx embedded C for digital power control, apply physics-first real-time constraints using fast-loop/slow-loop scheduling, deterministic ISR hot-paths, and integrator reset rules to ensure verifiable hardware behavior.

How does ADC and PWM synchronization work in STM32G4xx digital power systems?

ADC and PWM synchronization in STM32G4xx digital power systems works by enforcing strict cycle-budgeted timing, ensuring deterministic ISR hot-path behavior so control algorithms execute precisely within the fast-loop layer after triggering.

What is the best way to structure a protection state machine for a Vienna rectifier in embedded C?

The best way to structure a protection state machine for a Vienna rectifier in embedded C is to use a fault detect, confirm, shutdown, and recovery chain with explicit shutdown ownership to guarantee safe operation.

Can I use this approach to generate PI, PR, and PLL algorithms for grid-tied inverters?

Yes, you can generate PI, PR, and PLL algorithms for grid-tied inverters by applying tailored discrete controller patterns, dq/Clarke/Park transforms, and physics-first constraints suitable for STM32G4xx execution.

Why does my discrete IIR 2P2Z controller fail validation on STM32G4xx hardware?

Your discrete IIR 2P2Z controller might fail validation on STM32G4xx hardware due to incorrect discrete implementation or missing hardware acceptance criteria, requiring explicit oscilloscope measurement limits and deterministic scheduling.

Do I need specific hardware acceptance criteria for LLC or PSFB DC-DC converter code?

Yes, you need specific hardware acceptance criteria for LLC or PSFB DC-DC converter code to verify behavior, including concrete oscilloscope validation limits and what-to-measure parameters to confirm correct execution.