# PM Demo

## Overview

This sample validates the user-space power-management (`PM`) interfaces. It supports querying and configuring items such as the governor, profile, thermal-protection threshold, clocks, and power switches.

## Source Location

- `src/rtsmart/examples/mpp/sample_pm`

## Build Method

Enable the following options in `make menuconfig`:

- `RT-Smart UserSpace Examples Configuration`
- `Enable MPP examples`
- `Enable Build sample_pm`

Then rebuild the firmware.

## Run Example

```bash
cd /sdcard/app/examples/mpp
./sample_pm.elf
```

The program prints help text:

```text
Usage: sample_pm func_index [opt]
```

### Common Examples

```bash
# Query the governor of domain 0
./sample_pm.elf 5 0

# Set domain 0 governor to 1 (PERFORMANCE)
./sample_pm.elf 4 0 1

# Query the profile of domain 0
./sample_pm.elf 7 0
```

### Expected Result

The program prints the current PM configuration or applies the requested setting and then returns the execution result.
