本文整理汇总了C++中BSP_LCD_GetYSize函数的典型用法代码示例。如果您正苦于以下问题:C++ BSP_LCD_GetYSize函数的具体用法?C++ BSP_LCD_GetYSize怎么用?C++ BSP_LCD_GetYSize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了BSP_LCD_GetYSize函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Update_Color
/**
* @brief Updates the selected color
* @param None
* @retval None
*/
static void Update_Color(void)
{
static uint32_t color;
/* Get the current text color */
color = BSP_LCD_GetTextColor();
/* Update the selected color icon */
BSP_LCD_SetTextColor(color);
BSP_LCD_FillRect(450, (BSP_LCD_GetYSize() - 50), 30, 30);
BSP_LCD_SetTextColor(LCD_COLOR_BLACK);
BSP_LCD_DrawRect(450, (BSP_LCD_GetYSize() - 50), 30, 30);
BSP_LCD_SetTextColor(color);
}
开发者ID:Lembed,项目名称:STM32CubeF4-mirrors,代码行数:19,代码来源:main.c
示例2: TouchscreenCalibration_SetHint
/**
* @brief Display calibration hint
* @param None
* @retval None
*/
static void TouchscreenCalibration_SetHint(void)
{
/* Clear the LCD */
BSP_LCD_Clear(LCD_COLOR_WHITE);
/* Set Touchscreen Demo description */
BSP_LCD_SetTextColor(LCD_COLOR_BLACK);
BSP_LCD_SetBackColor(LCD_COLOR_WHITE);
BSP_LCD_SetFont(&Font12);
BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()/2 - 27, (uint8_t *)"Before using the Touchscreen", CENTER_MODE);
BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()/2 - 12, (uint8_t *)"you need to calibrate it.", CENTER_MODE);
BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()/2 + 3, (uint8_t *)"Press on the black circles", CENTER_MODE);
}
开发者ID:eemei,项目名称:library-stm32f4,代码行数:19,代码来源:ts_calibration.c
示例3: Prepare_Picture
/**
* @brief Prepares the picture to be saved in microSD.
* @param None
* @retval None
*/
static void Prepare_Picture(void)
{
uint32_t addrSrc = LCD_FRAME_BUFFER;
uint32_t addrDst = CONVERTED_FRAME_BUFFER;
static DMA2D_HandleTypeDef hdma2d_eval;
uint32_t lineCnt = 0;
/* Configure the DMA2D Mode, Color Mode and output offset : used to convert ARGB8888 to RGB888 */
/* used in BMP file format */
hdma2d_eval.Init.Mode = DMA2D_M2M_PFC;
hdma2d_eval.Init.ColorMode = DMA2D_RGB888; /* DMA2D Output format */
hdma2d_eval.Init.OutputOffset = 0;
/* Foreground Configuration */
hdma2d_eval.LayerCfg[1].AlphaMode = DMA2D_NO_MODIF_ALPHA;
hdma2d_eval.LayerCfg[1].InputAlpha = 0xFF;
hdma2d_eval.LayerCfg[1].InputColorMode = DMA2D_ARGB8888; /* DMA2D input format */
hdma2d_eval.LayerCfg[1].InputOffset = 70; /* skip 70 pixels on left when reading addrSrc : the left margin */
hdma2d_eval.Instance = DMA2D;
/* Go to start of last drawing pad useful line from LCD frame buffer */
addrSrc += ((BSP_LCD_GetYSize() - 70 - 1) * BSP_LCD_GetXSize() * ARGB8888_BYTE_PER_PIXEL);
/* Copy and Convert picture from LCD frame buffer in ARGB8888 to Converted frame buffer in
* RGB888 pixel format for all the useful lines of the drawing pad */
for(lineCnt=0; lineCnt < (BSP_LCD_GetYSize() - 80); lineCnt++)
{
/* DMA2D Initialization */
if(HAL_DMA2D_Init(&hdma2d_eval) == HAL_OK)
{
if(HAL_DMA2D_ConfigLayer(&hdma2d_eval, 1) == HAL_OK)
{
if (HAL_DMA2D_Start(&hdma2d_eval, addrSrc, addrDst,
(BSP_LCD_GetXSize() - 80), 1) == HAL_OK)
{
/* Polling For DMA transfer */
HAL_DMA2D_PollForTransfer(&hdma2d_eval, 10);
}
}
}
/* Increment the destination address by one line RGB888 */
addrDst += ((BSP_LCD_GetXSize() - 80) * RGB888_BYTE_PER_PIXEL);
/* Decrement the source address by one line */
addrSrc -= (BSP_LCD_GetXSize() * ARGB8888_BYTE_PER_PIXEL);
}
}
开发者ID:Lembed,项目名称:STM32CubeF4-mirrors,代码行数:54,代码来源:main.c
示例4: LCD_Config
/**
* @brief LCD configuration
* @param None
* @retval None
*/
static void LCD_Config(void)
{
/* LCD Initialization */
/* Two layers are used in this application but not simultaneously
so "LCD_MAX_PCLK" is recommended to programme the maximum PCLK = 25,16 MHz */
BSP_LCD_Init();
/* LCD Initialization */
BSP_LCD_LayerDefaultInit(0, LCD_FB_START_ADDRESS);
BSP_LCD_LayerDefaultInit(1, LCD_FB_START_ADDRESS+(BSP_LCD_GetXSize()*BSP_LCD_GetYSize()*4));
/* Enable the LCD */
BSP_LCD_DisplayOn();
/* Select the LCD Background Layer */
BSP_LCD_SelectLayer(0);
/* Clear the Background Layer */
BSP_LCD_Clear(LCD_COLOR_BLACK);
/* Select the LCD Foreground Layer */
BSP_LCD_SelectLayer(1);
/* Clear the Foreground Layer */
BSP_LCD_Clear(LCD_COLOR_BLACK);
/* Configure the transparency for foreground and background :
Increase the transparency */
BSP_LCD_SetTransparency(0, 0);
BSP_LCD_SetTransparency(1, 100);
}
开发者ID:acrepina,项目名称:STM32F7_serverWEB,代码行数:36,代码来源:main.c
示例5: HdmiCec_DisplayConnectedDevices
/**
* @brief Display connected devices
* @param None
* @retval None
*/
static void HdmiCec_DisplayConnectedDevices(void)
{
uint8_t string[50] = {0};
uint8_t i, connected_devices = 0;
for (i = 0; i < 12; i++)
{
if (strcmp((const char*)(HDMI_CEC_Follower_String[i][1]), "0"))
{
connected_devices++;
}
}
BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
BSP_LCD_FillRect(20, 175, BSP_LCD_GetYSize() - 40, 30);
BSP_LCD_SetTextColor(LCD_COLOR_BLACK);
if (connected_devices == 0)
{
BSP_LCD_DisplayStringAt(20, 175, (uint8_t *)"No devices connected", LEFT_MODE);
}
else
{
sprintf((char *) string, "%d device(s) connected", connected_devices);
BSP_LCD_DisplayStringAt(20, 175, string, LEFT_MODE);
}
}
开发者ID:NjordCZ,项目名称:stm32cubef0,代码行数:32,代码来源:hdmi_cec.c
示例6: LCD_Config
/**
* @brief LCD configuration.
* @param None
* @retval None
*/
static void LCD_Config(void)
{
/* LCD Initialization */
/* Two layers are used in this application simultaneously
so "LCD_MIN_PCLK" is recommended to programme the PCLK at 20 MHz */
BSP_LCD_InitEx(LCD_MIN_PCLK);
/* LCD Layers Initialization */
BSP_LCD_LayerDefaultInit(0, LCD_FB_START_ADDRESS);
BSP_LCD_LayerDefaultInit(1, (LCD_FB_START_ADDRESS+(BSP_LCD_GetXSize()*BSP_LCD_GetYSize()*4)));
/* Enable the LCD */
BSP_LCD_DisplayOn();
/* Set LCD Background Layer */
BSP_LCD_SelectLayer(0);
/* Clear the Background Layer */
BSP_LCD_Clear(LCD_COLOR_WHITE);
/* Set LCD Foreground Layer */
BSP_LCD_SelectLayer(1);
/* Clear the Foreground Layer */
BSP_LCD_Clear(LCD_COLOR_BLACK);
/* Configure and enable the Color Keying feature */
BSP_LCD_SetColorKeying(1, 0);
/* Configure the transparency for foreground: Increase the transparency */
BSP_LCD_SetTransparency(1, 100);
}
开发者ID:acrepina,项目名称:STM32F7_serverWEB,代码行数:35,代码来源:main.c
示例7: AudioPlay_DisplayInfos
/**
* @brief Display audio file and control information
* @param format : structure containing informations of the audio file
* @retval None
*/
static void AudioPlay_DisplayInfos(WAVE_FormatTypeDef * format)
{
uint8_t string[50] = {0};
BSP_LCD_SetTextColor(LCD_COLOR_BLACK);
sprintf((char *) string, "Sampling frequency : %lu Hz", format->SampleRate);
BSP_LCD_DisplayStringAt(20, 115, string, LEFT_MODE);
if (format->NbrChannels == 2)
{
sprintf((char *) string, "Format : %d bits stereo", format->BitPerSample);
BSP_LCD_DisplayStringAt(20, 130, string, LEFT_MODE);
}
else if (format->NbrChannels == 1)
{
sprintf((char *) string, "Format : %d bits mono", format->BitPerSample);
BSP_LCD_DisplayStringAt(20, 130, string, LEFT_MODE);
}
sprintf((char *) Volume_string, " Volume : %lu%% ", uwVolume);
BSP_LCD_DisplayStringAt((uint16_t)(-6), BSP_LCD_GetYSize()-60, Volume_string, RIGHT_MODE);
BSP_LCD_DisplayStringAt(20, 200, (uint8_t *)"Press KEY to Pause/Resume playback", LEFT_MODE);
BSP_LCD_DisplayStringAt(20, 215, (uint8_t *)"Press UP/DOWN to change Volume", LEFT_MODE);
}
开发者ID:PaxInstruments,项目名称:STM32CubeF3,代码行数:30,代码来源:main.c
示例8: Camera_LineEventCallbackRotation90
/**
* @brief Camera line event callback when camera image rotation of 90 degrees hour
* direction is required.
* @param None
* @retval None
*/
static void Camera_LineEventCallbackRotation90(void)
{
uint32_t LcdResX = BSP_LCD_GetXSize();
uint32_t LcdResY = BSP_LCD_GetYSize();
if (refresh_authorized)
{
if ((offset_lcd == 0) && (CameraResY <= LcdResX) && (CameraResX <= LcdResY))
{
/* If Camera resolution is lower than LCD resolution, set display in the middle of the screen */
offset_lcd = ((((LcdResY - CameraResX) / 2) * LcdResX) /* Middle of the screen on Y axis */
- ((LcdResX - CameraResY) / 2)) /* Middle of the screen on X axis */
* sizeof(uint32_t);
if ((CameraResY == CAMERA_QQVGA_RES_Y) || (CameraResIndex == CAMERA_R480x272))
{ /* Add offset for QQVGA : + 40 LCD lines */
offset_lcd += 40 * LcdResX * sizeof(uint32_t);
}
}
/* Count the number of line rotated copied to be able to stop when limit reached */
if (display_rotated_line_counter < CameraResY)
{
/* if number of rotated line copied is reaching horizontal resolution of display LCD : stop copying also */
if (display_rotated_line_counter < LcdResX)
{
/* Depending on CameraResX versus LcdResY */
/* clamp the column size copied to LcdResY if (CameraResX > LcdResY) */
if (CameraResX <= LcdResY)
{
ConvertCameraLineRgb565ToLcdColumnARGB8888((uint32_t *)(CAMERA_FB_START_ADDR + offset_cam),
(uint32_t *)(LCD_FB_START_ADDRESS + offset_lcd),
CameraResX,
(LcdResX - 1)); /* lineStridePixels for DMA is always one horizontal line LCD - 1 pixels */
}
else
{
ConvertCameraLineRgb565ToLcdColumnARGB8888((uint32_t *)(CAMERA_FB_START_ADDR + offset_cam),
(uint32_t *)(LCD_FB_START_ADDRESS + offset_lcd),
LcdResY,
(LcdResX - 1)); /* lineStridePixels for DMA is always one horizontal line LCD - 1 pixels */
}
offset_cam = offset_cam + (CameraResX * sizeof(uint16_t)); /* uint16_t : because format camera data is RGB565 */
/* offset_lcd is decremented after each line rotated copied by one pixel of the LCD buffer = 4 bytes (ARGB8888) */
/* from 'offset_lcd' pre computed in first if statement of the current function */
offset_lcd = offset_lcd - sizeof(uint32_t); /* uint32_t : because format of LCD Frame buffer is ARGB8888 */
}
display_rotated_line_counter++;
}
else
{
offset_cam = 0;
offset_lcd = 0;
display_rotated_line_counter = 0;
}
}
}
开发者ID:z80,项目名称:stm32f429,代码行数:66,代码来源:camera.c
示例9: LCD_Config
/**
* @brief LCD configuration.
* @param None
* @retval None
*/
static void LCD_Config(void)
{
/* LCD Initialization */
BSP_LCD_Init();
/* LCD Layers Initialization */
BSP_LCD_LayerDefaultInit(0, LCD_FB_START_ADDRESS);
BSP_LCD_LayerDefaultInit(1, (LCD_FB_START_ADDRESS+(BSP_LCD_GetXSize()*BSP_LCD_GetYSize()*4)));
/* Enable the LCD */
BSP_LCD_DisplayOn();
/* Set LCD Background Layer */
BSP_LCD_SelectLayer(0);
/* Clear the Background Layer */
BSP_LCD_Clear(LCD_COLOR_WHITE);
/* Set LCD Foreground Layer */
BSP_LCD_SelectLayer(1);
/* Clear the Foreground Layer */
BSP_LCD_Clear(LCD_COLOR_BLACK);
/* Configure and enable the Color Keying feature */
BSP_LCD_SetColorKeying(1, 0);
/* Configure the transparency for foreground: Increase the transparency */
BSP_LCD_SetTransparency(1, 100);
}
开发者ID:451506709,项目名称:automated_machine,代码行数:33,代码来源:main.c
示例10: Touchscreen_SetHint_Demo
/**
* @brief Display TS Demo Hint for all touchscreen demos depending on passed
* demoIndex in parameter.
* @param demoIndex : parameter of type @ref TouchScreenDemoTypeDef
* @retval None
*/
static void Touchscreen_SetHint_Demo(TouchScreenDemoTypeDef demoIndex)
{
if(demoIndex <= TOUCHSCREEN_DEMO_MAX)
{
/* Clear the LCD */
BSP_LCD_Clear(LCD_COLOR_WHITE);
/* Set Touchscreen Demo1 description */
BSP_LCD_SetTextColor(LCD_COLOR_BLUE);
BSP_LCD_FillRect(0, 0, BSP_LCD_GetXSize(), 80);
BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
BSP_LCD_SetBackColor(LCD_COLOR_BLUE);
BSP_LCD_SetFont(&Font24);
if(demoIndex == TOUCHSCREEN_DEMO_1)
{
BSP_LCD_DisplayStringAt(0, 0, (uint8_t *)"Touchscreen basic polling", CENTER_MODE);
BSP_LCD_SetFont(&Font12);
BSP_LCD_DisplayStringAt(0, 30, (uint8_t *)"Please use the Touchscreen to", CENTER_MODE);
BSP_LCD_DisplayStringAt(0, 45, (uint8_t *)"activate the colored circle", CENTER_MODE);
BSP_LCD_DisplayStringAt(0, 60, (uint8_t *)"inside the rectangle. Then press TAMPER button", CENTER_MODE);
}
else if (demoIndex == TOUCHSCREEN_DEMO_2)
{
BSP_LCD_DisplayStringAt(0, 0, (uint8_t *)"Touchscreen dual touch polling", CENTER_MODE);
BSP_LCD_SetFont(&Font12);
BSP_LCD_DisplayStringAt(0, 30, (uint8_t *)"Please press the Touchscreen to", CENTER_MODE);
BSP_LCD_DisplayStringAt(0, 45, (uint8_t *)"activate single and", CENTER_MODE);
BSP_LCD_DisplayStringAt(0, 60, (uint8_t *)"dual touch", CENTER_MODE);
}
else /* demoIndex == TOUCHSCREEN_DEMO_3 */
{
BSP_LCD_DisplayStringAt(0, 0, (uint8_t *)"Touchscreen dual touch interrupt", CENTER_MODE);
BSP_LCD_SetFont(&Font12);
BSP_LCD_DisplayStringAt(0, 30, (uint8_t *)"Please press the Touchscreen to", CENTER_MODE);
BSP_LCD_DisplayStringAt(0, 45, (uint8_t *)"activate single and", CENTER_MODE);
BSP_LCD_DisplayStringAt(0, 60, (uint8_t *)"dual touch", CENTER_MODE);
}
/* Set the LCD Text Color */
BSP_LCD_SetTextColor(LCD_COLOR_BLUE);
BSP_LCD_DrawRect(10, 90, BSP_LCD_GetXSize() - 20, BSP_LCD_GetYSize() - 100);
BSP_LCD_DrawRect(11, 91, BSP_LCD_GetXSize() - 22, BSP_LCD_GetYSize() - 102);
} /* of if(demoIndex <= TOUCHSCREEN_DEMO_MAX) */
}
开发者ID:Lembed,项目名称:STM32CubeF4-mirrors,代码行数:53,代码来源:touchscreen.c
示例11: BSP_LCD_DrawRGBImage
/**
* @brief Draws RGB Image (16 bpp).
* @param Xpos: X position in the LCD
* @param Ypos: Y position in the LCD
* @param Xsize: X size in the LCD
* @param Ysize: Y size in the LCD
* @param pdata: Pointer to the RGB Image address.
* @retval None
*/
void BSP_LCD_DrawRGBImage(uint16_t Xpos, uint16_t Ypos, uint16_t Xsize, uint16_t Ysize, uint8_t *pdata)
{
SetDisplayWindow(Xpos, Ypos, Xsize, Ysize);
LCD_DrawRGBImage(Xpos, Ypos, Xsize, Ysize, pdata);
SetDisplayWindow(0, 0, BSP_LCD_GetXSize(), BSP_LCD_GetYSize());
}
开发者ID:glocklueng,项目名称:STM32F4-Dev,代码行数:17,代码来源:stm32f4_discovery_lcd.c
示例12: Save_Picture
/**
* @brief Saves the picture in microSD.
* @param None
* @retval None
*/
void Save_Picture(void)
{
FRESULT res1, res2; /* FatFs function common result code */
uint32_t byteswritten = 0; /* File write count */
static uint32_t counter = 0;
uint8_t str[30];
/* Check if the SD card is plugged in the slot */
if(BSP_SD_IsDetected() != SD_PRESENT)
{
Error_Handler();
}
else
{
/* Format the string */
sprintf((char *)str, "image_%lu.bmp", counter);
/*##-1- Prepare the image to be saved ####################################*/
Prepare_Picture();
/*##-2- Create and Open a new bmp file object with write access ##########*/
if(f_open(&MyFile, (const char*)str, FA_CREATE_ALWAYS | FA_WRITE) != FR_OK)
{
/* 'image.bmp' file Open for write Error */
Error_Handler();
}
else
{
/*##-3- Write data to the BMP file #####################################*/
/* Write the BMP header */
res1 = f_write(&MyFile, (uint32_t *)aBMPHeader, 54, (void *)&byteswritten);
/* Write the BMP file */
res2 = f_write(&MyFile, (uint32_t *)CONVERTED_FRAME_BUFFER, ((BSP_LCD_GetYSize() - 80)*(BSP_LCD_GetXSize() - 80)*2), (void *)&byteswritten);
if((res1 != FR_OK) || (res2 != FR_OK) || (byteswritten == 0))
{
/* 'image.bmp' file Write or EOF Error */
Error_Handler();
}
else
{
/*##-4- Close the open BMP file ######################################*/
f_close(&MyFile);
/* Success of the demo: no error occurrence */
BSP_LED_On(LED1);
/* Wait for 2s */
HAL_Delay(2000);
/* Select Layer 1 */
BSP_LED_Off(LED1);
counter++;
}
}
}
}
开发者ID:pierreroth64,项目名称:STM32Cube_FW_F4,代码行数:63,代码来源:main.c
示例13: main
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
/* STM32F4xx HAL library initialization:
- Configure the Flash prefetch, instruction and Data caches
- Configure the Systick to generate an interrupt each 1 msec
- Set NVIC Group Priority to 4
- Global MSP (MCU Support Package) initialization
*/
HAL_Init();
/* Configure the system clock to 168 MHz */
SystemClock_Config();
/* Configure LED1 and LED3 */
BSP_LED_Init(LED1);
BSP_LED_Init(LED3);
/*##-1- LCD Initialization #################################################*/
/* Initialize the LCD */
BSP_LCD_Init();
/* Enable the LCD */
BSP_LCD_DisplayOn();
/* Clear the LCD Background layer */
BSP_LCD_Clear(LCD_COLOR_WHITE);
/*##-2- Touch screen initialization ########################################*/
Touchscreen_Calibration();
BSP_TS_Init(BSP_LCD_GetXSize(), BSP_LCD_GetYSize());
/*##-3- Link the SD Card disk I/O driver ###################################*/
if(FATFS_LinkDriver(&SD_Driver, SDPath) != 0)
{
/* FatFs Initialization Error */
Error_Handler();
}
/* Create a FAT file system (format) on the logical drive */
f_mkfs((TCHAR const*)SDPath, 0, 0);
/*##-4- Register the file system object to the FatFs module ################*/
if(f_mount(&SDFatFs, (TCHAR const*)SDPath, 0) != FR_OK)
{
/* FatFs Initialization Error */
Error_Handler();
}
/*##-5- Draw the menu ######################################################*/
Draw_Menu();
/* Infinite loop */
while (1)
{
/*##-6- Configure the touch screen and Get the position ####################*/
GetPosition();
}
}
开发者ID:pierreroth64,项目名称:STM32Cube_FW_F4,代码行数:63,代码来源:main.c
示例14: main
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
uint32_t i;
uint32_t *ptrLcd;
/* Enable the CPU Cache */
CPU_CACHE_Enable();
/* STM32F7xx HAL library initialization:
- Configure the Flash ART accelerator on ITCM interface
- Systick timer is configured by default as source of time base, but user
can eventually implement his proper time base source (a general purpose
timer for example or other time source), keeping in mind that Time base
duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and
handled in milliseconds basis.
- Set NVIC Group Priority to 4
- Low Level Initialization
*/
HAL_Init();
/* Configure the system clock to 200 MHz */
SystemClock_Config();
/*##-1- Initialise the LCD #################################################*/
BSP_LCD_Init();
/* Init LCD screen buffer */
ptrLcd = (uint32_t*)(LCD_FRAME_BUFFER);
for (i=0; i<(BSP_LCD_GetXSize()*BSP_LCD_GetYSize()); i++)
{
ptrLcd[i]=0;
}
BSP_LCD_LayerDefaultInit(1, LCD_FRAME_BUFFER);
/* Enable the LCD */
BSP_LCD_DisplayOn();
/* Select the LCD Foreground layer */
BSP_LCD_SelectLayer(1);
/* Set active window */
BSP_LCD_SetLayerWindow(1, xoffset, yoffset, xsize, ysize);
/*##-2- Camera Initialisation and start capture ############################*/
/* Initialize the Camera */
BSP_CAMERA_Init(resolution);
/* Wait 1s before Camera snapshot */
HAL_Delay(1000);
/* Start the Camera Capture */
BSP_CAMERA_SnapshotStart((uint8_t *)CAMERA_FRAME_BUFFER);
while (1)
{
}
}
开发者ID:RadMie,项目名称:STM32F7DiscoveryBase,代码行数:63,代码来源:main.c
示例15: Touchscreen_Calibration
/**
* @brief Performs the TS calibration
* @param None
* @retval None
*/
void Touchscreen_Calibration (void)
{
uint8_t status = 0;
uint8_t i = 0;
TouchscreenCalibration_SetHint();
status = BSP_TS_Init(BSP_LCD_GetXSize(), BSP_LCD_GetYSize());
if (status != TS_OK)
{
BSP_LCD_SetBackColor(LCD_COLOR_WHITE);
BSP_LCD_SetTextColor(LCD_COLOR_RED);
BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()- 95, (uint8_t *)"ERROR", CENTER_MODE);
BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()- 80, (uint8_t *)"Touchscreen cannot be initialized", CENTER_MODE);
}
while (1)
{
if (status == TS_OK)
{
aLogX[0] = 15;
aLogY[0] = 15;
aLogX[1] = BSP_LCD_GetXSize() - 15;
aLogY[1] = BSP_LCD_GetYSize() - 15;
for (i = 0; i < 2; i++)
{
GetPhysValues(aLogX[i], aLogY[i], &aPhysX[i], &aPhysY[i]);
}
A1 = (TUNE_FACTOR_X * ( aLogX[1] - aLogX[0]))/ ( aPhysX[1] - aPhysX[0]);
B1 = (TUNE_FACTOR_X * aLogX[0]) - A1 * aPhysX[0];
A2 = (TUNE_FACTOR_Y * ( aLogY[1] - aLogY[0]))/ ( aPhysY[1] - aPhysY[0]);
B2 = (TUNE_FACTOR_Y * aLogY[0]) - A2 * aPhysY[0];
if (B2 > 0)
B2 = 0;
Calibration_Done = 1;
return;
}
HAL_Delay(5);
}
}
开发者ID:eemei,项目名称:library-stm32f4,代码行数:50,代码来源:ts_calibration.c
示例16: LCD_LOG_SetFooter
/**
* @brief Display the application footer on the LCD screen
* @param footer: pointer to the string to be displayed
* @retval None
*/
void LCD_LOG_SetFooter(uint8_t *footer)
{
/* Set the LCD Font */
BSP_LCD_SetFont (&LCD_LOG_FOOTER_FONT);
BSP_LCD_SetTextColor(LCD_LOG_SOLID_BACKGROUND_COLOR);
BSP_LCD_FillRect(0, BSP_LCD_GetYSize() - LCD_LOG_FOOTER_FONT.Height - 4, BSP_LCD_GetXSize(), LCD_LOG_FOOTER_FONT.Height + 4);
/* Set the LCD Text Color */
BSP_LCD_SetTextColor(LCD_LOG_SOLID_TEXT_COLOR);
BSP_LCD_SetBackColor(LCD_LOG_SOLID_BACKGROUND_COLOR);
BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize() - LCD_LOG_FOOTER_FONT.Height, footer, CENTER_MODE);
BSP_LCD_SetBackColor(LCD_LOG_BACKGROUND_COLOR);
BSP_LCD_SetTextColor(LCD_LOG_TEXT_COLOR);
BSP_LCD_SetFont (&LCD_LOG_TEXT_FONT);
}
开发者ID:Joe-Merten,项目名称:Stm32-Tools-Evaluation,代码行数:23,代码来源:lcd_log.c
示例17: LCD_Show_Feature
/**
* @brief Show LCD Features
* @param feature : feature index
* @retval None
*/
static void LCD_Show_Feature(uint8_t feature)
{
Point Points[]= {{20, 70}, {60, 70}, {60, 100}};
Point Points2[]= {{80, 70}, {120, 70}, {120, 100}};
BSP_LCD_SetBackColor(LCD_COLOR_WHITE);
BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
BSP_LCD_FillRect(0, 60, BSP_LCD_GetXSize(), BSP_LCD_GetYSize()- 40);
BSP_LCD_SetTextColor(LCD_COLOR_BLACK);
switch (feature)
{
case 0:
/* Text Feature */
BSP_LCD_SetFont(&Font24);
BSP_LCD_DisplayStringAt(14, 80, (uint8_t *)"Font24", LEFT_MODE);
BSP_LCD_SetFont(&Font20);
BSP_LCD_DisplayStringAt(0, 105, (uint8_t *)"Font20", CENTER_MODE);
BSP_LCD_SetFont(&Font16);
BSP_LCD_DisplayStringAt(14, 130, (uint8_t *)"Font16", RIGHT_MODE);
break;
case 1:
/* Draw misc. Shapes part 1*/
BSP_LCD_SetTextColor(LCD_COLOR_BLACK);
BSP_LCD_DrawRect(20, 70, 40 , 20);
BSP_LCD_FillRect(70, 70, 40 , 20);
BSP_LCD_SetTextColor(LCD_COLOR_BLUE);
BSP_LCD_DrawCircle(40, 120, 20);
BSP_LCD_FillCircle(90, 120, 20);
BSP_LCD_SetTextColor(LCD_COLOR_RED);
BSP_LCD_DrawLine (20, 70, 20+40 , 70+20);
BSP_LCD_DrawLine (20, 70+20, 20+40 , 70);
BSP_LCD_DrawHLine(20, 120, 40);
BSP_LCD_DrawVLine(40, 100, 40);
break;
case 2:
/* Draw misc. Shapes part 2*/
BSP_LCD_SetTextColor(LCD_COLOR_GREEN);
BSP_LCD_DrawPolygon(Points, 3);
BSP_LCD_FillPolygon(Points2, 3);
BSP_LCD_SetTextColor(LCD_COLOR_RED);
BSP_LCD_DrawEllipse(BSP_LCD_GetXSize() - 100, 110, 20, 30);
BSP_LCD_FillEllipse(BSP_LCD_GetXSize() - 40, 110, 20, 30);
break;
case 3:
/* Draw Bitmap */
BSP_LCD_DrawBitmap(20, 70, (uint8_t *)stlogo);
HAL_Delay(200);
break;
}
}
开发者ID:PaxInstruments,项目名称:STM32CubeF2,代码行数:62,代码来源:lcd.c
示例18: Update_ColorSize
/**
* @brief Updates the selected Color and Size
* @param None
* @retval None
*/
static void Update_ColorSize(void)
{
static uint32_t color;
/* Clear the current circle */
color = BSP_LCD_GetTextColor();
BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
BSP_LCD_FillCircle(220, (BSP_LCD_GetYSize()-24), 10);
BSP_LCD_SetTextColor(color);
/* Update the selected color icon */
BSP_LCD_FillCircle(220, (BSP_LCD_GetYSize()-24), radius);
/* Draw black circle */
BSP_LCD_SetTextColor(LCD_COLOR_BLACK);
BSP_LCD_DrawCircle(220, (BSP_LCD_GetYSize() - 24), radius);
BSP_LCD_SetTextColor(color);
}
开发者ID:kaival,项目名称:Stm32-Tools-Evaluation,代码行数:23,代码来源:main.c
示例19: TouchscreenCalibration_SetHint
/**
* @brief Display calibration hint
* @param None
* @retval None
*/
static void TouchscreenCalibration_SetHint(void)
{
/* Clear the LCD */
BSP_LCD_Clear(LCD_COLOR_WHITE);
/* Set Touchscreen Demo description */
BSP_LCD_SetTextColor(LCD_COLOR_BLACK);
BSP_LCD_SetBackColor(LCD_COLOR_WHITE);
BSP_LCD_SetFont(&Font20);
BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize() / 2 - 35, (uint8_t *)"Before using the Touchscreen", CENTER_MODE);
BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize() / 2 - 15, (uint8_t *)"you need to calibrate it.", CENTER_MODE);
BSP_LCD_SetFont(&Font24);
BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize() / 2 + 7, (uint8_t *)"WAIT until the black circle appears", CENTER_MODE);
BSP_LCD_SetFont(&Font20);
BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize() / 2 + 30, (uint8_t *)"THEN Press precisly on the black circles", CENTER_MODE);
BSP_LCD_SetFont(&Font12);
}
开发者ID:nguyenvuhung,项目名称:STM32Cube_FW_F4,代码行数:23,代码来源:ts_calibration.c
示例20: BSP_CAMERA_FrameEventCallback
/**
* @brief Frame Event callback.
* @param None
* @retval None
*/
void BSP_CAMERA_FrameEventCallback(void)
{
uint32_t xsizeLCD, ysizeLCD;
uint32_t xsizeCamera, ysizeCamera;
uint32_t xoffset, yoffset;
uint32_t line, column, i, j;
uint16_t *ptrCamera, *ptrCameraCrop;
xsizeLCD = BSP_LCD_GetXSize();
ysizeLCD = BSP_LCD_GetYSize();
BSP_CAMERA_Suspend();
/* Display on LCD */
switch (CameraResIndex)
{
case CAMERA_R160x120:
xsizeCamera = CAMERA_QQVGA_RES_X;
ysizeCamera = CAMERA_QQVGA_RES_Y;
xoffset = 80;
yoffset = 105;
break;
case CAMERA_R320x240:
default:
xsizeCamera = CAMERA_QVGA_RES_X;
ysizeCamera = CAMERA_QVGA_RES_Y;
xoffset = 0;
yoffset = 0;
break;
}
if ((xsizeCamera > xsizeLCD) || (ysizeCamera > ysizeLCD))
{
/* As the camera output resolution is greater than display resolution, a cropped image has to be generated */
ptrCamera = (uint16_t *)(CAMERA_FRAME_BUFFER);
ptrCameraCrop = (uint16_t *)(CAMERA_FRAME_BUFFER_CROP);
xoffset = (xsizeCamera - xsizeLCD) / 2;
yoffset = (ysizeCamera - ysizeLCD) / 2;
i=0;
j=xoffset;
for (line = 0; line < ysizeLCD; line ++)
{
for (column = 0; column < xsizeLCD; column ++)
{
ptrCameraCrop[i++] = ptrCamera[j++];
}
j += xsizeCamera - xsizeLCD;
}
BSP_LCD_DrawRGBImage(0, 0, xsizeLCD , ysizeLCD, (uint8_t *)ptrCameraCrop);
}
else
{
BSP_LCD_DrawRGBImage(xoffset, yoffset, xsizeCamera , ysizeCamera, (uint8_t *)CAMERA_FRAME_BUFFER);
}
BSP_CAMERA_Resume();
}
开发者ID:451506709,项目名称:automated_machine,代码行数:61,代码来源:camera.c
注:本文中的BSP_LCD_GetYSize函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论