# Motor Controller Project

This is a brushless DC motor controller using STM32F407.

## Build Instructions

Use CMake with arm-none-eabi-gcc toolchain.

## My Custom Rules

- Always use HAL functions, never direct register access
- Use DMA for all SPI transfers
- Never block in ISR handlers

<!-- BEGIN HWCC CONTEXT (auto-generated, do not edit) -->
# Hardware Context — stm32f407-motor

## Target Hardware
- **MCU**: STM32F407

## Peripherals
- **SPI1** (9 registers)
- **TIM1** (19 registers)

## Indexed Documents
| Document | Type | Chip | Chunks |
|----------|------|------|--------|
| STM32F407 | svd | STM32F407 | 2962 |
| hardware notes | documentation | STM32F407 | 1 |
| sample | datasheet | STM32F407 | 5 |

## Hardware Reference

Before writing hardware-related code, read the relevant peripheral context file in `.rag/context/peripherals/` (e.g., `spi1.md`, `tim1.md`). These contain register maps with bit-fields, reset values, and base addresses extracted from SVD files.

Never guess register addresses or bit-field positions. Always verify against the indexed documentation.

> Generated by hwcc v0.1.0 on 2026-03-01 04:40 UTC
<!-- END HWCC CONTEXT -->
