See graph

Dependencies:   MCP23017 SDFileSystem WattBob_TextLCD mbed

Fork of Embedded_Software_Assignment_2 by Steven Kay

Tasks.h

Committer:
sk398
Date:
2016-02-17
Revision:
3:c611b9bb5770
Parent:
2:22ebabd78084
Child:
4:b85bc0d810e1

File content as of revision 3:c611b9bb5770:

/* ###############################################################################
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
############################################################################### */

#ifndef _TASKS_H_
#define _TASKS_H_

// Global definitions
#define HIGH 1
#define LOW 0

#define TRUE 1
#define FALSE 0

// Task 1 definitions
#define WATCHDOG_PULSE_WIDTH 15

// Task 2 definitions

// Task 3 definitions

// Task 4 definitions
#define NUM_ANALOG_SAMPLES 4

// Task 5 definitions

// Task 6 definitions


/* ####################### Class definitions and prototypes ####################### */

/* ==================================== Task 1 ==================================== */
// Measure freuqnecy
class Task1
{
public:
    Task1(PinName squareWaveInPin);
    int MeasureFreq();
        
private:
    DigitalIn *_squareWaveIn;
        
};


/* ==================================== Task 2 ==================================== */ 
// Digital Input
class Task2
{
public:
    Task2(PinName digitalInCheckPin);
    bool digitalInState();
    
private:
    DigitalIn *_digitalInCheck;
        
};


/* ==================================== Task 3 ==================================== */ 
// Output watchdog pulse
class Task3
{
public:
    Task3(PinName WatchdogPin);
    void OutputWatchdogPulse();
        
private:
    DigitalOut *_Watchdog;    
};


/* ==================================== Task 4 ==================================== */ 
// Read 2 analog inputs 
class Task4
{
public:
    Task4(PinName Analog1Pin,PinName Analog2Pin);
    float *returnAnalogReadings();
    
private:
    AnalogIn *_AnalogIn1;
    AnalogIn *_AnalogIn2;        
};

//
///* ==================================== Task 5 ==================================== */
//// Display outputs to LCD
//class Task5
//{
//public:
//    Task5();
//        
//private:
//    
//        
//};
//
///* ==================================== Task 6 ==================================== */
//// Logical checks
//class Task6
//{
//public:
//    Task5();
//        
//private:
//    
//        
//};
//
///* ==================================== Task 7 ==================================== */
//// Save data to SD Card
//class Task7
//{
//public:
//    Task7();
//        
//private:
//    
//        
//};

#endif