Init prototypes
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
#ifndef DS_ILI3941_H
|
||||
#define DS_ILI3941_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef STM32G030xx
|
||||
#include "stm32g0xx_hal.h"
|
||||
#endif
|
||||
|
||||
#ifdef STM32F030xx
|
||||
#include "stm32f0xx_hal.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif //DS_ILI3941_H
|
||||
60
Inc/DS_ILI9341.h
Normal file
60
Inc/DS_ILI9341.h
Normal file
@@ -0,0 +1,60 @@
|
||||
#ifndef DS_ILI9341_H
|
||||
#define DS_ILI9341_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef STM32G030xx
|
||||
#include "stm32g0xx_hal.h"
|
||||
#endif
|
||||
|
||||
#ifdef STM32F030xx
|
||||
#include "stm32f0xx_hal.h"
|
||||
#endif
|
||||
|
||||
#ifdef STM32F103xB
|
||||
#include "stm32f1xx_hal.h"
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct DS_ILI9341
|
||||
{
|
||||
GPIO_TypeDef* Port_CS, *Port_D0, *Port_D1, *Port_D2, *Port_D3, *Port_D4, *Port_D5, *Port_D6, *Port_D7, *Port_RQ, *Port_RS, *Port_RST, *Port_WR;
|
||||
uint16_t Pin_CS, Pin_D0, Pin_D1, Pin_D2, Pin_D3, Pin_D4, Pin_D5, Pin_D6, Pin_D7, Pin_RQ, Pin_RS, Pin_RST, Pin_WR;
|
||||
|
||||
// SPI_HandleTypeDef* SPI;
|
||||
// char DisplayData[8];
|
||||
// uint8_t Dots;
|
||||
// uint8_t DecodeMode, Intensivity, ScanLimit;
|
||||
// bool EnableDecodeMode;
|
||||
// GPIO_TypeDef* Port_CS;
|
||||
// uint16_t Pin_CS;
|
||||
}DS_ILI9341;
|
||||
|
||||
|
||||
void DS_ILI9341_Init(DS_ILI9341* Display,
|
||||
GPIO_TypeDef* Port_CS, uint16_t Pin_CS,
|
||||
GPIO_TypeDef* Port_D0, uint16_t Pin_D0,
|
||||
GPIO_TypeDef* Port_D1, uint16_t Pin_D1,
|
||||
GPIO_TypeDef* Port_D2, uint16_t Pin_D2,
|
||||
GPIO_TypeDef* Port_D3, uint16_t Pin_D3,
|
||||
GPIO_TypeDef* Port_D4, uint16_t Pin_D4,
|
||||
GPIO_TypeDef* Port_D5, uint16_t Pin_D5,
|
||||
GPIO_TypeDef* Port_D6, uint16_t Pin_D6,
|
||||
GPIO_TypeDef* Port_D7, uint16_t Pin_D7,
|
||||
GPIO_TypeDef* Port_RQ, uint16_t Pin_RQ,
|
||||
GPIO_TypeDef* Port_RS, uint16_t Pin_RS,
|
||||
GPIO_TypeDef* Port_RST, uint16_t Pin_RST,
|
||||
GPIO_TypeDef* Port_WR, uint16_t Pin_WR
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif //DS_ILI9341_H
|
||||
@@ -1,2 +0,0 @@
|
||||
#include "../inc/DS_ILI3941.h"
|
||||
|
||||
46
Src/DS_ILI9341.c
Normal file
46
Src/DS_ILI9341.c
Normal file
@@ -0,0 +1,46 @@
|
||||
#include "../inc/DS_ILI9341.h"
|
||||
|
||||
|
||||
void DS_ILI9341_Init(DS_ILI9341 *Display, GPIO_TypeDef *Port_CS, uint16_t Pin_CS, GPIO_TypeDef *Port_D0, uint16_t Pin_D0, GPIO_TypeDef *Port_D1, uint16_t Pin_D1, GPIO_TypeDef *Port_D2, uint16_t Pin_D2, GPIO_TypeDef *Port_D3, uint16_t Pin_D3, GPIO_TypeDef *Port_D4, uint16_t Pin_D4, GPIO_TypeDef *Port_D5, uint16_t Pin_D5, GPIO_TypeDef *Port_D6, uint16_t Pin_D6, GPIO_TypeDef *Port_D7, uint16_t Pin_D7, GPIO_TypeDef *Port_RQ, uint16_t Pin_RQ, GPIO_TypeDef *Port_RS, uint16_t Pin_RS, GPIO_TypeDef *Port_RST, uint16_t Pin_RST, GPIO_TypeDef *Port_WR, uint16_t Pin_WR)
|
||||
{
|
||||
HAL_Delay(500);
|
||||
|
||||
Display->Port_CS = Port_CS;
|
||||
Display->Pin_CS = Pin_CS;
|
||||
|
||||
Display->Port_D0 = Port_D0;
|
||||
Display->Pin_D0 = Pin_D0;
|
||||
|
||||
Display->Port_D1 = Port_D1;
|
||||
Display->Pin_D1 = Pin_D1;
|
||||
|
||||
Display->Port_D2 = Port_D2;
|
||||
Display->Pin_D2 = Pin_D2;
|
||||
|
||||
Display->Port_D3 = Port_D3;
|
||||
Display->Pin_D3 = Pin_D3;
|
||||
|
||||
Display->Port_D4 = Port_D4;
|
||||
Display->Pin_D4 = Pin_D4;
|
||||
|
||||
Display->Port_D5 = Port_D5;
|
||||
Display->Pin_D5 = Pin_D5;
|
||||
|
||||
Display->Port_D6 = Port_D6;
|
||||
Display->Pin_D6 = Pin_D6;
|
||||
|
||||
Display->Port_D7 = Port_D7;
|
||||
Display->Pin_D7 = Pin_D7;
|
||||
|
||||
Display->Port_RQ = Port_RQ;
|
||||
Display->Pin_RQ = Pin_RQ;
|
||||
|
||||
Display->Port_RS = Port_RS;
|
||||
Display->Pin_RS = Pin_RS;
|
||||
|
||||
Display->Port_RST = Port_RST;
|
||||
Display->Pin_RST = Pin_RST;
|
||||
|
||||
Display->Port_WR = Port_WR;
|
||||
Display->Pin_WR = Pin_WR;
|
||||
}
|
||||
Reference in New Issue
Block a user