2.1 KiB
2.1 KiB
Test code
Testing peripherals on the custom RP2350B servo controller PCB.
Commands
Warning
The zephyr sdk has bug in the rp2350 pinctrl file. The
RP2_PINCTRL_GPIO_FUNC_UART_AUXmacro is defind, butRP2_PINCTRL_GPIO_FUNC_UART_ALTmacro is used. A pull request has been made to fix this.
Note
While shell is over USB, the
adc scan_forcommand uses uart. The UART uses spi1 pins, so the spi1 needs to be disabled andextra_uart.overlayneeds to be used.
| Command | Parameters | Description |
|---|---|---|
led set <id> <on|off> |
id: 0-1 |
Set LED state |
led allon |
- | Turn all LEDs ON |
led alloff |
- | Turn all LEDs OFF |
servo set <id> <angle> |
Servo ID, angle in degrees | Set servo angle |
adc read <id> |
ADC channel ID | Read a single ADC channel |
adc read_for <id> <count> |
ADC channel ID, sample count | Read one ADC channel repeatedly |
adc scan |
- | Read all ADC channels once |
adc scan_for <count> |
count ≤ 1024 |
Read all ADC channels repeatedly and log timestamps |
UART Output Formats
| Command | Output Format |
|---|---|
adc scan |
ADC,<channel>,<value> |
adc scan_for |
<sample>,ADC,<channel>,<value>,<timestamp_cycles> |