Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ILI9341_GFX.c #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions Src/ILI9341/ILI9341_GFX.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ void ILI9341_Draw_Image(const char* Image_Array, uint8_t Orientation)
ILI9341_Set_Rotation(SCREEN_HORIZONTAL_1);
ILI9341_Set_Address(0,0,ILI9341_SCREEN_WIDTH,ILI9341_SCREEN_HEIGHT);

HAL_GPIO_WritePin(GPIOC, DC_Pin, GPIO_PIN_SET);
HAL_GPIO_WritePin(GPIOC, CS_Pin, GPIO_PIN_RESET);
HAL_GPIO_WritePin(LCD_DC_PORT, LCD_DC_PIN, GPIO_PIN_SET);
HAL_GPIO_WritePin(LCD_CS_PORT, LCD_CS_PIN, GPIO_PIN_RESET);

unsigned char Temp_small_buffer[BURST_MAX_SIZE];
uint32_t counter = 0;
Expand All @@ -289,18 +289,18 @@ void ILI9341_Draw_Image(const char* Image_Array, uint8_t Orientation)
{
Temp_small_buffer[k] = Image_Array[counter+k];
}
HAL_SPI_Transmit(&hspi5, (unsigned char*)Temp_small_buffer, BURST_MAX_SIZE, 10);
HAL_SPI_Transmit(HSPI_INSTANCE, (unsigned char*)Temp_small_buffer, BURST_MAX_SIZE, 10);
counter += BURST_MAX_SIZE;
}
HAL_GPIO_WritePin(GPIOC, CS_Pin, GPIO_PIN_SET);
HAL_GPIO_WritePin(LCD_CS_PORT, LCD_CS_PIN, GPIO_PIN_SET);
}
else if(Orientation == SCREEN_HORIZONTAL_2)
{
ILI9341_Set_Rotation(SCREEN_HORIZONTAL_2);
ILI9341_Set_Address(0,0,ILI9341_SCREEN_WIDTH,ILI9341_SCREEN_HEIGHT);

HAL_GPIO_WritePin(GPIOC, DC_Pin, GPIO_PIN_SET);
HAL_GPIO_WritePin(GPIOC, CS_Pin, GPIO_PIN_RESET);
HAL_GPIO_WritePin(LCD_DC_PORT, LCD_DC_PIN, GPIO_PIN_SET);
HAL_GPIO_WritePin(LCD_CS_PORT, LCD_CS_PIN, GPIO_PIN_RESET);

unsigned char Temp_small_buffer[BURST_MAX_SIZE];
uint32_t counter = 0;
Expand All @@ -310,18 +310,18 @@ void ILI9341_Draw_Image(const char* Image_Array, uint8_t Orientation)
{
Temp_small_buffer[k] = Image_Array[counter+k];
}
HAL_SPI_Transmit(&hspi5, (unsigned char*)Temp_small_buffer, BURST_MAX_SIZE, 10);
HAL_SPI_Transmit(HSPI_INSTANCE, (unsigned char*)Temp_small_buffer, BURST_MAX_SIZE, 10);
counter += BURST_MAX_SIZE;
}
HAL_GPIO_WritePin(GPIOC, CS_Pin, GPIO_PIN_SET);
HAL_GPIO_WritePin(LCD_CS_PORT, LCD_CS_PIN, GPIO_PIN_SET);
}
else if(Orientation == SCREEN_VERTICAL_2)
{
ILI9341_Set_Rotation(SCREEN_VERTICAL_2);
ILI9341_Set_Address(0,0,ILI9341_SCREEN_HEIGHT,ILI9341_SCREEN_WIDTH);

HAL_GPIO_WritePin(GPIOC, DC_Pin, GPIO_PIN_SET);
HAL_GPIO_WritePin(GPIOC, CS_Pin, GPIO_PIN_RESET);
HAL_GPIO_WritePin(LCD_DC_PORT, LCD_DC_PIN, GPIO_PIN_SET);
HAL_GPIO_WritePin(LCD_CS_PORT, LCD_CS_PIN, GPIO_PIN_RESET);

unsigned char Temp_small_buffer[BURST_MAX_SIZE];
uint32_t counter = 0;
Expand All @@ -331,18 +331,18 @@ void ILI9341_Draw_Image(const char* Image_Array, uint8_t Orientation)
{
Temp_small_buffer[k] = Image_Array[counter+k];
}
HAL_SPI_Transmit(&hspi5, (unsigned char*)Temp_small_buffer, BURST_MAX_SIZE, 10);
HAL_SPI_Transmit(HSPI_INSTANCE, (unsigned char*)Temp_small_buffer, BURST_MAX_SIZE, 10);
counter += BURST_MAX_SIZE;
}
HAL_GPIO_WritePin(GPIOC, CS_Pin, GPIO_PIN_SET);
HAL_GPIO_WritePin(LCD_CS_PORT, LCD_CS_PIN, GPIO_PIN_SET);
}
else if(Orientation == SCREEN_VERTICAL_1)
{
ILI9341_Set_Rotation(SCREEN_VERTICAL_1);
ILI9341_Set_Address(0,0,ILI9341_SCREEN_HEIGHT,ILI9341_SCREEN_WIDTH);

HAL_GPIO_WritePin(GPIOC, DC_Pin, GPIO_PIN_SET);
HAL_GPIO_WritePin(GPIOC, CS_Pin, GPIO_PIN_RESET);
HAL_GPIO_WritePin(LCD_DC_PORT, LCD_DC_PIN, GPIO_PIN_SET);
HAL_GPIO_WritePin(LCD_CS_PORT, LCD_CS_PIN, GPIO_PIN_RESET);

unsigned char Temp_small_buffer[BURST_MAX_SIZE];
uint32_t counter = 0;
Expand All @@ -352,10 +352,10 @@ void ILI9341_Draw_Image(const char* Image_Array, uint8_t Orientation)
{
Temp_small_buffer[k] = Image_Array[counter+k];
}
HAL_SPI_Transmit(&hspi5, (unsigned char*)Temp_small_buffer, BURST_MAX_SIZE, 10);
HAL_SPI_Transmit(HSPI_INSTANCE, (unsigned char*)Temp_small_buffer, BURST_MAX_SIZE, 10);
counter += BURST_MAX_SIZE;
}
HAL_GPIO_WritePin(GPIOC, CS_Pin, GPIO_PIN_SET);
HAL_GPIO_WritePin(LCD_CS_PORT, LCD_CS_PIN, GPIO_PIN_SET);
}
}

Expand Down