/*******************************************************************************
* Function Name : SPI_LCD_SendByte
* Description : Sends a byte through the SPI interface and return the byte
* received from the SPI bus.
* Input : byte : byte to send.
* Output : None
* Return : The value of the received byte.
*******************************************************************************/
uint8_t SPI_LCD_SendByte(uint8_t byte)
{
/* Loop while DR register in not emplty */
while (SPI_I2S_GetFlagStatus(SPI2, SPI_I2S_FLAG_TXE) == RESET);
/* Send byte through the SPI1 peripheral */
SPI_SendData8(SPI2, byte);
/* Wait to receive a byte */
while (SPI_I2S_GetFlagStatus(SPI2, SPI_I2S_FLAG_RXNE) == RESET);
/* Return the byte read from the SPI bus */
return SPI_ReceiveData8(SPI2);
}
//**********显示带白框的黑色图片************//
void Frame(void)
{
int i,j,k;
DISP_WINDOWS();
for (i=Width;i>0;i--)
{
LCD_Write_Data(WHITE);
}
for (j=Height-2;j>0;j--)
{
LCD_Write_Data(WHITE);
for (k=Width-2;k>0;k--)
{
LCD_Write_Data(BLACK);
}
LCD_Write_Data(WHITE);
}
for (i=Width;i>0;i--)
{
LCD_Write_Data(WHITE);
}
// HOLD_DISP ();
}
/*蓝牙图标*/
显示图标的代码如下:
typedef struct __st_icon
{
unsigned short x;//图标X轴起始点
unsigned short y;//图标Y轴起始点
unsigned short w;//图标宽度
unsigned short h;//图标高度
unsigned short len;
unsigned short color;//图标颜色
const unsigned char *dat;//图标取模得到的数据
} st_icon;