www.pudn.com > Bit1611_demo_code.rar > MCU.H


/* ********************************************************************** 
 
         Copyright (c) 2002-2006 Beyond Innovation Technology Co., Ltd 
 
        All rights are reserved. Reproduction in whole or in parts is 
    prohibited without the prior written consent of the copyright owner. 
   ---------------------------------------------------------------------- 
 
    Module: MCU.H 
 
    Purpose: Interface of MCU module. 
 
    Version: 0.01                                   07:17PM  2005/05/13 
 
    Compiler: Keil 8051 C Compiler v8.01 
 
    Reference: 
    [1] BIT5101 8051 MICROCONTROLLER WITH 64K FLASH AND ISP Version 0.01, 
        2004/10/25, Beyond Innovation Technology 
    [2] TP2804  8051 MICROCONTROLLER WITH 64K FLASH AND ISP Version 1.2, 
        June 2004, TOPRO 
 
   ---------------------------------------------------------------------- 
    Modification: 
 
    R0.01 07:17PM  2005/05/13 Jeffrey Chang 
    Reason: 
        1. Original. 
    Solution: 
 
   ********************************************************************** */ 
 
#ifndef _MCU_H_ 
#define _MCU_H_ 
 
/* ------------------------------------ 
    Header Files 
   ------------------------------------ */ 
#include "platform.h" 
 
 
/* ------------------------------------ 
    Macro Definitions 
   ------------------------------------ */ 
#undef EXTERN 
 
#ifdef _MCU_C_ 
    #define EXTERN 
#else 
    #define EXTERN  extern 
#endif 
 
 
 
/* :::::::::::::::::::::::::::::::::::: 
    MCU Pins Assignment 
   :::::::::::::::::::::::::::::::::::: */ 
#if (PLATFORM_CFG == PLATFORM_01_DMO1611A0) 
    // (01)VID540-100-027/BIT1611B0  (v1.00 2005/10/14 BIT1611B0 Demo Board) 
 
    sbit MCU_oDC            = P0 ^ 4;       // DC:              Active LOW 
    sbit MCU_oBL            = P0 ^ 3;       // Inverter Enable: Active LOW 
    sbit MCU_oAUDIO         = P0 ^ 5;       // Audio:           Active LOW  UNUSED ! 
    sbit MCU_oPANEL         = P0 ^ 6;       // Panel:           Active LOW  UNUSED ! 
 
    #define MCU_DC_ON               {   MCU_oDC = LOW;      } 
    #define MCU_DC_OFF              {   MCU_oDC = HIGH;     } 
 
    #define MCU_BL_ON               {   MCU_oBL = LOW;      } 
    #define MCU_BL_OFF              {   MCU_oBL = HIGH;     } 
 
    #define MCU_AUDIO_ON            {                       } 
    #define MCU_AUDIO_OFF           {                       } 
 
    #define MCU_PANEL_ON            {                       } 
    #define MCU_PANEL_OFF           {                       } 
 
    #define MCU_TCON_ON             {                       } 
    #define MCU_TCON_OFF            {                       } 
 
#elif (PLATFORM_CFG == PLATFORM_04_DMO1611S0) 
    // (04)PLATFORM_04_DMO1611S0 (VID502-002-031,BIT1611BS0) 
 
    sbit MCU_oDC            = P0 ^ 4;       // DC:              Active LOW 
    sbit MCU_oBL            = P0 ^ 3;       // Inverter Enable: Active LOW 
    sbit MCU_oAUDIO         = P0 ^ 5;       // Audio:           Active LOW  UNUSED ! 
    sbit MCU_oPANEL         = P0 ^ 6;       // Panel:           Active LOW  UNUSED ! 
 
    #define MCU_DC_ON               {   MCU_oDC = LOW;      } 
    #define MCU_DC_OFF              {   MCU_oDC = HIGH;     } 
 
    #define MCU_BL_ON               {   MCU_oBL = LOW;      } 
    #define MCU_BL_OFF              {   MCU_oBL = HIGH;     } 
 
    #define MCU_AUDIO_ON            {                       } 
    #define MCU_AUDIO_OFF           {                       } 
 
    #define MCU_PANEL_ON            {                       } 
    #define MCU_PANEL_OFF           {                       } 
 
    #define MCU_TCON_ON             {                       } 
    #define MCU_TCON_OFF            {                       } 
 
#elif (PLATFORM_CFG == PLATFORM_06_VTX0501) 
    // (06)PLATFORM_06_VTX0501 (BMW HS 2.1) 
 
    sbit MCU_oDC            = P0 ^ 0;       // DC:              Active LOW 
    sbit MCU_oBL            = P0 ^ 1;       // Inverter Enable: Active LOW 
    sbit MCU_oAUDIO         = P2 ^ 1;       // Audio:           Active LOW  UNUSED ! 
    sbit MCU_oPANEL         = P3 ^ 4;       // Panel:           Active LOW  UNUSED ! 
    sbit MCU_oPRO_PWM       = P0 ^ 3;       // PWM1 control:    Active Low 
 
    #define MCU_DC_ON               {   MCU_oDC = LOW;      } 
    #define MCU_DC_OFF              {   MCU_oDC = HIGH;     } 
 
    #define MCU_BL_ON               {   MCU_oBL = LOW;      } 
    #define MCU_BL_OFF              {   MCU_oBL = HIGH; MCU_oPRO_PWM = HIGH;   } 
 
    #define MCU_AUDIO_ON            {                       } 
    #define MCU_AUDIO_OFF           {                       } 
 
    #define MCU_PANEL_ON            {                       } 
    #define MCU_PANEL_OFF           {                       } 
 
    #define MCU_TCON_ON             {                       } 
    #define MCU_TCON_OFF            {                       } 
 
    #define MCU_PWM1_ON             {   MCU_oPRO_PWM = LOW; } 
 
 
#else 
    #error MCU.H - Invalid PLATFORM_CFG ! 
 
#endif /* PROJECT */ 
 
 
/* ------------------------------------ 
    Type Definitions 
   ------------------------------------ */ 
 
/* ------------------------------------ 
    Variables Definitions/Declarations 
   ------------------------------------ */ 
 
 
/* ------------------------------------ 
    Function Prototypes 
   ------------------------------------ */ 
EXTERN void MCU_Init(void); 
 
#endif  /* _MCU_H_ */ 
 
 
/* ********************************************************************** 
 
    Description: 
 
   ********************************************************************** */ 
 
/* %% End Of File %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */