Module unit_tests

Source
Expand description

Unit tests

This module provides unit tests for the PWM driver.

To run the tests, add the following line before loading processes:

rp2040::pwm::unit_tests::run::(&peripherals.pwm);

Compile and flash the kernel on the board. Then, connect to UART on GPIOs 1 and 2. If everything goes right, the following output should be displayed:

Testing ChannelNumber enum...
ChannelNumber enum OK
Testing ChannelPin enum...
ChannelPin enum OK
Testing PWM struct...
Starting testing channel 1...
Channel 1 works!
Starting testing channel 2...
Channel 2 works!
Starting testing channel 3...
Channel 3 works!
Starting testing channel 4...
Channel 4 works!
Starting testing channel 5...
Channel 5 works!
Starting testing channel 6...
Channel 6 works!
Starting testing channel 7...
Channel 7 works!
PWM struct OK
Testing PwmPinStruct...
PwmPin struct OK
Testing PWM HIL trait...
PWM HIL trait OK

Functions§

run
Run all unit tests