Listing 41 continued LEDC

***************************************************************

* CLEAR THE DISPLAY

* Description: This function is called to clear the display.

* Arguments : none

*********************************************************************************************************

void DispClrScr (void) {

mt8U i;

for (i = 0; i < DISP_N_DIG; i++) { /* Clear the screen by turning OFF all segments */

OS_ENIER_CRITICAL () ; DispSegTbl [i] = 0x00; OS_EXIT_CRITICAL () ;

*********************************************************************************************************

* DISPLAY DRIVER INITIALIZATION

* Description : This function initializes the display driver.

*********************************************************************************************************

void Displnit (void) {

DispInitBort(),- /* Initialize I/O ports used in display driver */

DispDigMsk = 0x80; DispSegTbllx = 0;

DispClrScr 0 ; /* Clear the Display

***************************************************************************************

* DISPLAY NEXT SEVEN-SEGMENT DIGIT

* Description: This function is called by DispMuxISRO to output the segments and select the next digit

* to be multiplexed. DispMuxHandler () is called by DispMuxISRO defined in LED_IA.ASM

* Arguments : none

* Notes : - You MUST supply the code to clear the interrupt source. Note that with seme

* microprocessors {i.e. Motorola's MC68HC11), you must clear the interrupt source before

* enabling internets.

void DispMuxHandler (void) {

/* Insert code to CLEAR INTERRUPT SOURCE here

DispOutSeg(0x00); DispOutDig (DispDigMsk) ; DispOutSeg (DispSegTbl [DispSegTbllx] ) ; if (DispSegTbllx == (DISP_N_DIG - 1)) { DispSegTbllx = 0; DispDigMsk = 0x80; } else (

/* Turn OFF segments while changing digits

/* Select next digit to display

/* Output digit's seven-segment pattern

/* Adjust index to next seven-segment pattern

/* Index into first segments pattern

/* 0x80 will select the first seven-segment digit

/* Select next digit

Was this article helpful?

0 0

Post a comment