/*
 * Aux2.h
 *
 *  Created on: Feb 4, 2014
 *      Author: rob
 */

#ifndef MPHOX_AUX2_H_
#define MPHOX_AUX2_H_

// Macros
#if BOARD_SEAPHOX == 1
#define AUX2_on() 	MAP_GPIOPinWrite(GPIO_PORTL_BASE, GPIO_PIN_7, 0xff);	// Power on
#define AUX2_off() 	MAP_GPIOPinWrite(GPIO_PORTL_BASE, GPIO_PIN_7, 0x00);	// Power off
#endif

#if BOARD_MFET >= 1 || BOARD_MPHOX == 1
#define AUX2_on()   MAP_GPIOPinWrite(GPIO_PORTD_BASE, GPIO_PIN_2, 0xff);    // Power on
#define AUX2_off()  MAP_GPIOPinWrite(GPIO_PORTD_BASE, GPIO_PIN_2, 0x00);    // Power off
#endif

#if BOARD_NANOFET
#define AUX2_on()   MAP_GPIOPinWrite(GPIO_PORTE_BASE, GPIO_PIN_2, 0xff);    // Power on
#define AUX2_off()  MAP_GPIOPinWrite(GPIO_PORTE_BASE, GPIO_PIN_2, 0x00);    // Power off
#endif

//*****************************************************************************
//
// Prototypes for the APIs.
//
//*****************************************************************************
extern void Init_AUX2(void);
extern void Open_AUX2(void);
extern void Close_AUX2(void);
extern void AUX2_UARTConfig(uint32_t ui32Port, uint32_t ui32Baud,
                            uint32_t ui32SrcClock);
extern int AUX2_UARTgets(char *pcBuf, uint32_t ui32Len);
extern unsigned char AUX1_UARTgetc(void);
extern int AUX2_UARTwrite(const char *pcBuf, uint32_t ui32Len);
extern int AUX2_UARTPeek(unsigned char ucChar);
extern void AUX2_UARTFlushTx(bool bDiscard);
extern void AUX2_UARTFlushRx(void);
extern int AUX2_UARTRxBytesAvail(void);
extern int AUX2_UARTTxBytesFree(void);
extern void AUX2_UARTEchoSet(bool bEnable);



#endif /* SEAPHOX_MFET_AUX2_H_ */
