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

LTC1298/ltc1298.hpp

Committer:
mkelly10
Date:
2018-06-04
Revision:
51:c5c40272ecc3
Parent:
10:085ab7328054
Child:
73:f6f378311c8d

File content as of revision 51:c5c40272ecc3:

#ifndef MBED_LTC1298_H
#define MBED_LTC1298_H
#include "mbed.h"

#define CH0OVERSAMPLE 10
#define CH1OVERSAMPLE 10
#define CH2OVERSAMPLE 10
#define CH3OVERSAMPLE 10
#define CH4OVERSAMPLE 10
#define CH5OVERSAMPLE 10
#define CH6OVERSAMPLE 10
#define CH7OVERSAMPLE 10

class SpiADC{
public:
    SpiADC(PinName mosi, PinName miso, PinName sclk, PinName csel, PinName led);
    void initialize();
    void update();
    void start();
    void stop();
    
    int readCh0();
    int readCh1();
    int readCh2();
    int readCh3();
    int readCh4();
    int readCh5();
    int readCh6();
    int readCh7();
    
protected:
    SPI _spi;
    Ticker interval;
    DigitalOut adcLed;
    DigitalOut cs;

    int ch0_raw;
    int ch1_raw;
    int ch2_raw;
    int ch3_raw;
    int ch4_raw;
    int ch5_raw;
    int ch6_raw;
    int ch7_raw;
    
    int ch0_filt;
    int ch1_filt;
    int ch2_filt;
    int ch3_filt;
    int ch4_filt;
    int ch5_filt;
    int ch6_filt;
    int ch7_filt;
};



#endif