D
Appendix D Closed Caption Pseudo
Code
/* Filename: CC_870_Function.C */
//Causes CX870/871 encoder to encode 2 bytes of data on every
Odd Field=Field 1
#include stdio.h
#include conio.h
<#include other necessary header files>
char
CCdatabyte1, CCdatabyte2;
// Define global vari-
ables
//Any graphics controller/MPEG2 Decoder is assumed to be the I2C
master for this design
//Controller/Data Master sends the CX870/871 the digital CC
bytes necessary for encoding into the Composite Video signal or
Luma signal for S-Video output
//H_CLKO[11:0] value should exist in hex format. This register
equals bits3-0 //of register 0x86 and bits 7-0 of register 0x76
870_CCEncoding_onField1(int CCdatabyte1, int CCdatabyte2, int
H_CLKO)
{
int CBITS, CC_PIPE1, CC_ADD_HEX, CCR_START_HEX, CCSEL,
ReadBit;
int ReadBitArray[8] = {0}; //initializes all element of
ReadBitArray to 0
float CC_ADD;
float CCR_START;
CBITS = 17;
CC_PIPE1=60;
CCSEL = 4;
//CCSEL[3:0] = 0100 so CC data is
encoded on line 21
//for 525-line systems and line 23 for
625-line systems
//Initialization Section
Write ECCGATE to 1;
the CX870/871
//this is bit 3 of register C4 for
//no further closed caption encoding
100381B
Conexant
D-1