protegemed, aquisição via A/D simples utilizando interrupção do timer

Dependencies:   EthernetInterface NTPClient mbed-rtos mbed

Fork of ptgm_semDMA by Marcelo Rebonatto

Headers/Capture.h

Committer:
viniciushl
Date:
2016-01-13
Revision:
1:8129536051df
Parent:
0:fac116e94d44

File content as of revision 1:8129536051df:

/*
 * capture.h
 *
 *  Created on: 
 *      Author: 
 */

#ifndef CAPTURE_H
#define CAPTURE_H

#include <stdio.h>
#include <string.h>
#include <math.h>

#include "mbed.h"
#include "rtos.h"
#include "dma.h"
#include "adc.h"

#include "Settings.h"

#define CHANNEL0         p15
#define CHANNEL1         p16
#define CHANNEL2         p17
#define CHANNEL3         p18
#define CHANNEL4         p19
#define CHANNEL5         p20

class Capture
{
    
protected:
    
    //static Semaphore m_CaptureSemaphore; //used to alert the capture thread about a ready capture 
    //static int m_BufferIndex;
    static bool flag_capture;
    static int cnt_buffer;
    static int channel_number;  
    static int cnt_interrupt;


    //static dmaLinkedListNode m_Nodes[2]; //this list holds the buffer configuration for the DMA peripheral
public:
    static short int m_AdcBuffers[NUMBER_OF_CHANNELS][NUMBER_OF_SAMPLES];
  
    // matrix m_AdcBuffers[6][128]
    
public:
    
    static short int GetValue(int nsamples, int nchannel);
    static void      PutValue(int nsamples, int nchannel, short int value);
    static void      CopyBuffer(int channel, short int *dest);    
    //static void CopyBufferFloat(int channel, float *dest);

    //static void ISRHandler();

    //static void Initialize();
    static void AcquireValues();
    static void InitializeAD();
    
    //static void Start();
    //static void Stop();
    //static void Wait();   
    
    static void ReadRFID(int channel,char *rfid);
    
    static void FcnTimerInt(void);
    //static void AdInitialize();

};

#endif