⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 io.c

📁 以ST公司CPU为核心的彩色电视机的完整源程序。
💻 C
字号:
/********************** DAEWOO ELECTRONIC CO.    ************************
FILENAME     : IO.C
VERSION      : V0.1
DATE         : JAN 2000
AUTHOR(s)    : Jinghui Zhong
PROCESSOR    : ST92195
DESCRIPTION  : This module contains the function which is used to update
	       inputs and outputs ports.
MODIFICATIONS:
   -
*****************************************************************************/
#include "tv_glob.h"
#include "io.h"
#include "macro.h"
#include "st92196.h"
/*try*/


/*****************************************************************************
INPUTS     : none
OUTPUTS    : ST9 port control registers.
DESCRIPTION: This function initializes ST9 IO's.
*****************************************************************************/

void init_IO(void)
{
/* note: this version all reserve-pin , factory-pin, ht-pin,woofer-pin is set to nc*/ 
    /* Select port 0 control page */
    /* --------------------------------------------------------------------------
       Port 0: bit 7     bit 6    bit 5     bit 4   bit 3   bit 2   bit 1   bit 0
       --------------------------------------------------------------------------
              i/mos      i/mos    i/mos     i/mos   i/mos   i/mos   i/mos   i/mos 
					 
      	 RESERVE(OP) RESERVE(AV3) NC(VDD)    NC      NC      NC      NC     NC              
       --------------------------------------------------------------------------
       P0C2     0         0        0         0       0       0       0       0
       P0C1     0         0        0         0       0       0       0       0
       P0C0     1         1        1         1       1       1       1       1
       P0DR     1         1        1         1       1       1       1       1

      --------------------------------------------------------------------------- */
   spp(P0C_PG);
   P0C2R  = 0x00; 
   P0C1R  = 0x00;
   P0C0R  = 0xFF;
   P0DR   = 0xFF;


    /* Select port 2 control page */
    /* ----------------------------------------------------------------------------
       Port 2: bit 7     bit 6     bit 5   bit 4    bit 3     bit 2   bit 1   bit 0
       ----------------------------------------------------------------------------
              i/mos     i/mos      af/in   af/in    i/mos     af/o   af/hi  i/mos
        RESERVE(TXT) RESERVE(PIP)  SDA     SCK  RESERVE(VT2)  VT1     KEY     IR
       ----------------------------------------------------------------------------
       P2C2     0        0         1        1        0         0       1       1
       P2C1     0        0         1        1        0         1       1       0
       P2C0     1        1         1        1        1         1       1       1
       P2DR     1        1         1        1        1         1       1       1
       ----------------------------------------------------------------------------- */

   spp(P2C_PG);

   P2C2R  = 0x33;
   P2C1R  = 0x36;
   P2C0R  = 0xFF;
   P2DR   = 0xFF;

    /* Select port 3 control page */
    /* -------------------------------------------------------------------------  
       Port 3: bit 7    bit 6      bit 5    bit 4    bit 3   bit 2  bit 1  bit 0
       -------------------------------------------------------------------------       
               i/mos    i/mos      o/pp     o/pp     o/pp    i/mos  i/mos  i/mos
                NC      UHF(DX)  VHH(B2)   VHL(B1)    SYS     NC     NC     HT   
       -------------------------------------------------------------------------    
       P3C2     0        0          0        0        0       0      0      0       
       P3C1     0        1          1        1        1       0      0      0     
       P3C0     1        0          0        0        0       1      1      1     
       P3DR     1        0          0        1        0       1      1      1       */
																	
   spp(P3C_PG);                                                                                                    
   P3C2R  = 0x00;                                                                                          
   P3C1R  = 0x78;                                                                                          
   P3C0R  = 0x87;         /* temp F0   ON POWER PGM */
   P3DR   = 0x97;

    /* Select port 4 control page */
    /* -----------------------------------------------------------------------------
       Port 4: bit 7  bit 6  bit 5   bit 4   bit 3   bit 2  bit 1     bit 0
       -----------------------------------------------------------------------------
               i/mos  i/mos o/pp     i/mos   o/pp    i/mos  i/mos      i/mos  
               NC     NC    POWER    NC      MUTE    NC    WOOFER  RESERVE(SURROUND)
       -------------------------------------------------------------------------------
      P4C2       0      0     0       0        0      0      0          0
      P4C1       0      0     1       0        1      0      0          0
      P4C0       1      1     0       1        0      1      1          1
      P4DR       1      1     0       1        0      1      1          1
      ------------------------------------------------------------------------------- */

   spp(P4C_PG);

   P4DR   = 0xd7;//F7;//D7;
   P4C2R  = 0x00;
   P4C1R  = 0x28;
   P4C0R  = 0xD7;
 
/* debug  5.2 set to s_sw1 */
    /* Select port 5 control page */
    /* --------------------------------------------------------------
       Port 5: bit 7  bit 6  bit 5  bit 4  bit 3  bit 2  bit 1  bit 0
       --------------------------------------------------------------
               i/mos  i/mos  i/mos  i/mos  i/mos  i/mos  i/mos  i/mos
               n/a     NC     NC     n/a    n/a    NC     NC     NC
      --------------------------------------------------------------
      P5C2      0      0      0      0      0      0      0      0
      P5C1      0      0      0      0      0      0      0      0
      P5C0      1      1      1      1      1      1      1      1
      P5DR      1      1      1      1      1      1      0      1
      -------------------------------------------------------------- */
   spp(P5C_PG);
   P5C2R  = 0x00; 
   P5C1R  = 0x00;
   P5C0R  = 0xFF;
   P5DR   = 0xFD; /* for debug */

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -