/* --COPYRIGHT--,BSD
 * Copyright (c) 2019, 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--*/
//*****************************************************************************
//  MSP430 PIR HAL Configuration
//
//  Static and default configuration of Library
// Texas Instruments, Inc.
// Luis R
#ifndef __CONFIG_PRIVATE_H__
#define __CONFIG_PRIVATE_H__

#include "Config_Common.h"

//*********** GUI Communication ************************************************
//! \brief baudrate of GUI Communication port
//!         i.e. 19200 = 19,200bps
//!
#define HAL_GUICOMM_BAUDRATE              (9600)

//*********** AFE Configuration ************************************************
//! \brief Analog VREF voltage in millivolts
//!         i.e. 2000 = 2.0V, set to 0 to disable VREF
//!
#define HAL_AFE_VREF_MV                   (2000)

//! \brief Set to 1 to use VREF as ADC reference, set to 0 to use AVCC
//!         i.e. 1 = use VREF
//!
#define HAL_AFE_ADC_VREF                  (1)

//! \brief Set to 1 to use VREF as SAC reference, set to 0 to use AVCC
//!         i.e. 1 = use VREF
//!
#define HAL_AFE_SAC_VREF                  (1)

//! \brief Default value of SAC output for 1st stage Amp
//!         i.e. 0-4096 -> 0V to VREF
//!
#define HAL_AFE_SAC_DEFAULT_1ST           (0)

//! \brief Default value of SAC output for 2nd stage Amp
//!         i.e. 0-4096 -> 0V to VREF
//!
#define HAL_AFE_SAC_DEFAULT_2ND           (0)

//! \brief Select which eUSCI to use with UART
#define GUI_COMM_UART_EUSCI (1)

#if (GUI_COMM_UART_EUSCI == 0)
#ifdef UCA0BR0
#undef UCA0BR0
#endif

#define UCAnBR0            (UCA0BR0)
#define UCAnBR1            (UCA0BR1)
#define UCAnCTLW0          (UCA0CTLW0)
#define UCAnIE             (UCA0IE)
#define UCAnIFG            (UCA0IFG)
#define UCAnIV             (UCA0IV)
#define UCAnMCTLW          (UCA0MCTLW)
#define UCAnSTATW          (UCA0STATW)
#define UCAnTXBUF          (UCA0TXBUF)

#define USCI_An_VECTOR     (USCI_A0_VECTOR)
#define USCI_An_ISR        (USCI_A0_ISR)
#elif (GUI_COMM_UART_EUSCI == 1)

#define UCAnBR0            (UCA1BR0)
#define UCAnBR1            (UCA1BR1)
#define UCAnCTLW0          (UCA1CTLW0)
#define UCAnIE             (UCA1IE)
#define UCAnIFG            (UCA1IFG)
#define UCAnIV             (UCA1IV)
#define UCAnMCTLW          (UCA1MCTLW)
#define UCAnSTATW          (UCA1STATW)
#define UCAnTXBUF          (UCA1TXBUF)

#define USCI_An_VECTOR     (USCI_A1_VECTOR)
#define USCI_An_ISR        (USCI_A1_ISR)
#else
#error "eUSCI is not defined. Modify HAL layer"
#endif

#endif //__CONFIG_PRIVATE_H__
