most functionality to splashdwon, find neutral and start mission. short timeouts still in code for testing, will adjust to go directly to sit_idle after splashdown

Dependencies:   mbed MODSERIAL FATFileSystem

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ltc1298.hpp Source File

ltc1298.hpp

00001 #ifndef MBED_LTC1298_H
00002 #define MBED_LTC1298_H
00003 #include "mbed.h"
00004 
00005 #define CH0OVERSAMPLE 10
00006 #define CH1OVERSAMPLE 10
00007 #define CH2OVERSAMPLE 10
00008 #define CH3OVERSAMPLE 10
00009 #define CH4OVERSAMPLE 10
00010 #define CH5OVERSAMPLE 10
00011 #define CH6OVERSAMPLE 10
00012 #define CH7OVERSAMPLE 10
00013 
00014 class SpiADC{
00015 public:
00016     SpiADC(PinName mosi, PinName miso, PinName sclk, PinName csel, PinName led);
00017     void initialize();
00018     void update();
00019     void start();
00020     void stop();
00021     
00022     int readCh0();
00023     int readCh1();
00024     int readCh2();
00025     int readCh3();
00026     int readCh4();
00027     int readCh5();
00028     int readCh6();
00029     int readCh7();
00030     
00031     int readRawCh0();
00032     int readRawCh1();
00033     int readRawCh2();
00034     int readRawCh3();
00035     int readRawCh4();
00036     int readRawCh5();
00037     int readRawCh6();
00038     int readRawCh7();
00039     
00040 protected:
00041     SPI _spi;
00042     Ticker interval;
00043     DigitalOut adcLed;
00044     DigitalOut cs;
00045 
00046     int ch0_raw;
00047     int ch1_raw;
00048     int ch2_raw;
00049     int ch3_raw;
00050     int ch4_raw;
00051     int ch5_raw;
00052     int ch6_raw;
00053     int ch7_raw;
00054     
00055     int ch0_filt;
00056     int ch1_filt;
00057     int ch2_filt;
00058     int ch3_filt;
00059     int ch4_filt;
00060     int ch5_filt;
00061     int ch6_filt;
00062     int ch7_filt;
00063 };
00064 
00065 
00066 
00067 #endif