本文整理汇总了C++中LCD_Clear函数的典型用法代码示例。如果您正苦于以下问题:C++ LCD_Clear函数的具体用法?C++ LCD_Clear怎么用?C++ LCD_Clear使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LCD_Clear函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: prvInit
void
prvInit()
{
//LCD init
LCD_Init();
IOE_Config();
LTDC_Cmd( ENABLE );
LCD_LayerInit();
LCD_SetLayer( LCD_FOREGROUND_LAYER );
LCD_Clear( LCD_COLOR_BLACK );
LCD_SetTextColor( LCD_COLOR_WHITE );
//Button
STM_EVAL_PBInit( BUTTON_USER, BUTTON_MODE_GPIO );
//LED
STM_EVAL_LEDInit( LED3 );
}
示例2: fputc
/*-----------------------------------------------------------*/
int fputc( int ch, FILE *f )
{
static unsigned portSHORT usColumn = 0, usRefColumn = mainCOLUMN_START;
static unsigned portCHAR ucLine = 0;
if( ( usColumn == 0 ) && ( ucLine == 0 ) )
{
LCD_Clear(LCD_White);
}
if( ch != '\n' )
{
/* Display one character on LCD */
LCD_PutChar(320 - usRefColumn, ucLine, (u8) ch, LCD_Red, LCD_White);
/* Decrement the column position by 16 */
usRefColumn -= mainCOLUMN_INCREMENT;
/* Increment the character counter */
usColumn++;
if( usColumn == mainMAX_COLUMN )
{
ucLine += mainROW_INCREMENT;
usRefColumn = mainCOLUMN_START;
usColumn = 0;
}
}
else
{
/* Move back to the first column of the next line. */
ucLine += mainROW_INCREMENT;
usRefColumn = mainCOLUMN_START;
usColumn = 0;
}
/* Wrap back to the top of the display. */
if( ucLine >= mainMAX_LINE )
{
ucLine = 0;
}
return ch;
}
示例3: main
int main()
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
Config_Clocks(); //配置时钟
Config_Port();
PGA_IO_Init();// 默认通道CH0
LCD_IO_set();
LCD_Init(); //初始化液晶
LCD_Clear();
LCD_Write_String(0,0,LCD_BUFFER);
_EINT();
while(1);
}
示例4: LCD_PrintMsg
// Display a string on the LCD with automatic carriage return
void LCD_PrintMsg(u8 *ptr)
{
u8 Char = 0;
u8 CharPos = 0;
LCD_Clear(); /* Clear the LCD display */
/* Set cursor to home position on line 1 */
LCD_SendByte(COMMAND_TYPE, LCD_LINE1);
/* Send String */
while ((*ptr != 0) && (CharPos < (LCD_LINE_MAX_CHAR * 2)))
{
/* Check if string length is bigger than LINE1 */
if (CharPos == LCD_LINE_MAX_CHAR)
{
LCD_SendByte(COMMAND_TYPE, LCD_LINE2); /* Select second line */
}
Char = *ptr;
switch (Char)
{
case ('\r'):
/* Carriage return */
CharPos++;
ptr++;
break;
case ('\n'):
CharPos = 0;
ptr++;
/* Set cursor to line 2 */
LCD_SendByte(COMMAND_TYPE, LCD_LINE2);
break;
default:
/* Display characters different from (\r, \n) */
LCD_SendByte(DATA_TYPE, Char);
CharPos++;
ptr++;
break;
}
}
}
示例5: LCD_LOG_SetHeader
/**
* @brief Display the application header (title) on the LCD screen
* @param Title : pointer to the string to be displayed
* @retval None
*/
void LCD_LOG_SetHeader (uint8_t *Title)
{
sFONT *cFont;
uint32_t size = 0 , idx;
uint8_t *ptr = Title;
uint8_t tmp[27];
/* center the header */
while (*ptr++) size ++ ;
/* truncate extra text */
if(size > 26)
{
size = 26;
}
for (idx = 0 ; idx < 27 ; idx ++)
{
tmp[idx] = ' ';
}
for (idx = 0 ; idx < size ; idx ++)
{
tmp[idx + (27 - size)/2] = Title[idx];
}
/* Clear the LCD */
LCD_Clear(Black);
/* Set the LCD Font */
LCD_SetFont (&Font12x12);
cFont = LCD_GetFont();
/* Set the LCD Text Color */
LCD_SetTextColor(White);
LCD_SetBackColor(Blue);
LCD_ClearLine(0);
LCD_DisplayStringLine(cFont->Height, tmp);
LCD_ClearLine(2 * cFont->Height);
LCD_SetBackColor(Black);
LCD_SetFont (&Font8x12);
}
示例6: main
int main(void)
{
u8 i=0;
HEADCOLOR *imginfo;
u16 x=0,y=0;
u16 x0,y0;
imginfo=(HEADCOLOR*)gImage_image1; //得到文件信息
delay_init(); //延时函数初始化
uart_init(9600); //串口初始化为9600
LED_Init(); //LED初始化
LCD_Init(); //LCD初始化
delay_ms(1500); //等待1.5秒
srand(imginfo->h*imginfo->w);
while(1)
{
if(i==0)
{
LCD_Clear(0X0000);//黑屏
if(imginfo->w>=lcddev.width||imginfo->h>=lcddev.height)
{
POINT_COLOR=RED;
delay_ms(200);
LCD_ShowString(10,70,200,16,16,"The Picture is too large");
delay_ms(200);
continue;
}
x0=x;y0=y;
while((x+imginfo->w)>lcddev.width||x==x0)//超过屏幕尺寸了
{
x=rand();//获得随机的x值
}
while((y+imginfo->h)>lcddev.height||y==y0)//超过屏幕尺寸了
{
y=rand();//获得随机的y值
}
image_display(x,y,(u8*)gImage_image1);//在指定地址显示图片
}
i++;
if(i>10)i=0;
LED0=!LED0;
delay_ms(200);
}
}
示例7: main2
void main2(void) {
PLL_Init();
LCD_Init();
OC_Init2();
TIE |= 0x04;
LCD_Clear();
DDRP |= 0x80; // LED
asm cli
while(1) {
PTP ^= 0x80; // flash LED
printf("a"); //output a on first line
main_loc = (main_loc + 1) % 8; //update location on main line
Timer_Wait_1ms(500);
if ( main_loc == 0 )
LCD_GoTo(1,1); //wrap around
}
}
示例8: Load_Sys_ICO
//加载主界面
void Load_Sys_ICO(void)
{
u8 t,tx;
u16 ty;
FileInfoStruct temp;
POINT_COLOR=RED;//黑色字体
LCD_Clear(WHITE);//清屏
temp.F_Type=T_BMP;//文件属性设置
tx=10;ty=10;
for(t=0;t<9;t++)
{
temp.F_StartCluster=sys_ico[t];
tx=80*(t%3)+10;//10,90,170
AI_LoadPicFile(&temp,tx,ty,tx+59,ty+60);
Select_Menu(0,t,0);//加载字体
if(t>=5)ty=216;
else if(t>=2)ty=113;
}
}
示例9: main
void main(void) {
WDTCTL=WDTPW+WDTHOLD;
BCSCTL1 = CALBC1_16MHZ; /* Set DCO to16MHz */
DCOCTL = CALDCO_16MHZ;
__delay_cycles(100000); //等待电压稳定
TCA6416A_Init();
Slope_Measure_Init();
HT1621_init();
LCD_Clear();
Display_SLOPE();
HT1621_Reflash(LCD_Buffer);
//-----设定WDT为16ms定时中断-----
WDTCTL=WDT_ADLY_16;
//-----WDT中断使能-----
IE1|=WDTIE;
_enable_interrupts();
while(1);
}
示例10: main
int main(int argc, char *argv[])
{
//BOOTLOADER_reset();
int r;
__enable_irq();
//NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x4000); // make sure that
// interrupts work
clock_init(); // hey, you can overclock later here. maybe.
JSON_init();
USART_Config();
TIM_init();
LCD_Configuration();
LCD_Initialization();
LCD_Clear(LCD_Black);
USART_PutString(HOST_USART,"***** INIT DONE *****\n");
while(1) {
r = JSON_render();
// todo: better error reporting
if(r == 3) {
// no free bufs
continue;
} else if(r != 0) {
JSON_init(); // reset buffers in case of errors
char abuf[32];
itoa(abuf, r, 10);
USART_PutString(HOST_USART, abuf);
USART_PutChar(HOST_USART, 'N');
USART_PutChar(HOST_USART, '\n');
}
//USART1_PutChar('A');
__asm__("WFI"); // sleep for a bit.
}
return 0;
}
示例11: main
/**
* @brief Example main entry point.
* @par Parameters:
* None
* @retval
* None
*/
void main(void)
{
/* Initialize SPI for LCD */
SPI_DeInit();
SPI_Init(SPI_FIRSTBIT_MSB, SPI_BAUDRATEPRESCALER_128, SPI_MODE_MASTER, SPI_CLOCKPOLARITY_HIGH, SPI_CLOCKPHASE_2EDGE, SPI_DATADIRECTION_1LINE_TX, SPI_NSS_SOFT, 0x07);
SPI_Cmd(ENABLE);
/* Configure GPIO used to drive the joystick
JOYSTICK_UP --> PB6
JOYSTICK_DOWN --> PB7
JOYSTICK_LEFT --> PB4
*/
GPIO_Init(GPIOB, GPIO_PIN_4 | GPIO_PIN_6 | GPIO_PIN_7, GPIO_MODE_IN_FL_IT);
EXTI_SetExtIntSensitivity(EXTI_PORT_GPIOB, EXTI_SENSITIVITY_FALL_LOW);
enableInterrupts();
/* Initialize LCD */
LCD_Init();
/* Clear LCD lines */
LCD_Clear();
LCD_Backlight(ENABLE);
LCD_PrintString(LCD_LINE1, ENABLE, DISABLE, "Clock Selection");
LCD_PrintString(LCD_LINE2, ENABLE, DISABLE, " Use joystick");
CLK_DeInit();
CLK_HSIPrescalerConfig(CLK_PRESCALER_HSIDIV1);
/* Output Fcpu on CLK_CCO pin */
CLK_CCOConfig(CLK_OUTPUT_MASTER);
while (1)
{
}
}
示例12: PowerOnSetProc
void PowerOnSetProc()
{
port_b_pullups(TRUE); output_b(0xff); output_c(0xff);
set_tris_A(0b00000011); set_tris_B(0b01111111);
set_tris_D(0b00000000); set_tris_E(0b00000000);
set_tris_C(0b10010000);
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_2(T2_DIV_BY_4,250,2); // 8,000,000 / (4 * 8 * (249 +1)) = 1,000 = 1/1000 sec
set_timer2(0);
enable_interrupts(INT_TIMER2);
// LCD 초기화 하기 전에 대기 없으면 이상한 현상이 생김
delay_ms(100);
LCD_Initialization();
setup_psp(PSP_DISABLED);
delay_ms(250);
SerialPortSetup();
LCD_Clear();
enable_interrupts(INT_RDA);
enable_interrupts(GLOBAL);
//"01234567890123456789"
strcpy(st, "DIGITAL OPERAT "); PrintLCD(0,0,st);
strcpy(st, "[EwDo-21] v2.60 "); PrintLCD(1,0,st);
strcpy(st, "EunWho Power Electic"); PrintLCD(2,0,st);
strcpy(st, "TEL 82-51-262-7532 "); PrintLCD(3,0,st);
delay_ms(3250);
delay_ms(3250);
}
示例13: main
int main()
{
struct Timer fps;
time_t current;
struct tm *current_tm;
struct Banner date_banner = {
.string = date_string,
.offset = 0
};
if (LCD_Init() != 0) {
printf("Error initializing LCD\n");
return 1;
}
LCD_SetBacklight(1);
for (;;) {
timer_start(&fps);
current = time(NULL);
current_tm = localtime(¤t);
string_print_date(date_string, current_tm);
LCD_Clear();
draw_clock_frame();
draw_time(current_tm);
update_banner(&date_banner);
draw_banner(&date_banner, 0);
draw_banner(&date_banner, 38);
LCD_Display();
if (timer_get_msecs(&fps) < 1000 / FRAMES_PER_SECOND) {
usleep(1000 * ( 1000 / FRAMES_PER_SECOND ) - timer_get_msecs(&fps));
}
}
return 0;
}
示例14: main
int main(void)
{
uint8_t i, j;
SysTick_Config(SystemCoreClock/1000); //1ms tick
RCC_Init();
USARTInit();
LCD_Init();
LED_Init();
LED_On();
LCD_Clear();
//LCD_char(0, 0, 0);
LCD_String("abcdefg",0,0);
LCD_String("6543210",0,3);
while(1){
delay_ms(100);
printf("done!\n\r");
LED_Toogle();
}
}
示例15: main
/* 修复了上下颠倒的BUG,enjoy~
* 要想中文显示成功
* 需把字库拷贝到sd卡上,然后把sd卡插到开发板的卡槽上
*/
int main(void)
{
/* USART1 config */
//USART1_Config();
//printf("\r\n this is a fatfs test demo \r\n");
LCD_Init();
/* 设置Lcd Gram 扫描方向为: 右下角->左上角 */
Lcd_GramScan( 3 );
LCD_Clear(0, 0, 320, 240, BACKGROUND);
/* 初始化sd卡文件系统,因为汉字的字库和bmp图片放在了sd卡里面 */
Sd_fs_init();
Screen_shot(0,0,320,240,"/myscreen");
while(1);
}