+/EE445L
embedded systems
git clone https://git.julia.blue/+/EE445L
99480b6
master
1// ------------------------------------------------------------------- 2// File name: esp8266.c 3// Description: This starter code is used to bridge the TM4C123 board 4// and the Blynk Application via the ESP8266. 5// 6// Authors: Mark McDermott 7// Converted to EE445L style Jonathan Valvano 8// Date: May 21, 2018 9// Last update: Sept 19, 2018 10// 11// 12// 13 14#ifndef _ESP8266H_ 15#define _ESP8266H_ 16#include <stdint.h> 17// comment out either/both to remove debugging 18#define DEBUG1 // UART0 Debug output 19#define DEBUG3 // ST7735 Debug output 20 21// Initialize PE5,4,3,1,0 for interface to ESP8266 22// Uses interrupt driven UART5 on PE5,4 23// Uses simple GPIO output on PE3,1,0 24void ESP8266_Init (void ); 25 26void ESP8266_Reset (void ); 27 28// ---------------------------------------------------------------------- 29// This routine sets up the Wifi connection between the TM4C and the 30// hotspot. Enable the DEBUG flags if you want to watch the transactions. 31void ESP8266_SetupWiFi (void ); 32 33 34 35// remove a message from front of index FIFO 36// datapt points to an empty data buffer of MESSAGESIZE character 37// if successful a message is copied from the FIFO into data buffer 38// return FIFOSUCCESS if successful 39// return FIFOFAIL if the FIFO is empty (no messages) 40int ESP8266_GetMessage (char * datapt ); 41 42 43 44// output ASCII character to UART5, interrupt driven 45// spin if Tx5Fifo is full 46void ESP8266_OutChar (char data ); 47 48//------------ESP8266_OutString------------ 49// Output String (NULL termination) 50// interrupt-driven, spin on Tx5Fifo full 51// Input: pointer to a NULL-terminated string to be transferred 52// Output: none 53void ESP8266_OutString (char * pt ); 54 55//-----------------------ESP8266_OutUDec----------------------- 56// Output a 32-bit number in unsigned decimal format 57// Input: 32-bit number to be transferred 58// Output: none 59// Variable format 1-10 digits with no space before or after 60void ESP8266_OutUDec (uint32_t n ); 61 62#endif 63 64 65