/*******************************************************************************
*
* File Name: appconfig.h
*
* Description: file for static configuration of the application
*              (initial values, interrupt vectors)
*
*****************************************************************************/

#ifndef __APPCONFIG_H
#define __APPCONFIG_H

/*.*************************************************************************
*
*  File generated by Graphical Configuration Tool Wed, 18/May/2011, 14:06:58
*
****************************************************************************.*/

#define MC56F8025
#define EXTCLK 8000000L
#define APPCFG_DFLTS_OMITTED 1
#define APPCFG_GCT_VERSION 0x02030010L

/*.
    OCCS Configuration
--------------------------------------------
    Use Relaxation Oscillator: Disable
    Core frequency: 32 MHz 
    VCO frequency: 192 MHz 
    Loss of lock interrupt 0: Disable 
    Loss of lock interrupt 1: Disable 
    Loss of reference clock Interrupt: Disable
    COP operation: Enable 
    COP timeout: 8.38861 sec 
    COP Runs in Stop Mode: Disable
    COP Runs in Wait Mode: Disable
    COP Write Protect: Disable
    Enable Loss of Clock COP: Enable
.*/
#define OCCS_PLLCR_INIT                   0x0082
#define OCCS_PLLDB_INIT                   0x0000
#define OCCS_USE_FACTORY_TRIM             1

/*.
    SYS Configuration
--------------------------------------------
    SIM: Power Saving Modes: Stop enabled , Wait enabled 
         OnCE clock to processor core: Enabled when core TAP enabled 
    SIM - Interrupts: Low voltage 2.2V: Disable
                      Low voltage 2.7V: Disable
    SIM - Peripheral Clock Enable: PWM: No , SPI 0: No , SCI 0: Yes
                                   I2C: No , ADC: Yes, DAC 0: No 
                                   DAC 1: No , CMP A: No , CMP B: No , TMR A0: No 
                                   TMR A1: No , TMR A2: No , TMR A3: No , 
                                   PIT 0: Yes
                                   PIT 1: No , PIT 2: No 
    SIM - Modules Enabled in Stop: PWM: No , SPI 0: No , SCI 0: No 
                                   I2C: No , ADC: No , DAC 0: No 
                                   DAC 1: No , CMP A: No , CMP B: No , TMR A0: No 
                                   TMR A1: No , TMR A2: No , TMR A3: No , 
                                   PIT 0: No 
                                   PIT 1: No , PIT 2: No 
    SIM - Internal Periph. Source: PSRC0: PSCS0 input pin 
                                   PSRC1: PSCS1 input pin 
                                   PSRC2: PSCS2 input pin 
                                   FAULT1: FAULT1 input pin 
                                   FAULT2: FAULT2 input pin 
                                   FAULT1: FAULT1 input pin 
                                   DAC0 SYNC: PIT 0 output 
                                   DAC1 SYNC: PIT 0 output 
                                   Timer A1: Timer A1 pin 
                                   Timer A2: Timer A2 pin 
                                   Timer A3: Timer A3 pin 
    SIM - HS_PERF Peripheral Clk: IIC: Disable
                                  PWM: Disable
                                  Timer A: Disable
    Protection of IPS and GPSxx  : Registers not protected 
    Protection of PCE, SD and PCR: Registers not protected
.*/
#define SIM_PCE0_INIT                     0x0410
#define SIM_PCE1_INIT                     0x1000

/*.
    INTC Configuration
--------------------------------------------
    All maskable interrupts disabled: No
.*/
#define INTC_ICTL_INIT                    0x0000
#define INT_VECTOR_ADDR_55                pit0isr
#define INT_PRIORITY_LEVEL_55             INTC_LEVEL1
#define INT_VECTOR_ADDR_58                adc0isr
#define INT_PRIORITY_LEVEL_58             INTC_LEVEL1

/*.
    PIT_0 Configuration
--------------------------------------------
    Counter Enable: Enable 
    Clock Prescaler: / 16 
    Modulo Value: 99
    Interrupt Enable: Enable
.*/
#define PIT_0_CTRL_INIT                   0x0023
#define PIT_0_MOD_INIT                    0x0063

/*.
    GPIO_A Configuration
--------------------------------------------
    Pin  0: Function: GPIO , Direction: Output , Init.Value: Low - 0 , Interrupt: Disable, Int.Polarity: Active high , Output-Mode: Push-pull , 
    Pin  1: Function: GPIO , Direction: Output , Init.Value: Low - 0 , Interrupt: Disable, Int.Polarity: Active high , Output-Mode: Push-pull , 
    Pin  2: Function: GPIO , Direction: Output , Init.Value: Low - 0 , Interrupt: Disable, Int.Polarity: Active high , Output-Mode: Push-pull , 
    Pin  3: Function: GPIO , Direction: Output , Init.Value: Low - 0 , Interrupt: Disable, Int.Polarity: Active high , Output-Mode: Push-pull , 
    Pin  4: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high , 
    Pin  5: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high , 
    Pin  6: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high , 
    Pin  7: Function: RESET_B , PullUp: Enable , 
    Pin  8: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high , 
    Pin  9: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high , 
    Pin 10: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high , 
    Pin 11: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high ,
.*/
#define GPIO_A_DDR_INIT                   0x000F
#define GPIO_A_PER_INIT                   0x0080

/*.
    GPIO_B Configuration
--------------------------------------------
    Pin  0: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high , 
    Pin  1: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high , 
    Pin  2: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high , 
    Pin  3: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high , 
    Pin  5: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high , 
    Pin  6: Function: RXD0 , PullUp: Enable , 
    Pin  7: Function: TXD0 , PullUp: Enable , 
    Pin 10: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high , 
    Pin 11: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high ,
.*/
#define GPIO_B_PER_INIT                   0x00C0

/*.
    GPIO_C Configuration
--------------------------------------------
    Pin  0: Function: ANA0/CINA3 , PullUp: Enable , 
    Pin  1: Function: GPIO , Direction: Input , PullUp: Disable , Interrupt: Disable, Int.Polarity: Active high , 
    Pin  2: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high , 
    Pin  3: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high , 
    Pin  4: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high , 
    Pin  5: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high , 
    Pin  6: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high , 
    Pin  7: Function: GPIO , Direction: Input , PullUp: Enable , Interrupt: Disable, Int.Polarity: Active high ,
.*/
#define GPIO_C_PUR_INIT                   0xFFFD
#define GPIO_C_PER_INIT                   0x0001

/*.
    ADC Configuration
--------------------------------------------
    Clock frequency: 5.33333 MHz 
    Trigger source: Software only 
    Channel Configuration: ANA0-ANA1: Single ended , ANA2-ANA3: Single ended 
                           ANB0-ANB1: Single ended , ANB2-ANB3: Single ended 
                           ANA4-ANA5: Single ended , ANA6-ANA7: Single ended 
                           ANB4-ANB5: Single ended , ANB6-ANB7: Single ended 
    Channel to Sample Mapping: SMP0: ANA0 , 
    Scan Mode: Triggered sequential 
    Enabled samples: SMP0 
    Zero crossing mode: SMP0: Disabled , SMP1: Disabled , SMP2: Disabled , SMP3: Disabled 
                        SMP4: Disabled , SMP5: Disabled , SMP6: Disabled , SMP7: Disabled 
    Auto Power Down Mode: Disable
    Auto Stand-by Mode: Disable
    Power down converter A (ANA0-ANA7): No 
    Power down converter B (ANB0-ANB7): Yes
    Power down voltage reference: Yes
    Power up delay: 13, Power Control: 2.4375 us 
    Converter1 VREFLO source: ANB3 Pin
    Converter1 VREFH  source: ANB2 Pin
    Converter0 VREFLO source: ANA3 Pin
    Converter0 VREFH  source: ANA2 Pin
    Interrupts: ANA Conversion complete: Enabled 
                High limit error: Disabled
                Low limit error: Disabled
                Zero crossing: Disabled
.*/
#define ADC_ADCR1_INIT                    0x0804
#define ADC_ADLST1_INIT                   0x3210
#define ADC_ADLST2_INIT                   0x7654
#define ADC_ADLST3_INIT                   0xBA98
#define ADC_ADLST4_INIT                   0xFEDC
#define ADC_ADSDIS_INIT                   0xFF02
#define ADC_ADCPOWER_INIT                 0x00D6

/*.
    SCI_0 Configuration
--------------------------------------------
    Baudrate: 115108 bps 
    Enable Receiver: Enable 
    Enable Transmitter: Enable 
    Data word length: 8 bits 
    Parity: None 
    Polarity: True polarity 
    Loop mode: Disable
    Function in Wait Mode: SCI module enabled in Wait Mode 
    Interrupts: RX Full: Disable
                RX Error: Disable
                TX Empty: Disable
                TX Empty: Disable
    Enable RX and TX FIFO Queues: Disable
.*/
#define SCI_0_SCIBR_INIT                  0x008B
#define SCI_0_SCICR_INIT                  0x000C
#define SCI_0_SCICR2_INIT                 0x0000
#define SCI_0_RX_BUFFER_OKLIMIT           0x000F
#define SCI_0_RX_BUFFER_LOWLIMIT          0x000A

/*.
    FMSTR Configuration
--------------------------------------------
.*/
#define FMSTR_COMM_INTERFACE              1
#define FMSTR_LONG_INTR                   0
#define FMSTR_SHORT_INTR                  0
#define FMSTR_POLL_DRIVEN                 1
#define FMSTR_USE_RECORDER                1
#define FMSTR_REC_BUFF_SIZE               2000
#define FMSTR_REC_TIMEBASE                0x8032


/*.         End of autogenerated code
********************************************************************** ..*/

#endif
