BeRTOS
|
Test for PWM driver (implementation) More...
#include "hw/pwm_map.h"
#include "cfg/cfg_pwm.h"
#include <cfg/macros.h>
#include <cfg/debug.h>
#include <cfg/log.h>
#include <cpu/types.h>
#include <cpu/irq.h>
#include <drv/pwm.h>
#include <PP_STRINGIZE(drv/PP_CAT3(pwm, _, CPU_ID).h)>
Go to the source code of this file.
Test for PWM driver (implementation)
This is a simple test for PWM driver. This module is target independent, so you can test all target that BeRTOS support. To use this test you should include a pwm_map.h header where are defined the PWM channels for your target. Then you should add or remove a test setting in pwm_test_cfg array, and edit a value for your specific test. Afther this, all is ready and you can test PWM driver.
The test check first if all PWM channel starts, and then try to change a PWM duty cicle for all channel. The change of duty cycle is operate when a PWM channel is enable, in this way you can see if a pwm signal is clean and work properly. The duty value is change incrementaly, and when it arrive to 100% or 0%, we reset the duty value and restart the test. Further the duty test, we check also a PWM polarity, infact when we reach a reset duty value, we invert a polary of PWM wavform. So you can see if the hardware manage correctly this situation.
Note: To be simple and target independently we not use a timer module, and so the delay is do with a for cycle.
Definition in file pwm_hwtest.c.