Knud Dalgaard / 310-TMC3-TestHW

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ana.h Source File

ana.h

00001 #include "mbed.h"
00002 
00003 
00004 
00005 //---------------------------------------
00006 // Definitions
00007 //---------------------------------------
00008 #define ANA_SW_TIMER_PERIOD     10000   // [us] Period time of call
00009 #define ANA_LP_FILTER_SHIFT_ANA1    3
00010 #define ANA_LP_FILTER_SHIFT_ANA2    3
00011 #define ANA_LP_FILTER_SHIFT_ANA3    3
00012 
00013 
00014 //---------------------------------------
00015 // Enums
00016 //---------------------------------------
00017 
00018 typedef enum
00019 {
00020     ANA_CH1,
00021     ANA_CH2,
00022     ANA_CH3,
00023     //-----------------
00024     CNT_eANA_Channels
00025 }eANA_Channels;
00026 
00027 
00028 //---------------------------------------
00029 // Structures
00030 //---------------------------------------
00031 
00032 
00033 
00034 //---------------------------------------
00035 // Global Variables
00036 //---------------------------------------
00037 
00038 
00039 
00040 //---------------------------------------
00041 // Global Functions
00042 //---------------------------------------
00043 void ANA_init( void );
00044 unsigned short ANA_getRaw(int channel);
00045 unsigned short ANA_getFiltered( int channel );
00046 float ANA_scale(float offset, float gain, unsigned short input);