本文整理汇总了C++中LCD_IO_WriteReg函数的典型用法代码示例。如果您正苦于以下问题:C++ LCD_IO_WriteReg函数的具体用法?C++ LCD_IO_WriteReg怎么用?C++ LCD_IO_WriteReg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LCD_IO_WriteReg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: st7735_DisplayOff
/**
* @brief Disables the Display.
* @param None
* @retval None
*/
void st7735_DisplayOff(void)
{
uint8_t data = 0;
LCD_IO_WriteReg(LCD_REG_19);
LCD_Delay(10);
LCD_IO_WriteReg(LCD_REG_40);
LCD_Delay(10);
LCD_IO_WriteReg(LCD_REG_54);
data = 0xC0;
LCD_IO_WriteMultipleData(&data, 1);
}
示例2: st7735_SetCursor
/**
* @brief Sets Cursor position.
* @param Xpos: specifies the X position.
* @param Ypos: specifies the Y position.
* @retval None
*/
void st7735_SetCursor(uint16_t Xpos, uint16_t Ypos)
{
uint8_t data = 0;
LCD_IO_WriteReg(LCD_REG_42);
data = (Xpos) >> 8;
LCD_IO_WriteMultipleData(&data, 1);
data = (Xpos) & 0xFF;
LCD_IO_WriteMultipleData(&data, 1);
LCD_IO_WriteReg(LCD_REG_43);
data = (Ypos) >> 8;
LCD_IO_WriteMultipleData(&data, 1);
data = (Ypos) & 0xFF;
LCD_IO_WriteMultipleData(&data, 1);
LCD_IO_WriteReg(LCD_REG_44);
}
示例3: spfd5408_WriteReg
/**
* @brief Writes to the selected LCD register.
* @param LCDReg: address of the selected register.
* @param LCDRegValue: value to write to the selected register.
* @retval None
*/
void spfd5408_WriteReg(uint8_t LCDReg, uint16_t LCDRegValue)
{
LCD_IO_WriteReg(LCDReg);
/* Write 16-bit GRAM Reg */
LCD_IO_WriteData((uint8_t*)&LCDRegValue, 2);
}
示例4: ili9325_DrawBitmap
/**
* @brief Displays a bitmap picture.
* @param BmpAddress: Bmp picture address.
* @param Xpos: Bmp X position in the LCD
* @param Ypos: Bmp Y position in the LCD
* @retval None
*/
void ili9325_DrawBitmap(uint16_t Xpos, uint16_t Ypos, uint8_t *pbmp)
{
uint32_t index = 0, size = 0;
/* Read bitmap size */
size = *(volatile uint16_t *) (pbmp + 2);
size |= (*(volatile uint16_t *) (pbmp + 4)) << 16;
/* Get bitmap data address offset */
index = *(volatile uint16_t *) (pbmp + 10);
index |= (*(volatile uint16_t *) (pbmp + 12)) << 16;
size = (size - index)/2;
pbmp += index;
/* Set GRAM write direction and BGR = 1 */
/* I/D=00 (Horizontal : decrement, Vertical : decrement) */
/* AM=1 (address is updated in vertical writing direction) */
ili9325_WriteReg(LCD_REG_3, 0x1008);
/* Set Cursor */
ili9325_SetCursor(Xpos, Ypos);
/* Prepare to write GRAM */
LCD_IO_WriteReg(LCD_REG_34);
for(index = 0; index < size; index++)
{
/* Write 16-bit GRAM Reg */
LCD_IO_WriteData(*(volatile uint16_t *)pbmp);
pbmp += 2;
}
/* Set GRAM write direction and BGR = 1 */
/* I/D = 01 (Horizontal : increment, Vertical : decrement) */
/* AM = 1 (address is updated in vertical writing direction) */
ili9325_WriteReg(LCD_REG_3, 0x1018);
}
示例5: ili9325_WriteReg
/**
* @brief Writes to the selected LCD register.
* @param LCD_Reg: Address of the selected register.
* @param LCD_RegValue: Value to write to the selected register.
* @retval None
*/
void ili9325_WriteReg(uint8_t LCD_Reg, uint16_t LCD_RegValue)
{
LCD_IO_WriteReg(LCD_Reg);
/* Write 16-bit GRAM Reg */
LCD_IO_WriteData(LCD_RegValue);
}
示例6: LCD_IO_ReadData
/**
* @brief Read register value.
* @param Reg
* @retval None
*/
uint16_t LCD_IO_ReadData(uint16_t Reg)
{
uint32_t readvalue = 0;
/* Send Reg value to Read */
LCD_IO_WriteReg(Reg);
/* Reset LCD control line(/CS) and Send command */
LCD_CS_LOW();
/* Send Start Byte */
SPIx_Write(START_BYTE | LCD_READ_REG);
/* Read Upper Byte */
SPIx_Write(0xFF);
readvalue = SPIx_Read();
readvalue = readvalue << 8;
readvalue |= SPIx_Read();
HAL_Delay(10);
/* Deselect : Chip Select high */
LCD_CS_HIGH();
return readvalue;
}
示例7: LCD_IO_ReadData
/**
* @brief Read register value.
* @param Reg
* @retval None
*/
uint16_t LCD_IO_ReadData(uint16_t Reg)
{
uint32_t readvalue = 0;
/* Change BaudRate Prescaler 8 for Read */
/* Mean SPI baudrate is set to 72/8 = 9 MHz */
heval_Spi.Instance->CR1 &= 0xFFC7;
heval_Spi.Instance->CR1 |= SPI_BAUDRATEPRESCALER_8;
/* Send Reg value to Read */
LCD_IO_WriteReg(Reg);
/* Reset LCD control line(/CS) and Send command */
LCD_CS_LOW();
/* Send Start Byte */
SPIx_Write(START_BYTE | LCD_READ_REG);
/* Read Upper Byte */
SPIx_Write(0xFF);
readvalue = SPIx_Read();
readvalue = readvalue << 8;
readvalue |= SPIx_Read();
/* Recover Baud Rate initial value */
heval_Spi.Instance->CR1 &= 0xFFC7;
heval_Spi.Instance->CR1 |= heval_Spi.Init.BaudRatePrescaler;
HAL_Delay(10);
/* Deselect : Chip Select high */
LCD_CS_HIGH();
return readvalue;
}
示例8: ili9325_DrawVLine
/**
* @brief Draw vertical line.
* @param RGB_Code: Specifies the RGB color
* @param Xpos: specifies the X position.
* @param Ypos: specifies the Y position.
* @param Length: specifies the Line length.
* @retval None
*/
void ili9325_DrawVLine(uint16_t RGB_Code, uint16_t Xpos, uint16_t Ypos, uint16_t Length)
{
uint16_t i = 0;
/* set GRAM write direction and BGR = 1 */
/* I/D=00 (Horizontal : increment, Vertical : decrement) */
/* AM=1 (address is updated in vertical writing direction) */
ili9325_WriteReg(LCD_REG_3, 0x1010);
/* Set Cursor */
ili9325_SetCursor(Xpos, Ypos);
/* Prepare to write GRAM */
LCD_IO_WriteReg(LCD_REG_34);
for(i = 0; i < Length; i++)
{
/* Write 16-bit GRAM Reg */
LCD_IO_WriteData(RGB_Code);
}
/* set GRAM write direction and BGR = 1 */
/* I/D=00 (Horizontal : increment, Vertical : decrement) */
/* AM=1 (address is updated in vertical writing direction) */
ili9325_WriteReg(LCD_REG_3, 0x1018);
}
示例9: spfd5408_DrawVLine
/**
* @brief Draw vertical line.
* @param RGBCode: Specifies the RGB color
* @param Xpos: specifies the X position.
* @param Ypos: specifies the Y position.
* @param Length: specifies the Line length.
* @retval None
*/
void spfd5408_DrawVLine(uint16_t RGBCode, uint16_t Xpos, uint16_t Ypos, uint16_t Length)
{
uint16_t counter = 0;
/* set GRAM write direction and BGR = 1 */
/* I/D=00 (Horizontal : increment, Vertical : decrement) */
/* AM=1 (address is updated in vertical writing direction) */
spfd5408_WriteReg(LCD_REG_3, 0x1010);
/* Set Cursor */
spfd5408_SetCursor(Xpos, Ypos);
/* Prepare to write GRAM */
LCD_IO_WriteReg(LCD_REG_34);
/* Fill a complete vertical line */
for(counter = 0; counter < Length; counter++)
{
ArrayRGB[counter] = RGBCode;
}
/* Write 16-bit GRAM Reg */
LCD_IO_WriteData((uint8_t*)&ArrayRGB[0], Length * 2);
/* set GRAM write direction and BGR = 1 */
/* I/D=00 (Horizontal : increment, Vertical : decrement) */
/* AM=1 (address is updated in vertical writing direction) */
spfd5408_WriteReg(LCD_REG_3, 0x1018);
}
示例10: ili9325_ReadReg
/**
* @brief Reads the selected LCD Register.
* @param LCD_Reg: address of the selected register.
* @retval LCD Register Value.
*/
uint16_t ili9325_ReadReg(uint8_t LCD_Reg)
{
/* Write 16-bit Index (then Read Reg) */
LCD_IO_WriteReg(LCD_Reg);
/* Read 16-bit Reg */
return (LCD_IO_ReadData());
}
示例11: ili9325_WritePixel
/**
* @brief Write pixel.
* @param Xpos: specifies the X position.
* @param Ypos: specifies the Y position.
* @param RGB_Code: the RGB pixel color
* @retval None
*/
void ili9325_WritePixel(uint16_t Xpos, uint16_t Ypos, uint16_t RGB_Code)
{
/* Set Cursor */
ili9325_SetCursor(Xpos, Ypos);
/* Prepare to write GRAM */
LCD_IO_WriteReg(LCD_REG_34);
/* Write 16-bit GRAM Reg */
LCD_IO_WriteData(RGB_Code);
}
示例12: spfd5408_WritePixel
/**
* @brief Write pixel.
* @param Xpos: specifies the X position.
* @param Ypos: specifies the Y position.
* @param RGBCode: the RGB pixel color
* @retval None
*/
void spfd5408_WritePixel(uint16_t Xpos, uint16_t Ypos, uint16_t RGBCode)
{
/* Set Cursor */
spfd5408_SetCursor(Xpos, Ypos);
/* Prepare to write GRAM */
LCD_IO_WriteReg(LCD_REG_34);
/* Write 16-bit GRAM Reg */
LCD_IO_WriteData((uint8_t*)&RGBCode, 2);
}
示例13: ili9325_ReadPixel
/**
* @brief Read pixel.
* @param None
* @retval The RGB pixel color
*/
uint16_t ili9325_ReadPixel(uint16_t Xpos, uint16_t Ypos)
{
/* Set Cursor */
ili9325_SetCursor(Xpos, Ypos);
/* Prepare to write GRAM */
LCD_IO_WriteReg(LCD_REG_34);
/* Dummy read */
LCD_IO_ReadData();
/* Read 16-bit Reg */
return (LCD_IO_ReadData());
}
示例14: st7735_SetDisplayWindow
/**
* @brief Sets a display window
* @param Xpos: specifies the X bottom left position.
* @param Ypos: specifies the Y bottom left position.
* @param Height: display window height.
* @param Width: display window width.
* @retval None
*/
void st7735_SetDisplayWindow(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
{
uint8_t data = 0;
/* Column addr set, 4 args, no delay: XSTART = Xpos, XEND = (Xpos + Width - 1) */
LCD_IO_WriteReg(LCD_REG_42);
data = (Xpos) >> 8;
LCD_IO_WriteMultipleData(&data, 1);
data = (Xpos) & 0xFF;
LCD_IO_WriteMultipleData(&data, 1);
data = (Xpos + Width - 1) >> 8;
LCD_IO_WriteMultipleData(&data, 1);
data = (Xpos + Width - 1) & 0xFF;
LCD_IO_WriteMultipleData(&data, 1);
/* Row addr set, 4 args, no delay: YSTART = Ypos, YEND = (Ypos + Height - 1) */
LCD_IO_WriteReg(LCD_REG_43);
data = (Ypos) >> 8;
LCD_IO_WriteMultipleData(&data, 1);
data = (Ypos) & 0xFF;
LCD_IO_WriteMultipleData(&data, 1);
data = (Ypos + Height - 1) >> 8;
LCD_IO_WriteMultipleData(&data, 1);
data = (Ypos + Height - 1) & 0xFF;
LCD_IO_WriteMultipleData(&data, 1);
}
示例15: ili9325_DrawHLine
/**
* @brief Draw vertical line.
* @param RGB_Code: Specifies the RGB color
* @param Xpos: specifies the X position.
* @param Ypos: specifies the Y position.
* @param Length: specifies the Line length.
* @retval None
*/
void ili9325_DrawHLine(uint16_t RGB_Code, uint16_t Xpos, uint16_t Ypos, uint16_t Length)
{
uint16_t i = 0;
/* Set Cursor */
ili9325_SetCursor(Xpos, Ypos);
/* Prepare to write GRAM */
LCD_IO_WriteReg(LCD_REG_34);
for(i = 0; i < Length; i++)
{
/* Write 16-bit GRAM Reg */
LCD_IO_WriteData(RGB_Code);
}
}