/* --COPYRIGHT--,BSD
 * Copyright (c) 2015, Texas Instruments Incorporated
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * *  Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * *  Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * *  Neither the name of Texas Instruments Incorporated nor the names of
 *    its contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * --/COPYRIGHT--*/

/*
 * console.h
 *
 *  Created on: 2014-4-21
 *      Author: a0222612
 */

#ifndef ADS1262_TIPD188_CONSOLE_H_
#define ADS1262_TIPD188_CONSOLE_H_

// User Libraries
#include "ADS126x/ADS126x.h"
#include "ADS126x/ac_bridge.h"
#include "ADS126x/adc2_demo.h"
#include "driverlib.h"
#include "hal.h"
#include "USB_API/USB_Common/device.h"
#include "USB_API/USB_Common/types.h"			// Provides backward compatibility with previous versions of the stack
#include "USB_API/USB_Common/usb.h"
#include "USB_API/USB_CDC_API/UsbCdc.h"
#include "USB_app/usbConstructs.h"				// Contains the cdcSendDataWaitTilDone() function used in printConsole()
#include "USB_config/descriptors.h"

// C Standard Libraries
#include <assert.h>								// Contains the assert macro used for debugging
#include <ctype.h>								// Defines set of character functions
#include <math.h>								// Defines common math functions
#include <stdint.h>								// Defines exact width integer types
#include <stdio.h>								// Contains snprintf()
#include <stdlib.h>								// Contains stroul()
#include <string.h>								// Defines string handling functions

// Global Definitions
#define MAX_CONSOLE_STR_LEN 100					//printConsole() checks for strign length violations with assert()
#define CONSOLE_OUTPUT							//Other modules that output to console will check for #ifdef CONSOLE_OUTPUT

// Global Variables
extern char outString[MAX_CONSOLE_STR_LEN];		//Holds console output string
extern char tempString[MAX_CONSOLE_STR_LEN / 4];	//Used to build console output string

// Public Function Protoypes
void console(char *strbuf);
void print2Console(char *outString);
void show_parms(char p1);
void show_version(void);
void printError(void);
void printCommandPrompt(void);
void PressANYkeytoContinue(int output);
uint8_t retInString (char* string);
int16_t hex2asc(void *npos, int digs, int mode, char *s, int LittleEndian);

#endif /* ADS1262_TIPD188_CONSOLE_H_ */
