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

Dependencies:   EthernetInterface mbed-rtos mbed NTPClient

Committer:
rebonatto
Date:
Fri May 01 21:52:57 2015 +0000
Revision:
32:8b108d8089e8
Parent:
31:647771325538
Child:
37:51fed2a3e009
Retirado valor m?dio e ajustado valores para serem processados em float (FFT).; Tranca ap?s 6 aquisi??es. Conferir no software 120Hz.

Who changed what in which revision?

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