Marcelo Rebonatto / Mbed 2 deprecated PM_COPIA

Dependencies:   EthernetInterface mbed-rtos mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Capture.h Source File

Capture.h

00001 /*
00002  * capture.h
00003  *
00004  *  Created on: 
00005  *      Author: 
00006  */
00007 
00008 #ifndef CAPTURE_H
00009 #define CAPTURE_H
00010 
00011 #include <stdio.h>
00012 #include <string.h>
00013 #include <math.h>
00014 
00015 #include "mbed.h"
00016 #include "rtos.h"
00017 #include "dma.h"
00018 #include "adc.h"
00019 
00020 #include "Settings.h"
00021 
00022 // MTR: Estes defines nao deveriam estar no arquivo de configuraçeos?
00023 //#define SAMPLE_RATE         256U
00024 
00025 class Capture
00026 {
00027 protected:
00028 
00029     static Semaphore m_CaptureSemaphore; //used to alert the capture thread about a ready capture 
00030     static int m_BufferIndex;
00031     
00032     static dmaLinkedListNode m_Nodes[2]; //this list holds the buffer configuration for the DMA peripheral
00033 public:
00034     static unsigned short int m_AdcBuffers[2][NUMBER_OF_SAMPLES][NUMBER_OF_CHANNELS];
00035 
00036 public:
00037 
00038     static unsigned short int GetValue(int nsamples, int nchannel);
00039     static void CopyBuffer(int channel, unsigned short int *dest);
00040 
00041     static void ISRHandler();
00042 
00043     static void Initialize();
00044     static void Start();
00045     static void Stop();
00046     static void Wait();
00047 
00048 };
00049 
00050 #endif