/* ###################################################################
**     This component module is generated by Processor Expert. Do not modify it.
**     Filename    : FMSTR_SCI1.c
**     Project     : MAPS-MC-2IN1_DualServo_release
**     Processor   : MC56F84789VLL
**     Component   : Init_SCI
**     Version     : Component 01.095, Driver 01.22, CPU db: 3.50.001
**     Compiler    : CodeWarrior DSP C Compiler
**     Date/Time   : 2019-04-03, 17:51, # CodeGen: 0
**     Abstract    :
**         This "Init_SCI" Peripheral Inspector implements the
**         Serial Communications Interface module (SCI), basic
**         initialization and settings.
**     Settings    :
**         Serial channel              : QSCI1
**
**         Communication setting
**             Divisor value           : 651
**             Init baud rate          : 19201.228879 Bd
**             Data format             : 8 bits
**             Wakeup                  : by idle line
**             Polarity                : normal
**             Parity                  : none
**             SCI run in Wait mode    : Enabled
**
**         Interrupts
**           Receiver Full             : Disabled
**             ISR name                : FMSTR1_Isr
**             Interrupt name          : INT_QSCI1_RCV
**             Priority                : 1
**
**           Receiver Error            : Disabled
**
**           Transmitter Complete      : Disabled
**
**           Transmitter Ready         : Disabled
**             ISR name                : FMSTR1_Isr
**             Interrupt name          : INT_QSCI1_TDRE
**             Priority                : 1
**
**     Contents    :
**         Init - void FMSTR_SCI1_Init(void);
**
**     Copyright : 1997 - 2014 Freescale Semiconductor, Inc. 
**     All Rights Reserved.
**     
**     Redistribution and use in source and binary forms, with or without modification,
**     are permitted provided that the following conditions are met:
**     
**     o Redistributions of source code must retain the above copyright notice, this list
**       of conditions and the following disclaimer.
**     
**     o 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.
**     
**     o Neither the name of Freescale Semiconductor, Inc. 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 HOLDER 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.
**     
**     http: www.freescale.com
**     mail: support@freescale.com
** ###################################################################*/
/*!
** @file FMSTR_SCI1.c
** @version 01.22
** @brief
**         This "Init_SCI" Peripheral Inspector implements the
**         Serial Communications Interface module (SCI), basic
**         initialization and settings.
*/         
/*!
**  @addtogroup FMSTR_SCI1_module FMSTR_SCI1 module documentation
**  @{
*/         

/* MODULE FMSTR_SCI1. */

#include "FMSTR_SCI1.h"

/*
** ###################################################################
**
**  The following method(s) must be implemented by the user in one
**  of the following modules:
**
**    #if defined(FMSTR1_Isr_FAST_INT)
**    #pragma interrupt fast
**    #elif defined(FMSTR1_Isr_VECT_TABLE_ISR_FAST_INT)
**    #pragma define_section interrupt_fast "interrupt_fast.text"  RX
**    #pragma section interrupt_fast begin
**    #pragma interrupt fast
**    #else
**    #pragma interrupt
**    #endif
**    void FMSTR1_Isr(void)
**    {
**      // Your interrupt code
**    }
**    #if defined(FMSTR1_Isr_VECT_TABLE_ISR_FAST_INT)
**    #pragma section interrupt_fast end
**    #endif
**
**  Modules:
**       main
**       Events
**
** ###################################################################
*/

/*
** ===================================================================
**     Method      :  FMSTR_SCI1_Init (component Init_SCI)
**     Description :
**         This method initializes registers of the SCI module
**         according to this Peripheral Initialization Bean settings.
**         Call this method in the user code to initialize the
**         module. By default, the method is called by PE
**         automatically; see "Call Init method" property of the
**         bean for more details.
**     Parameters  : None
**     Returns     : Nothing
** ===================================================================
*/
void FMSTR_SCI1_Init(void)
{
  getReg(QSCI1_STAT);                  /* Clear interrupt request flags */
  /* QSCI1_RATE: SBR=0x028B,FRAC_SBR=0 */
  setReg16(QSCI1_RATE, 0x1458U);       /* Set prescaler bits */ 
  /* QSCI1_CTRL1: LOOP=0,SWAI=0,RSRC=0,M=0,WAKE=0,POL=0,PE=0,PT=0,TEIE=0,TIIE=0,RFIE=0,REIE=0,TE=1,RE=1,RWU=0,SBK=0 */
  setReg16(QSCI1_CTRL1, 0x0CU);        /* Set the SCI control register */ 
  /* QSCI1_CTRL2: TFCNT=0,TFWM=0,RFCNT=0,RFWM=0,FIFO_EN=0,RIEIE=0,LINMODE=0,RIIE=0,TDE=1,RDE=1 */
  setReg16(QSCI1_CTRL2, 0x03U);        /* Set the SCI control register */ 
  /* QSCI1_CTRL3: ??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,SHEN=0 */
  setReg16(QSCI1_CTRL3, 0x00U);        /* Set the SCI control 3 register */ 
}

/* END FMSTR_SCI1. */

/*!
** @}
*/
/*
** ###################################################################
**
**     This file was created by Processor Expert 10.3 [05.09]
**     for the Freescale 56800 series of microcontrollers.
**
** ###################################################################
*/
