BeRTOS
|
Test for PWM driver (implementation) More...
#include <cfg/cfg_dc_motor.h>
#include <cfg/debug.h>
#include <cfg/log.h>
#include <algo/pid_control.h>
#include <drv/timer.h>
#include <drv/dc_motor.h>
#include <drv/adc.h>
#include <drv/pwm.h>
#include <kern/proc.h>
#include <cpu/irq.h>
#include <verstag.h>
#include <buildrev.h>
Go to the source code of this file.
Functions | |
int | dc_motor_testSetUp (void) |
Test function prototypes. |
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.
HW test for DC Motor.
Definition in file dc_motor_hwtest.c.
int dc_motor_testSetUp | ( | void | ) |
Test function prototypes.
See dc_motor_hwtest.c file.
Definition at line 118 of file dc_motor_hwtest.c.