Lets you control the FRDM-K64F board over the PC using the GUI software (https://github.com/navin-bhaskar/Controller) written in Python. To use the software, connect the FRDM-K64Fto your PC (via USB cable connected to USB port labelled as "open SDA") and start the software to control the FRDM-K64F. For more info on usage, please go to: http://navinbhaskar.blogspot.in/2013/02/arduino-controller-3.html

Dependencies:   mbed

Committer:
Navin
Date:
Fri Aug 08 02:27:42 2014 +0000
Revision:
0:7ce46d3f9f5d
This application lets you control the FRDM-K64F Frdm board with a front end GUI software written in Python (https://github.com/navin-bhaskar/Controller)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Navin 0:7ce46d3f9f5d 1 /*
Navin 0:7ce46d3f9f5d 2 * This program is free software; you can redistribute it and/or modify
Navin 0:7ce46d3f9f5d 3 * it under the terms of the GNU General Public License as published by
Navin 0:7ce46d3f9f5d 4 * the Free Software Foundation; either version 2 of the License, or
Navin 0:7ce46d3f9f5d 5 * (at your option) any later version.
Navin 0:7ce46d3f9f5d 6 *
Navin 0:7ce46d3f9f5d 7 * This program is distributed in the hope that it will be useful,
Navin 0:7ce46d3f9f5d 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Navin 0:7ce46d3f9f5d 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Navin 0:7ce46d3f9f5d 10 * GNU General Public License for more details.
Navin 0:7ce46d3f9f5d 11 *
Navin 0:7ce46d3f9f5d 12 * You should have received a copy of the GNU General Public License
Navin 0:7ce46d3f9f5d 13 * along with this program; if not, write to the Free Software
Navin 0:7ce46d3f9f5d 14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
Navin 0:7ce46d3f9f5d 15 * MA 02110-1301, USA.
Navin 0:7ce46d3f9f5d 16 *
Navin 0:7ce46d3f9f5d 17 */
Navin 0:7ce46d3f9f5d 18
Navin 0:7ce46d3f9f5d 19 /**
Navin 0:7ce46d3f9f5d 20 * \brief This file contains functions defines and definations
Navin 0:7ce46d3f9f5d 21 * required by trans_layer.c
Navin 0:7ce46d3f9f5d 22 * \author Navin Bhaskar
Navin 0:7ce46d3f9f5d 23 */
Navin 0:7ce46d3f9f5d 24
Navin 0:7ce46d3f9f5d 25
Navin 0:7ce46d3f9f5d 26 #ifndef __TRANS_LAYER_H
Navin 0:7ce46d3f9f5d 27 #define __TRANS_LAYER_H
Navin 0:7ce46d3f9f5d 28
Navin 0:7ce46d3f9f5d 29 #include <stdlib.h>
Navin 0:7ce46d3f9f5d 30 #include "Console.h"
Navin 0:7ce46d3f9f5d 31 #include "PerAccess.h"
Navin 0:7ce46d3f9f5d 32
Navin 0:7ce46d3f9f5d 33
Navin 0:7ce46d3f9f5d 34 typedef void(* call_back_ptr)(Console * cons, PerAccess * per, char*, int ); /**< typedef for callback function pointer for protocol packets*/
Navin 0:7ce46d3f9f5d 35
Navin 0:7ce46d3f9f5d 36 typedef struct service_list* service_ptr; /**< pointer to next service */
Navin 0:7ce46d3f9f5d 37
Navin 0:7ce46d3f9f5d 38 struct service_list /**< Struct for holding service list */
Navin 0:7ce46d3f9f5d 39 {
Navin 0:7ce46d3f9f5d 40 //char* service_name; /**< pointer to the name of the service */
Navin 0:7ce46d3f9f5d 41 call_back_ptr service_function; /**< call back function pointer */
Navin 0:7ce46d3f9f5d 42 char service_flag; /**< Packet service flag for which this service responds*/
Navin 0:7ce46d3f9f5d 43 service_ptr next_service;
Navin 0:7ce46d3f9f5d 44 };
Navin 0:7ce46d3f9f5d 45
Navin 0:7ce46d3f9f5d 46
Navin 0:7ce46d3f9f5d 47 #define PACKET_START 'S' /**< Start of packet indicator */
Navin 0:7ce46d3f9f5d 48 #define QUERY_ADC_DATA 'A' /**< Control pcaket for quering ADC data */
Navin 0:7ce46d3f9f5d 49 #define SET_LCD_DATA 'L' /**< To transmit string to be displayed on LCD */
Navin 0:7ce46d3f9f5d 50 #define PACKET_ACK 'V' /**< Acknowledgement flag */
Navin 0:7ce46d3f9f5d 51 #define PACKET_NACK 'N' /**< Negative acknowledgement */
Navin 0:7ce46d3f9f5d 52 #define PACKET_DAT 'D' /**< Data follows after length field */
Navin 0:7ce46d3f9f5d 53 #define PACKET_CMD 'C' /**< Command follows this field */
Navin 0:7ce46d3f9f5d 54
Navin 0:7ce46d3f9f5d 55 #define PIN_OP 'P' /**< Flag indicating pin operations */
Navin 0:7ce46d3f9f5d 56
Navin 0:7ce46d3f9f5d 57 class TransLayer
Navin 0:7ce46d3f9f5d 58 {
Navin 0:7ce46d3f9f5d 59 private:
Navin 0:7ce46d3f9f5d 60 service_ptr _head, _tail;
Navin 0:7ce46d3f9f5d 61 public:
Navin 0:7ce46d3f9f5d 62 TransLayer();
Navin 0:7ce46d3f9f5d 63 int AddService(call_back_ptr, char flag);
Navin 0:7ce46d3f9f5d 64 void MainLoop(Console *, PerAccess *);
Navin 0:7ce46d3f9f5d 65 service_ptr LookForService(char flag);
Navin 0:7ce46d3f9f5d 66 };
Navin 0:7ce46d3f9f5d 67
Navin 0:7ce46d3f9f5d 68 #define PRINT_OK Serial.println(" OK"); /**< A framing method */
Navin 0:7ce46d3f9f5d 69
Navin 0:7ce46d3f9f5d 70 #endif
Navin 0:7ce46d3f9f5d 71