Versão limpa em 04/09/2014. Telnet funcionando.

Dependencies:   EthernetInterface mbed-rtos mbed NTPClient

Committer:
rebonatto
Date:
Thu Jan 14 17:26:05 2016 +0000
Revision:
40:b87bbdb97ac7
Child:
42:d6f9ce115eaf
Commit inicial mesmo.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rebonatto 40:b87bbdb97ac7 1 /*
rebonatto 40:b87bbdb97ac7 2 * capture.h
rebonatto 40:b87bbdb97ac7 3 *
rebonatto 40:b87bbdb97ac7 4 * Created on:
rebonatto 40:b87bbdb97ac7 5 * Author:
rebonatto 40:b87bbdb97ac7 6 */
rebonatto 40:b87bbdb97ac7 7
rebonatto 40:b87bbdb97ac7 8 #ifndef CAPTURE_H
rebonatto 40:b87bbdb97ac7 9 #define CAPTURE_H
rebonatto 40:b87bbdb97ac7 10
rebonatto 40:b87bbdb97ac7 11 #include <stdio.h>
rebonatto 40:b87bbdb97ac7 12 #include <string.h>
rebonatto 40:b87bbdb97ac7 13 #include <math.h>
rebonatto 40:b87bbdb97ac7 14
rebonatto 40:b87bbdb97ac7 15 #include "mbed.h"
rebonatto 40:b87bbdb97ac7 16 #include "rtos.h"
rebonatto 40:b87bbdb97ac7 17 #include "dma.h"
rebonatto 40:b87bbdb97ac7 18 #include "adc.h"
rebonatto 40:b87bbdb97ac7 19
rebonatto 40:b87bbdb97ac7 20 #include "Settings.h"
rebonatto 40:b87bbdb97ac7 21
rebonatto 40:b87bbdb97ac7 22 // MTR: Estes defines nao deveriam estar no arquivo de configuraçeos?
rebonatto 40:b87bbdb97ac7 23 //#define SAMPLE_RATE 256U
rebonatto 40:b87bbdb97ac7 24
rebonatto 40:b87bbdb97ac7 25
rebonatto 40:b87bbdb97ac7 26 class Capture
rebonatto 40:b87bbdb97ac7 27 {
rebonatto 40:b87bbdb97ac7 28
rebonatto 40:b87bbdb97ac7 29 protected:
rebonatto 40:b87bbdb97ac7 30
rebonatto 40:b87bbdb97ac7 31 static Semaphore m_CaptureSemaphore; //used to alert the capture thread about a ready capture
rebonatto 40:b87bbdb97ac7 32 static int m_BufferIndex;
rebonatto 40:b87bbdb97ac7 33
rebonatto 40:b87bbdb97ac7 34 static dmaLinkedListNode m_Nodes[2]; //this list holds the buffer configuration for the DMA peripheral
rebonatto 40:b87bbdb97ac7 35 public:
rebonatto 40:b87bbdb97ac7 36 static unsigned short int m_AdcBuffers[2][NUMBER_OF_SAMPLES][NUMBER_OF_CHANNELS];
rebonatto 40:b87bbdb97ac7 37
rebonatto 40:b87bbdb97ac7 38 public:
rebonatto 40:b87bbdb97ac7 39
rebonatto 40:b87bbdb97ac7 40 static unsigned short int GetValue(int nsamples, int nchannel);
rebonatto 40:b87bbdb97ac7 41 static void CopyBuffer(int channel, unsigned short int *dest);
rebonatto 40:b87bbdb97ac7 42 static void CopyBufferSigned(int channel, short int *dest);
rebonatto 40:b87bbdb97ac7 43 static void CopyBufferFloat(int channel, float *dest);
rebonatto 40:b87bbdb97ac7 44
rebonatto 40:b87bbdb97ac7 45 static void ISRHandler();
rebonatto 40:b87bbdb97ac7 46
rebonatto 40:b87bbdb97ac7 47 static void Initialize();
rebonatto 40:b87bbdb97ac7 48 static void Start();
rebonatto 40:b87bbdb97ac7 49 static void Stop();
rebonatto 40:b87bbdb97ac7 50 static void Wait();
rebonatto 40:b87bbdb97ac7 51
rebonatto 40:b87bbdb97ac7 52 static void ReadRFID(int channel,char *rfid);
rebonatto 40:b87bbdb97ac7 53
rebonatto 40:b87bbdb97ac7 54 };
rebonatto 40:b87bbdb97ac7 55
rebonatto 40:b87bbdb97ac7 56 #endif