Knud Dalgaard / 310-TMC3-TestHW

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers pwm.h Source File

pwm.h

00001 #include "mbed.h"
00002 
00003 
00004 
00005 //---------------------------------------
00006 // Definitions
00007 //---------------------------------------
00008 #define PWM_INIT_FREQ   ( 1000 )
00009 #define PWM_FREQ_MIN    ( 1 )
00010 #define PWM_FREQ_MAX    ( 5000 )
00011 #define PWM_DC_MAX      ( 100 )
00012 
00013 
00014 
00015 //---------------------------------------
00016 // Enums
00017 //---------------------------------------
00018 
00019 typedef enum
00020 {
00021     PWM_CH0,
00022     PWM_CH1,
00023     PWM_CH2,
00024     PWM_CH3,
00025     PWM_CH4,
00026     PWM_CH5,
00027     //-------------------
00028     CNT_ePWM_channel
00029 }ePWM_channel;
00030 
00031 
00032 
00033 
00034 //---------------------------------------
00035 // Structures
00036 //---------------------------------------
00037 
00038 
00039 
00040 //---------------------------------------
00041 // Global Variables
00042 //---------------------------------------
00043 
00044 
00045 
00046 //---------------------------------------
00047 // Global Functions
00048 //---------------------------------------
00049 void PWM_init( void );
00050 int PWM_updateFreq( unsigned int freq_Hz );
00051 int PWM_setDC( int channel, int dutyCycle );