Versão sem FFT e aquisição por DMA. 256 amostras.

Dependencies:   EthernetInterface NTPClient mbed-rtos mbed

Committer:
rebonatto
Date:
Tue Jan 05 11:45:44 2016 +0000
Revision:
0:e57bc370d339
Vers?o est?vel sem calculo de FFT. Aquisi??o por DMA. Usa 256 amostras.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rebonatto 0:e57bc370d339 1 #include "mbed.h"
rebonatto 0:e57bc370d339 2 #include "rtos.h"
rebonatto 0:e57bc370d339 3
rebonatto 0:e57bc370d339 4 #include "EthernetInterface.h"
rebonatto 0:e57bc370d339 5
rebonatto 0:e57bc370d339 6
rebonatto 0:e57bc370d339 7 static UDPSocket server;
rebonatto 0:e57bc370d339 8 static Endpoint client;
rebonatto 0:e57bc370d339 9
rebonatto 0:e57bc370d339 10 static int estado;
rebonatto 0:e57bc370d339 11
rebonatto 0:e57bc370d339 12 static int blockcnt, dupcnt; // block counter, and DUP counter
rebonatto 0:e57bc370d339 13 static FILE* fp; // current file to read or write
rebonatto 0:e57bc370d339 14 static char sendbuff[516]; // current DATA block;
rebonatto 0:e57bc370d339 15 static int blocksize; // last DATA block size while sending
rebonatto 0:e57bc370d339 16 static char filename[256]; // current (or most recent) filename
rebonatto 0:e57bc370d339 17
rebonatto 0:e57bc370d339 18 class tftpsrv
rebonatto 0:e57bc370d339 19 {
rebonatto 0:e57bc370d339 20
rebonatto 0:e57bc370d339 21 #define ESCUTANDO 0
rebonatto 0:e57bc370d339 22 #define LENDO 1
rebonatto 0:e57bc370d339 23 #define ESCREVENDO 2
rebonatto 0:e57bc370d339 24 #define ERRO 3
rebonatto 0:e57bc370d339 25
rebonatto 0:e57bc370d339 26 protected:
rebonatto 0:e57bc370d339 27
rebonatto 0:e57bc370d339 28 static void tftpInicia();
rebonatto 0:e57bc370d339 29 static void tftpPara();
rebonatto 0:e57bc370d339 30 static void tftpReinicia();
rebonatto 0:e57bc370d339 31 static void tftpAck(int val);
rebonatto 0:e57bc370d339 32 static void tftpErr(char* msg);
rebonatto 0:e57bc370d339 33 static int tftpModo(char* buff);
rebonatto 0:e57bc370d339 34 static void tftpGetBlock();
rebonatto 0:e57bc370d339 35 static void tftpSendBlock();
rebonatto 0:e57bc370d339 36 static void tftpLer(char* buff);
rebonatto 0:e57bc370d339 37 static void tftpEscrever(char* buff);
rebonatto 0:e57bc370d339 38 static void tftpEscutando(char* buff);
rebonatto 0:e57bc370d339 39 static void tftpLendo(char *buff);
rebonatto 0:e57bc370d339 40 static void tftpEscrevendo(int tam, char *buff);
rebonatto 0:e57bc370d339 41 static void tftpVai();
rebonatto 0:e57bc370d339 42
rebonatto 0:e57bc370d339 43 public:
rebonatto 0:e57bc370d339 44
rebonatto 0:e57bc370d339 45 static void tftpsrv_Thread(void const* arg);
rebonatto 0:e57bc370d339 46
rebonatto 0:e57bc370d339 47 };