pwm_hwtest.c File Reference

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 "drv/PP_CAT3(pwm, _, CPU_ID).h"

Go to the source code of this file.

Data Structures

struct  PwmTest
 Simple struct to store the testing value. More...

Functions

int pwm_testSetup (void)
 Setup all needed to test PWM on AT91.
void NORETURN pwm_testRun (void)
 Test suit for genation of pwm waveform.
int pwm_testTearDown (void)
 End a PWM Test.

Detailed Description

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.

Version:
Id
pwm_hwtest.c 2541 2009-04-17 14:00:57Z batt
Author:
Daniele Basile <asterix@develer.com>

Definition in file pwm_hwtest.c.


Function Documentation

void NORETURN pwm_testRun ( void   ) 

Test suit for genation of pwm waveform.

Test function prototypes.

Definition at line 135 of file pwm_hwtest.c.

int pwm_testSetup ( void   ) 

Setup all needed to test PWM on AT91.

Definition at line 121 of file pwm_hwtest.c.

int pwm_testTearDown ( void   ) 

End a PWM Test.

(Unused)

Definition at line 212 of file pwm_hwtest.c.