/*******************************************************************************
* 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;