Funzioni di IO varie con seriale asincrona

Dependents:   Nucleo_AsyncSerialIO

Fork of IOFuncLib by Max Scordamaglia

Committer:
MaxScorda
Date:
Thu Jul 16 20:34:25 2015 +0000
Revision:
10:b6c09ee246cc
Parent:
9:a9b3a88c25d1
New char2string function

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MaxScorda 0:f401aa69861a 1 #ifndef IOFUNCLIB_H
MaxScorda 0:f401aa69861a 2 #define IOFUNCLIB_H
MaxScorda 3:6c6446382bb2 3 #include <string>
MaxScorda 10:b6c09ee246cc 4 #include <sstream>
MaxScorda 1:58f3784ad68e 5
MaxScorda 0:f401aa69861a 6 #include "mbed.h"
MaxScorda 1:58f3784ad68e 7
MaxScorda 1:58f3784ad68e 8 class Flasher
MaxScorda 1:58f3784ad68e 9 {
MaxScorda 0:f401aa69861a 10 public:
MaxScorda 0:f401aa69861a 11 Flasher(PinName pin);
MaxScorda 0:f401aa69861a 12 void flash(int n);
MaxScorda 0:f401aa69861a 13 void onOff(bool n);
MaxScorda 9:a9b3a88c25d1 14 void notPin(void);
MaxScorda 1:58f3784ad68e 15
MaxScorda 1:58f3784ad68e 16 private:
MaxScorda 0:f401aa69861a 17 DigitalOut _pin;
MaxScorda 0:f401aa69861a 18 };
MaxScorda 1:58f3784ad68e 19
MaxScorda 1:58f3784ad68e 20
MaxScorda 1:58f3784ad68e 21 class Screen
MaxScorda 1:58f3784ad68e 22 {
MaxScorda 1:58f3784ad68e 23 public:
MaxScorda 1:58f3784ad68e 24 Screen(Serial* ps);
MaxScorda 1:58f3784ad68e 25 void banner();
MaxScorda 1:58f3784ad68e 26 void pressed();
MaxScorda 2:8e723d99838e 27 //vettore schermo
MaxScorda 2:8e723d99838e 28 void commitScreen();
MaxScorda 2:8e723d99838e 29 void emptyFrame();
MaxScorda 2:8e723d99838e 30 void clearScreen(char upperx, char uppery, char loverx, char lowery);
MaxScorda 4:eae942db86db 31 void writeScreen(char sstr[], char xx, char yy, int padb=0);
MaxScorda 2:8e723d99838e 32
MaxScorda 1:58f3784ad68e 33 private:
MaxScorda 1:58f3784ad68e 34 /**
MaxScorda 1:58f3784ad68e 35 * Receive bytes from the serial port and store it into the receive queue.
MaxScorda 1:58f3784ad68e 36 */
MaxScorda 1:58f3784ad68e 37 Serial* _ps;
MaxScorda 2:8e723d99838e 38 // vettore schermo
MaxScorda 2:8e723d99838e 39 char svec[80][24] ;
MaxScorda 1:58f3784ad68e 40 };
MaxScorda 1:58f3784ad68e 41
MaxScorda 3:6c6446382bb2 42 class genFunctions
MaxScorda 3:6c6446382bb2 43 {
MaxScorda 3:6c6446382bb2 44 public:
MaxScorda 3:6c6446382bb2 45 //genFunctions();
MaxScorda 4:eae942db86db 46 char* subchar(char* arr, int begin, int len);
MaxScorda 4:eae942db86db 47 string padstr(string sttde, int maxlen, char fillchar);
MaxScorda 3:6c6446382bb2 48 string addEOS(string sttde) ;
MaxScorda 3:6c6446382bb2 49 string subEOS(string sttde) ;
MaxScorda 3:6c6446382bb2 50 char* string2char(string sttde);
MaxScorda 10:b6c09ee246cc 51 string char2string(char sttde);
MaxScorda 5:0dd768073f59 52 int constrain(int amt, int low, int high);
MaxScorda 5:0dd768073f59 53 int min(int a, int b);
MaxScorda 5:0dd768073f59 54 int max(int a, int b);
MaxScorda 5:0dd768073f59 55 int abs(int x);
MaxScorda 5:0dd768073f59 56
MaxScorda 3:6c6446382bb2 57 private:
MaxScorda 3:6c6446382bb2 58 };
MaxScorda 3:6c6446382bb2 59
MaxScorda 0:f401aa69861a 60 #endif