fuck this

Dependencies:   BMP280

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Serial.h Source File

Serial.h

00001 #ifndef __Serial__
00002 #define __Serial__
00003 /*
00004 *This module handles all serial communications with a PC over USB. 
00005 *Serial code is attached to its own thread and is run when the RX interrupt is triggered.
00006 *The RX interrupt is triggered when someone starts typing in a PC terminal. 
00007 *The Scanf function is then started to capture the input. 
00008 *There are a list of commands that are used with serial:
00009 
00010 * readall
00011 * deleteall
00012 * read <n>
00013 * delete <n>
00014 * setdate <dd><mm><yyyy>
00015 * settime <hh><mm><ss>
00016 * sett <T>
00017 * state <x>
00018 * logging <x>
00019 
00020 */
00021 
00022 #include "mbed.h"
00023 #include "Sampling.h"
00024 #include "Logging.h"
00025 
00026 //Variables
00027 extern int DateTimeVar[3];  //Used for reading date or time from serial
00028 extern bool SerialState;    //Used for toggling sampling
00029 extern char InputBufferText[128];   //Buffer for incoming chars
00030 extern unsigned short InputBufferNum;   //Buffer for incoming numbers
00031 extern unsigned short internalIndex;    //Used for incrementing out sample data
00032 
00033 //Objects
00034 extern Thread SampleThread; 
00035 extern Serial PC;
00036 
00037 //Functions
00038 
00039 void SerialStart(void);
00040 //Initialising  serial interface
00041 
00042 void RXInterruptISR(void);
00043 //Function attached to the RX interrupt, sets SerialThread signal. 
00044 
00045 void SerialCode(void);
00046 //Code that runs in the SerialThread
00047 
00048 
00049 
00050 #endif