Display orange FT logo
Every second column appears to be switched
This commit is contained in:
parent
528134d084
commit
4ed89f3c19
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,12 @@
|
|||
#ifndef __HX8357D_H
|
||||
#define __HX8357D_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
void HX8357D_WriteData(uint8_t *data, size_t data_len);
|
||||
void HX8357D_WriteReg(uint8_t addr, uint8_t *data, size_t data_len);
|
||||
void HX8357D_Init();
|
||||
void HX8357D_Mode_RGB666();
|
||||
|
||||
#endif // __HX8357D_H
|
|
@ -85,6 +85,10 @@ void Error_Handler(void);
|
|||
#define STATUS2_GPIO_Port GPIOA
|
||||
#define PWM_BACKLIGHT_Pin GPIO_PIN_3
|
||||
#define PWM_BACKLIGHT_GPIO_Port GPIOA
|
||||
#define DISPSPI_SCL_Pin GPIO_PIN_5
|
||||
#define DISPSPI_SCL_GPIO_Port GPIOA
|
||||
#define DISPSPI_SDA_Pin GPIO_PIN_7
|
||||
#define DISPSPI_SDA_GPIO_Port GPIOA
|
||||
#define PWM_R_Pin GPIO_PIN_9
|
||||
#define PWM_R_GPIO_Port GPIOE
|
||||
#define PWM_G_Pin GPIO_PIN_11
|
||||
|
|
|
@ -0,0 +1,99 @@
|
|||
#include "hx8357d.h"
|
||||
|
||||
#include "main.h"
|
||||
|
||||
void HX8357D_WriteData(uint8_t *data, size_t data_len) {
|
||||
for (size_t byte = 0; byte < data_len; byte++) {
|
||||
for (size_t bit = 0; bit < 8; bit++) {
|
||||
GPIO_PinState state =
|
||||
((data[byte] >> (7 - bit)) & 1) ? GPIO_PIN_SET : GPIO_PIN_RESET;
|
||||
HAL_GPIO_WritePin(DISPSPI_SCL_GPIO_Port, DISPSPI_SCL_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(DISPSPI_SDA_GPIO_Port, DISPSPI_SDA_Pin, state);
|
||||
HAL_Delay(1);
|
||||
HAL_GPIO_WritePin(DISPSPI_SCL_GPIO_Port, DISPSPI_SCL_Pin, GPIO_PIN_SET);
|
||||
HAL_Delay(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void HX8357D_WriteReg(uint8_t addr, uint8_t *data, size_t data_len) {
|
||||
HAL_GPIO_WritePin(DISPSPI_CSX_GPIO_Port, DISPSPI_CSX_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(DISPSPI_DCX_GPIO_Port, DISPSPI_DCX_Pin, GPIO_PIN_RESET);
|
||||
HAL_Delay(1);
|
||||
|
||||
HX8357D_WriteData(&addr, 1);
|
||||
HAL_GPIO_WritePin(DISPSPI_DCX_GPIO_Port, DISPSPI_DCX_Pin, GPIO_PIN_SET);
|
||||
HAL_Delay(1);
|
||||
|
||||
if (data_len > 0) {
|
||||
HX8357D_WriteData(data, data_len);
|
||||
}
|
||||
HAL_GPIO_WritePin(DISPSPI_CSX_GPIO_Port, DISPSPI_CSX_Pin, GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
void HX8357D_Init() {
|
||||
HAL_GPIO_WritePin(DISPSPI_CSX_GPIO_Port, DISPSPI_CSX_Pin, GPIO_PIN_SET);
|
||||
HAL_GPIO_WritePin(DISPSPI_SCL_GPIO_Port, DISPSPI_SCL_Pin, GPIO_PIN_SET);
|
||||
HAL_GPIO_WritePin(DISP_RESET_GPIO_Port, DISP_RESET_Pin, GPIO_PIN_RESET);
|
||||
HAL_Delay(150);
|
||||
HAL_GPIO_WritePin(DISP_RESET_GPIO_Port, DISP_RESET_Pin, GPIO_PIN_SET);
|
||||
HAL_Delay(150);
|
||||
}
|
||||
|
||||
void HX8357D_Mode_RGB666() {
|
||||
// B9h: Enable extended commands
|
||||
uint8_t data0[] = {0xFF, 0x83, 0x57};
|
||||
HX8357D_WriteReg(0xB9, data0, sizeof(data0));
|
||||
// B1h: Set power control
|
||||
uint8_t data1[] = {0x00, 0x16, 0x1C, 0x1C, 0xC3, 0x5C};
|
||||
HX8357D_WriteReg(0xB1, data1, sizeof(data1));
|
||||
// B3h: Set RGB interface
|
||||
// Disable SDO pin
|
||||
// Write directly to display (not internal GRAM)
|
||||
// Data read on rising edge of DCLK
|
||||
// HSYNC & VSYNC Activ low
|
||||
// DE Active high
|
||||
// Horizontal back porch 5
|
||||
// Vertical back porch 2
|
||||
uint8_t data2[] = {0x53, 0x00, 0x05, 0x02};
|
||||
HX8357D_WriteReg(0xB3, data2, sizeof(data2));
|
||||
// SET cyc
|
||||
uint8_t data3[] = {0x32, 0x40, 0x00, 0x2A, 0x2A, 0x0D, 0x78};
|
||||
HX8357D_WriteReg(0xB4, data3, sizeof(data3));
|
||||
// VCOMDC
|
||||
uint8_t data4[] = {0x3C};
|
||||
HX8357D_WriteReg(0xB6, data4, sizeof(data4));
|
||||
// SET STBA
|
||||
uint8_t data5[] = {0x70, 0x50, 0x01, 0x3C, 0xC8, 0x08};
|
||||
HX8357D_WriteReg(0xC0, data5, sizeof(data5));
|
||||
// SET panel
|
||||
uint8_t data6[] = {0x0B};
|
||||
HX8357D_WriteReg(0xCC, data6, sizeof(data6));
|
||||
// VCOMDC
|
||||
uint8_t data7[] = {0x40};
|
||||
HX8357D_WriteReg(0xB6, data7, sizeof(data7));
|
||||
// Gamma
|
||||
uint8_t data8[] = {0x02, 0x0A, 0x10, 0x1A, 0x22, 0x34, 0x41, 0x4A, 0x4D,
|
||||
0x44, 0x3A, 0x23, 0x19, 0x08, 0x09, 0x03, 0x02, 0x0A,
|
||||
0x10, 0x1A, 0x22, 0x34, 0x41, 0x4A, 0x4D, 0x44, 0x3A,
|
||||
0x23, 0x19, 0x08, 0x09, 0x03, 0x00, 0x01};
|
||||
HX8357D_WriteReg(0xE0, data8, sizeof(data8));
|
||||
// Display cycle register
|
||||
uint8_t data9[] = {0x00};
|
||||
HX8357D_WriteReg(0xB4, data9, sizeof(data9));
|
||||
// SET BGP
|
||||
uint8_t data10[] = {0x03, 0x03, 0x03};
|
||||
HX8357D_WriteReg(0xB5, data10, sizeof(data10));
|
||||
// ?
|
||||
uint8_t data11[] = {0xB0, 0x22, 0x3B};
|
||||
HX8357D_WriteReg(0xB6, data11, sizeof(data11));
|
||||
// COLMOD
|
||||
uint8_t data12[] = {0x66};
|
||||
HX8357D_WriteReg(0x3A, data12, sizeof(data12));
|
||||
// Sleep out
|
||||
HX8357D_WriteReg(0x11, NULL, 0);
|
||||
// Normal display mode
|
||||
HX8357D_WriteReg(0x13, NULL, 0);
|
||||
// Display on
|
||||
HX8357D_WriteReg(0x29, NULL, 0);
|
||||
}
|
108
Core/Src/main.c
108
Core/Src/main.c
|
@ -21,6 +21,8 @@
|
|||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
#include "ft_logo_orange_rgb565.h"
|
||||
#include "hx8357d.h"
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
|
@ -50,7 +52,6 @@ LTDC_HandleTypeDef hltdc;
|
|||
|
||||
OSPI_HandleTypeDef hospi1;
|
||||
|
||||
SPI_HandleTypeDef hspi1;
|
||||
SPI_HandleTypeDef hspi3;
|
||||
|
||||
TIM_HandleTypeDef htim1;
|
||||
|
@ -69,7 +70,6 @@ static void MX_FDCAN1_Init(void);
|
|||
static void MX_LTDC_Init(void);
|
||||
static void MX_JPEG_Init(void);
|
||||
static void MX_OCTOSPI1_Init(void);
|
||||
static void MX_SPI1_Init(void);
|
||||
static void MX_SPI3_Init(void);
|
||||
static void MX_TIM1_Init(void);
|
||||
static void MX_TIM2_Init(void);
|
||||
|
@ -116,7 +116,6 @@ int main(void) {
|
|||
MX_LTDC_Init();
|
||||
MX_JPEG_Init();
|
||||
MX_OCTOSPI1_Init();
|
||||
MX_SPI1_Init();
|
||||
MX_SPI3_Init();
|
||||
MX_TIM1_Init();
|
||||
MX_TIM2_Init();
|
||||
|
@ -125,6 +124,10 @@ int main(void) {
|
|||
if (HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4) != HAL_OK) {
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
HX8357D_Init();
|
||||
HX8357D_Mode_RGB666();
|
||||
HAL_Delay(500);
|
||||
/* USER CODE END 2 */
|
||||
|
||||
/* Infinite loop */
|
||||
|
@ -327,7 +330,6 @@ static void MX_LTDC_Init(void) {
|
|||
/* USER CODE END LTDC_Init 0 */
|
||||
|
||||
LTDC_LayerCfgTypeDef pLayerCfg = {0};
|
||||
LTDC_LayerCfgTypeDef pLayerCfg1 = {0};
|
||||
|
||||
/* USER CODE BEGIN LTDC_Init 1 */
|
||||
|
||||
|
@ -335,7 +337,7 @@ static void MX_LTDC_Init(void) {
|
|||
hltdc.Instance = LTDC;
|
||||
hltdc.Init.HSPolarity = LTDC_HSPOLARITY_AL;
|
||||
hltdc.Init.VSPolarity = LTDC_VSPOLARITY_AL;
|
||||
hltdc.Init.DEPolarity = LTDC_DEPOLARITY_AH;
|
||||
hltdc.Init.DEPolarity = LTDC_DEPOLARITY_AL;
|
||||
hltdc.Init.PCPolarity = LTDC_PCPOLARITY_IPC;
|
||||
hltdc.Init.HorizontalSync = 4;
|
||||
hltdc.Init.VerticalSync = 1;
|
||||
|
@ -352,41 +354,23 @@ static void MX_LTDC_Init(void) {
|
|||
Error_Handler();
|
||||
}
|
||||
pLayerCfg.WindowX0 = 0;
|
||||
pLayerCfg.WindowX1 = 0;
|
||||
pLayerCfg.WindowX1 = 320;
|
||||
pLayerCfg.WindowY0 = 0;
|
||||
pLayerCfg.WindowY1 = 0;
|
||||
pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_ARGB8888;
|
||||
pLayerCfg.Alpha = 0;
|
||||
pLayerCfg.WindowY1 = 480;
|
||||
pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_RGB565;
|
||||
pLayerCfg.Alpha = 255;
|
||||
pLayerCfg.Alpha0 = 0;
|
||||
pLayerCfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_CA;
|
||||
pLayerCfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_CA;
|
||||
pLayerCfg.FBStartAdress = 0;
|
||||
pLayerCfg.ImageWidth = 0;
|
||||
pLayerCfg.ImageHeight = 0;
|
||||
pLayerCfg.FBStartAdress = (uint32_t)&image_data_ft_logo_orange_rgb565;
|
||||
pLayerCfg.ImageWidth = 320;
|
||||
pLayerCfg.ImageHeight = 480;
|
||||
pLayerCfg.Backcolor.Blue = 0;
|
||||
pLayerCfg.Backcolor.Green = 0;
|
||||
pLayerCfg.Backcolor.Red = 0;
|
||||
if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg, 0) != HAL_OK) {
|
||||
Error_Handler();
|
||||
}
|
||||
pLayerCfg1.WindowX0 = 0;
|
||||
pLayerCfg1.WindowX1 = 0;
|
||||
pLayerCfg1.WindowY0 = 0;
|
||||
pLayerCfg1.WindowY1 = 0;
|
||||
pLayerCfg1.PixelFormat = LTDC_PIXEL_FORMAT_ARGB8888;
|
||||
pLayerCfg1.Alpha = 0;
|
||||
pLayerCfg1.Alpha0 = 0;
|
||||
pLayerCfg1.BlendingFactor1 = LTDC_BLENDING_FACTOR1_CA;
|
||||
pLayerCfg1.BlendingFactor2 = LTDC_BLENDING_FACTOR2_CA;
|
||||
pLayerCfg1.FBStartAdress = 0;
|
||||
pLayerCfg1.ImageWidth = 0;
|
||||
pLayerCfg1.ImageHeight = 0;
|
||||
pLayerCfg1.Backcolor.Blue = 0;
|
||||
pLayerCfg1.Backcolor.Green = 0;
|
||||
pLayerCfg1.Backcolor.Red = 0;
|
||||
if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg1, 1) != HAL_OK) {
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN LTDC_Init 2 */
|
||||
|
||||
/* USER CODE END LTDC_Init 2 */
|
||||
|
@ -440,53 +424,6 @@ static void MX_OCTOSPI1_Init(void) {
|
|||
/* USER CODE END OCTOSPI1_Init 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief SPI1 Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_SPI1_Init(void) {
|
||||
|
||||
/* USER CODE BEGIN SPI1_Init 0 */
|
||||
|
||||
/* USER CODE END SPI1_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN SPI1_Init 1 */
|
||||
|
||||
/* USER CODE END SPI1_Init 1 */
|
||||
/* SPI1 parameter configuration*/
|
||||
hspi1.Instance = SPI1;
|
||||
hspi1.Init.Mode = SPI_MODE_MASTER;
|
||||
hspi1.Init.Direction = SPI_DIRECTION_1LINE;
|
||||
hspi1.Init.DataSize = SPI_DATASIZE_4BIT;
|
||||
hspi1.Init.CLKPolarity = SPI_POLARITY_LOW;
|
||||
hspi1.Init.CLKPhase = SPI_PHASE_1EDGE;
|
||||
hspi1.Init.NSS = SPI_NSS_HARD_OUTPUT;
|
||||
hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2;
|
||||
hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB;
|
||||
hspi1.Init.TIMode = SPI_TIMODE_DISABLE;
|
||||
hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
|
||||
hspi1.Init.CRCPolynomial = 0x0;
|
||||
hspi1.Init.NSSPMode = SPI_NSS_PULSE_ENABLE;
|
||||
hspi1.Init.NSSPolarity = SPI_NSS_POLARITY_LOW;
|
||||
hspi1.Init.FifoThreshold = SPI_FIFO_THRESHOLD_01DATA;
|
||||
hspi1.Init.TxCRCInitializationPattern =
|
||||
SPI_CRC_INITIALIZATION_ALL_ZERO_PATTERN;
|
||||
hspi1.Init.RxCRCInitializationPattern =
|
||||
SPI_CRC_INITIALIZATION_ALL_ZERO_PATTERN;
|
||||
hspi1.Init.MasterSSIdleness = SPI_MASTER_SS_IDLENESS_00CYCLE;
|
||||
hspi1.Init.MasterInterDataIdleness = SPI_MASTER_INTERDATA_IDLENESS_00CYCLE;
|
||||
hspi1.Init.MasterReceiverAutoSusp = SPI_MASTER_RX_AUTOSUSP_DISABLE;
|
||||
hspi1.Init.MasterKeepIOState = SPI_MASTER_KEEP_IO_STATE_DISABLE;
|
||||
hspi1.Init.IOSwap = SPI_IO_SWAP_DISABLE;
|
||||
if (HAL_SPI_Init(&hspi1) != HAL_OK) {
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN SPI1_Init 2 */
|
||||
|
||||
/* USER CODE END SPI1_Init 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief SPI3 Initialization Function
|
||||
* @param None
|
||||
|
@ -730,13 +667,16 @@ static void MX_GPIO_Init(void) {
|
|||
__HAL_RCC_GPIOG_CLK_ENABLE();
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOA, STATUS1_Pin | STATUS2_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(
|
||||
GPIOA, STATUS1_Pin | STATUS2_Pin | DISPSPI_SCL_Pin | DISPSPI_SDA_Pin,
|
||||
GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(LED_LE_GPIO_Port, LED_LE_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOG, DISPSPI_DCX_Pin | DISP_RESET_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOG, DISPSPI_CSX_Pin | DISPSPI_DCX_Pin | DISP_RESET_Pin,
|
||||
GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(BOOT0_SET_GPIO_Port, BOOT0_SET_Pin, GPIO_PIN_RESET);
|
||||
|
@ -755,8 +695,10 @@ static void MX_GPIO_Init(void) {
|
|||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : STATUS1_Pin STATUS2_Pin */
|
||||
GPIO_InitStruct.Pin = STATUS1_Pin | STATUS2_Pin;
|
||||
/*Configure GPIO pins : STATUS1_Pin STATUS2_Pin DISPSPI_SCL_Pin
|
||||
* DISPSPI_SDA_Pin */
|
||||
GPIO_InitStruct.Pin =
|
||||
STATUS1_Pin | STATUS2_Pin | DISPSPI_SCL_Pin | DISPSPI_SDA_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
|
@ -769,8 +711,8 @@ static void MX_GPIO_Init(void) {
|
|||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(LED_LE_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : DISPSPI_DCX_Pin DISP_RESET_Pin */
|
||||
GPIO_InitStruct.Pin = DISPSPI_DCX_Pin | DISP_RESET_Pin;
|
||||
/*Configure GPIO pins : DISPSPI_CSX_Pin DISPSPI_DCX_Pin DISP_RESET_Pin */
|
||||
GPIO_InitStruct.Pin = DISPSPI_CSX_Pin | DISPSPI_DCX_Pin | DISP_RESET_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
|
|
|
@ -561,50 +561,7 @@ void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)
|
|||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
|
||||
if(hspi->Instance==SPI1)
|
||||
{
|
||||
/* USER CODE BEGIN SPI1_MspInit 0 */
|
||||
|
||||
/* USER CODE END SPI1_MspInit 0 */
|
||||
|
||||
/** Initializes the peripherals clock
|
||||
*/
|
||||
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_SPI1;
|
||||
PeriphClkInitStruct.Spi123ClockSelection = RCC_SPI123CLKSOURCE_PLL;
|
||||
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_SPI1_CLK_ENABLE();
|
||||
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOG_CLK_ENABLE();
|
||||
/**SPI1 GPIO Configuration
|
||||
PA5 ------> SPI1_SCK
|
||||
PA7 ------> SPI1_MOSI
|
||||
PG10 ------> SPI1_NSS
|
||||
*/
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_5|GPIO_PIN_7;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF5_SPI1;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
GPIO_InitStruct.Pin = DISPSPI_CSX_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF5_SPI1;
|
||||
HAL_GPIO_Init(DISPSPI_CSX_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN SPI1_MspInit 1 */
|
||||
|
||||
/* USER CODE END SPI1_MspInit 1 */
|
||||
}
|
||||
else if(hspi->Instance==SPI3)
|
||||
if(hspi->Instance==SPI3)
|
||||
{
|
||||
/* USER CODE BEGIN SPI3_MspInit 0 */
|
||||
|
||||
|
@ -649,28 +606,7 @@ void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)
|
|||
*/
|
||||
void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
|
||||
{
|
||||
if(hspi->Instance==SPI1)
|
||||
{
|
||||
/* USER CODE BEGIN SPI1_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END SPI1_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_SPI1_CLK_DISABLE();
|
||||
|
||||
/**SPI1 GPIO Configuration
|
||||
PA5 ------> SPI1_SCK
|
||||
PA7 ------> SPI1_MOSI
|
||||
PG10 ------> SPI1_NSS
|
||||
*/
|
||||
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_5|GPIO_PIN_7);
|
||||
|
||||
HAL_GPIO_DeInit(DISPSPI_CSX_GPIO_Port, DISPSPI_CSX_Pin);
|
||||
|
||||
/* USER CODE BEGIN SPI1_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END SPI1_MspDeInit 1 */
|
||||
}
|
||||
else if(hspi->Instance==SPI3)
|
||||
if(hspi->Instance==SPI3)
|
||||
{
|
||||
/* USER CODE BEGIN SPI3_MspDeInit 0 */
|
||||
|
||||
|
|
2
Makefile
2
Makefile
|
@ -1,5 +1,5 @@
|
|||
##########################################################################################################################
|
||||
# File automatically-generated by tool: [projectgenerator] version: [3.17.1] date: [Sun Mar 05 15:27:58 CET 2023]
|
||||
# File automatically-generated by tool: [projectgenerator] version: [3.17.1] date: [Sun Mar 05 15:46:07 CET 2023]
|
||||
##########################################################################################################################
|
||||
|
||||
# ------------------------------------------------
|
||||
|
|
|
@ -36,6 +36,7 @@ BUILD_DIR = build
|
|||
######################################
|
||||
# C sources
|
||||
C_SOURCES = \
|
||||
Core/Src/hx8357d.c \
|
||||
Core/Src/main.c \
|
||||
Core/Src/stm32h7xx_hal_msp.c \
|
||||
Core/Src/stm32h7xx_it.c \
|
||||
|
|
|
@ -12,21 +12,27 @@ JPEG.IPParameters=JPEG_RGB_FORMAT
|
|||
JPEG.JPEG_RGB_FORMAT=JPEG_RGB888
|
||||
KeepUserPlacement=false
|
||||
LTDC.ActiveW=320
|
||||
LTDC.DEPolarity=LTDC_DEPOLARITY_AH
|
||||
LTDC.Alpha_L0=255
|
||||
LTDC.DEPolarity=LTDC_DEPOLARITY_AL
|
||||
LTDC.HBP=5
|
||||
LTDC.HFP=5
|
||||
LTDC.HSync=5
|
||||
LTDC.IPParameters=HSync,HBP,HFP,ActiveW,VSync,DEPolarity
|
||||
LTDC.IPParameters=HSync,HBP,HFP,ActiveW,VSync,DEPolarity,Layers,WindowX1_L0,WindowY1_L0,PixelFormat_L0,Alpha_L0,ImageWidth_L0,ImageHeight_L0
|
||||
LTDC.ImageHeight_L0=480
|
||||
LTDC.ImageWidth_L0=320
|
||||
LTDC.Layers=0
|
||||
LTDC.PixelFormat_L0=LTDC_PIXEL_FORMAT_RGB565
|
||||
LTDC.VSync=2
|
||||
LTDC.WindowX1_L0=320
|
||||
LTDC.WindowY1_L0=480
|
||||
Mcu.CPN=STM32H7A3ZIT6
|
||||
Mcu.Family=STM32H7
|
||||
Mcu.IP0=CORTEX_M7
|
||||
Mcu.IP1=DEBUG
|
||||
Mcu.IP10=SPI3
|
||||
Mcu.IP11=SYS
|
||||
Mcu.IP12=TIM1
|
||||
Mcu.IP13=TIM2
|
||||
Mcu.IP14=TIM4
|
||||
Mcu.IP10=SYS
|
||||
Mcu.IP11=TIM1
|
||||
Mcu.IP12=TIM2
|
||||
Mcu.IP13=TIM4
|
||||
Mcu.IP2=DMA2D
|
||||
Mcu.IP3=FDCAN1
|
||||
Mcu.IP4=JPEG
|
||||
|
@ -34,8 +40,8 @@ Mcu.IP5=LTDC
|
|||
Mcu.IP6=NVIC
|
||||
Mcu.IP7=OCTOSPI1
|
||||
Mcu.IP8=RCC
|
||||
Mcu.IP9=SPI1
|
||||
Mcu.IPNb=15
|
||||
Mcu.IP9=SPI3
|
||||
Mcu.IPNb=14
|
||||
Mcu.Name=STM32H7A3Z(G-I)Tx
|
||||
Mcu.Package=LQFP144
|
||||
Mcu.Pin0=PE2
|
||||
|
@ -156,12 +162,14 @@ PA3.Signal=S_TIM2_CH4
|
|||
PA4.Locked=true
|
||||
PA4.Mode=RGB666
|
||||
PA4.Signal=LTDC_VSYNC
|
||||
PA5.GPIOParameters=GPIO_Label
|
||||
PA5.GPIO_Label=DISPSPI_SCL
|
||||
PA5.Locked=true
|
||||
PA5.Mode=Simplex_Bidirectional_Master
|
||||
PA5.Signal=SPI1_SCK
|
||||
PA5.Signal=GPIO_Output
|
||||
PA7.GPIOParameters=GPIO_Label
|
||||
PA7.GPIO_Label=DISPSPI_SDA
|
||||
PA7.Locked=true
|
||||
PA7.Mode=Simplex_Bidirectional_Master
|
||||
PA7.Signal=SPI1_MOSI
|
||||
PA7.Signal=GPIO_Output
|
||||
PA8.Locked=true
|
||||
PA8.Mode=RGB666
|
||||
PA8.Signal=LTDC_R6
|
||||
|
@ -323,8 +331,7 @@ PF9.Signal=OCTOSPIM_P1_IO1
|
|||
PG10.GPIOParameters=GPIO_Label
|
||||
PG10.GPIO_Label=DISPSPI_CSX
|
||||
PG10.Locked=true
|
||||
PG10.Mode=NSS_Signal_Hard_Output
|
||||
PG10.Signal=SPI1_NSS
|
||||
PG10.Signal=GPIO_Output
|
||||
PG12.GPIOParameters=GPIO_Label
|
||||
PG12.GPIO_Label=DISPSPI_DCX
|
||||
PG12.Locked=true
|
||||
|
@ -370,7 +377,7 @@ ProjectManager.StackSize=0x400
|
|||
ProjectManager.TargetToolchain=Makefile
|
||||
ProjectManager.ToolChainLocation=
|
||||
ProjectManager.UnderRoot=false
|
||||
ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_DMA2D_Init-DMA2D-false-HAL-true,4-MX_FDCAN1_Init-FDCAN1-false-HAL-true,5-MX_LTDC_Init-LTDC-false-HAL-true,6-MX_JPEG_Init-JPEG-false-HAL-true,7-MX_OCTOSPI1_Init-OCTOSPI1-false-HAL-true,8-MX_SPI1_Init-SPI1-false-HAL-true,9-MX_SPI3_Init-SPI3-false-HAL-true,10-MX_TIM1_Init-TIM1-false-HAL-true,11-MX_TIM2_Init-TIM2-false-HAL-true,12-MX_TIM4_Init-TIM4-false-HAL-true,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true
|
||||
ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_DMA2D_Init-DMA2D-false-HAL-true,4-MX_FDCAN1_Init-FDCAN1-false-HAL-true,5-MX_LTDC_Init-LTDC-false-HAL-true,6-MX_JPEG_Init-JPEG-false-HAL-true,7-MX_OCTOSPI1_Init-OCTOSPI1-false-HAL-true,8-MX_SPI1_Init-SPI1-false-HAL-true,8-MX_SPI3_Init-SPI3-false-HAL-true,9-MX_TIM1_Init-TIM1-false-HAL-true,10-MX_TIM2_Init-TIM2-false-HAL-true,11-MX_TIM4_Init-TIM4-false-HAL-true,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true
|
||||
RCC.ADCFreq_Value=129000000
|
||||
RCC.AHB12Freq_Value=64000000
|
||||
RCC.AHB4Freq_Value=64000000
|
||||
|
@ -464,13 +471,6 @@ SH.S_TIM4_CH1.0=TIM4_CH1,PWM Generation1 CH1
|
|||
SH.S_TIM4_CH1.ConfNb=1
|
||||
SH.S_TIM4_CH2.0=TIM4_CH2,PWM Generation2 CH2
|
||||
SH.S_TIM4_CH2.ConfNb=1
|
||||
SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_2
|
||||
SPI1.CalculateBaudRate=500.0 KBits/s
|
||||
SPI1.Direction=SPI_DIRECTION_1LINE
|
||||
SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,VirtualNSS,BaudRatePrescaler
|
||||
SPI1.Mode=SPI_MODE_MASTER
|
||||
SPI1.VirtualNSS=VM_NSSHARD
|
||||
SPI1.VirtualType=VM_MASTER
|
||||
SPI3.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_2
|
||||
SPI3.CalculateBaudRate=500.0 KBits/s
|
||||
SPI3.Direction=SPI_DIRECTION_2LINES_TXONLY
|
||||
|
|
Loading…
Reference in New Issue