Steven Kay / SerialComms
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SerialComms.h Source File

SerialComms.h

00001 /* #####################################################################
00002                             SerialComms.h
00003                             -------------
00004                 
00005                           Surface Ship, Group 5
00006                           ---------------------
00007  
00008  Written by:        Steven Kay
00009  
00010  Date:              February 2016
00011  
00012  Function:          This 
00013  
00014  Version:           1.0
00015  
00016  Version History
00017  ---------------
00018  
00019  1.1                rgdfgdfgdfggdfgdg
00020  
00021  1.0                gdgddfdddgd
00022     
00023  ##################################################################### */
00024 
00025 #ifndef SERIAL_COMMS_H
00026 #define SERIAL_COMMS_H
00027 
00028 #define SERIAL_BAUD_RATE 115200
00029 
00030 #define TRUE 1
00031 #define FALSE 0
00032 
00033 #define MOTORS_FORWARD      0x09
00034 #define MOTORS_BACKWARD     0x06
00035 #define MOTORS_LEFT         0x05      
00036 #define MOTORS_RIGHT        0x0A
00037 #define MOTORS_ARM          0x01
00038 #define MOTORS_OFF          0x00
00039 
00040 #define MAGNET_ON           0x0D
00041 #define MAGNET_OFF          0x0E
00042 
00043 class SerialComms
00044 {
00045     
00046 public:   
00047     SerialComms(PinName tx,PinName rx);
00048     uint8_t getCommData();
00049 
00050 private: 
00051     bool incomingDataUpdate;
00052     uint8_t receiverBuffer;
00053     
00054     void incomingDataISR();
00055 
00056 protected:   
00057     RawSerial *_HLC_Conn;
00058     
00059 
00060    
00061 };
00062 
00063 #endif