📄 dc550_display.c
字号:
for(i = 48; i > 0; i--);
// Write the sixth line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x11; // Sixth line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
// Wait for 40 microseconds
for(i = 48; i > 0; i--);
// Write the seventh line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x1F; // Seventh line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
// Wait for 40 microseconds
for(i = 48; i > 0; i--);
// Write the eighth line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x00; // Eighth line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
}
/******************************************************************************
* FUNCTION: void display_util_chartop_fullbox(void)
******************************************************************************
* DESCRIPTION:
* This function programs the top of the full box character into CGRAM.
*****************************************************************************/
void display_util_chartop_fullbox(void) {
// Declare local variable
int i;
// Write the first line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x1F; // First line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
// Wait for 40 microseconds
for(i = 48; i > 0; i--);
// Write the second line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x1F; // Second line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
// Wait for 40 microseconds
for(i = 48; i > 0; i--);
// Write the third line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x1F; // Third line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
// Wait for 40 microseconds
for(i = 48; i > 0; i--);
// Write the fourth line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x1F; // Fourth line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
}
/******************************************************************************
* FUNCTION: void display_util_charbottom_fullbox(void)
******************************************************************************
* DESCRIPTION:
* This function programs the bottom of the full box character into CGRAM.
*****************************************************************************/
void display_util_charbottom_fullbox(void) {
// Declare local variable
int i;
// Write the fifth line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x1F; // Fifth line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
// Wait for 40 microseconds
for(i = 48; i > 0; i--);
// Write the sixth line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x1F; // Sixth line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
// Wait for 40 microseconds
for(i = 48; i > 0; i--);
// Write the seventh line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x1F; // Seventh line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
// Wait for 40 microseconds
for(i = 48; i > 0; i--);
// Write the eighth line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x00; // Eighth line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
}
/******************************************************************************
* FUNCTION: void display_util_chartop_uparrow(void)
******************************************************************************
* DESCRIPTION:
* This function programs the top of the up arrow character into CGRAM.
*****************************************************************************/
void display_util_chartop_uparrow(void) {
// Declare local variable
int i;
// Write the first line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x04; // First line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
// Wait for 40 microseconds
for(i = 48; i > 0; i--);
// Write the second line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x0E; // Second line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
// Wait for 40 microseconds
for(i = 48; i > 0; i--);
// Write the third line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x15; // Third line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
// Wait for 40 microseconds
for(i = 48; i > 0; i--);
// Write the fourth line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x04; // Fourth line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
}
/******************************************************************************
* FUNCTION: void display_util_charbottom_uparrow(void)
******************************************************************************
* DESCRIPTION:
* This function programs the bottom of the up arrow character into CGRAM.
*****************************************************************************/
void display_util_charbottom_uparrow(void) {
// Declare local variable
int i;
// Write the fifth line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x04; // Fifth line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
// Wait for 40 microseconds
for(i = 48; i > 0; i--);
// Write the sixth line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x04; // Sixth line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
// Wait for 40 microseconds
for(i = 48; i > 0; i--);
// Write the seventh line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x04; // Seventh line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
// Wait for 40 microseconds
for(i = 48; i > 0; i--);
// Write the eighth line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x00; // Eighth line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
}
/******************************************************************************
* FUNCTION: void display_util_chartop_downarrow(void)
******************************************************************************
* DESCRIPTION:
* This function programs the top of the down arrow character into CGRAM.
*****************************************************************************/
void display_util_chartop_downarrow(void) {
// Declare local variable
int i;
// Write the first line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x04; // First line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
// Wait for 40 microseconds
for(i = 48; i > 0; i--);
// Write the second line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x04; // Second line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
// Wait for 40 microseconds
for(i = 48; i > 0; i--);
// Write the third line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x04; // Third line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
// Wait for 40 microseconds
for(i = 48; i > 0; i--);
// Write the fourth line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x04; // Fourth line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
}
/******************************************************************************
* FUNCTION: void display_util_charbottom_downarrow(void)
******************************************************************************
* DESCRIPTION:
* This function programs the bottom of the down arrow character into CGRAM.
*****************************************************************************/
void display_util_charbottom_downarrow(void) {
// Declare local variable
int i;
// Write the fifth line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x15; // Fifth line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
// Wait for 40 microseconds
for(i = 48; i > 0; i--);
// Write the sixth line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x0E; // Sixth line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
// Wait for 40 microseconds
for(i = 48; i > 0; i--);
// Write the seventh line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x04; // Seventh line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
// Wait for 40 microseconds
for(i = 48; i > 0; i--);
// Write the eighth line
LCDCTRL_OUT &= ~(LCD_RNW); // Clear RNW bit
LCDCTRL_OUT |= LCD_RS; // Set RS bit
LCDDATA_OUT = 0x00; // Eighth line
LCDCTRL_OUT |= LCD_E; // Clock bit high
_NOP();
LCDCTRL_OUT &= ~(LCD_E); // Clock bit low
}
/******************************************************************************
* FUNCTION: void display_exec(void)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -