# 10. Board Profiles and Board Manager

## 10.1 Board Profiles

The **BoardProfile** (or **BoardBasic**) is the HAL (Hardware Abstraction Layer) that VectorHaptics uses to drive hardware. Downstream repos provide a board-specific implementation.

**BoardProfile** — Full HAL for multi-channel, RTOS, I2S, NVS, etc.

**BoardBasic** — Minimal HAL for single-channel, non-RTOS use:

```cpp
void init() = 0;
void setOutput(unsigned char pin) = 0;
void delay(unsigned int ms) = 0;
void write(unsigned char val) = 0;
unsigned long micros() = 0;
unsigned long millis() = 0;
```

---

## 10.2 Initialization

Initialize VectorHaptics with the board profile and optional extension modules:

```cpp
// Basic (single-channel)
BoardBasic board;
vh.init(&board);

// Full (multi-channel + extensions)
vh.init(&board, {&channels, &devTools, &receiver, &audioStream});
```

Extension modules are identified by their `IType` and registered automatically:
- `IType::idev_tools` → IDevTools
- `IType::ieffect_receiver` → IEffectReceiver
- `IType::ichannel_list` → IVHChannels
- `IType::ii2s` → II2SoundBus
- `IType::iprimitive_man` → IPrimitiveManager
- `IType::iaudio_streaming` → IAudioStreaming
- `IType::iaudio_streaming_mixer` → IPcmMixer

---

## 10.3 Required BoardProfile Methods

Your board profile must implement:

- **GPIO / PWM:** `init`, `setOutput`, `write`, `writeSinglePin`, `writeDualPin`
- **Timing:** `delay`, `delayMicroseconds`, `yield`, `getTimeMicroseconds`, `millis`
- **RTOS:** `createMutexHandle`, `createQueueHandle`, `createTask`, `createTimerEvents`
- **NVS:** `save`, `read`
- **System:** `restart`

For full details, see [API_REFERENCE.md § Board Abstraction](../API_REFERENCE.md#5-board-abstraction-hal) and [INTEGRATION_GUIDE.md](../INTEGRATION_GUIDE.md).
