I receive no errors while compiling the header file( attached in details), for a LCD interface, but as I include this header in my .c file a lot of errors and warnings appear. I am new in c and HAL, kindly give some detail or reference for knowledge
- November 18, 2020
- 5 replies
- 1891 views
* S6D0154_LCD.h
*
* Created on: 16-Nov-2020
* Author: NUCLEO
*/
#ifndef INC_S6D0154_LCD_H_
#define INC_S6D0154_LCD_H_
#include "stm32f103xb.h"
#include "stm32f1xx_hal_gpio.h"
typedef struct{
uint16_t pin; // LCD Pins interface to STM32.
GPIO_TypeDef port;
}LCD_PIN_typedef;
typedef enum{
write_index,
write_WDR, // LCD Operation to be performed.
read_status,
read_RDR
}LCD_OPERATION;
typedef enum{
pins_READ, // STM32 port_pins mode for LCD_data_pins interface.
pins_WRITE
}LCD_INTERFACE_MODE;
//................................................
//...........LCD_PINS CONNECTIONS................|
//................................................
LCD_PIN_typedef LCD_D0 = {GPIO_PIN_9, GPIOA};
LCD_PIN_typedef LCD_D1 = {GPIO_PIN_7, GPIOC};
LCD_PIN_typedef LCD_D2 = {GPIO_PIN_10, GPIOA};
LCD_PIN_typedef LCD_D3 = {GPIO_PIN_3, GPIOB};
LCD_PIN_typedef LCD_D4 = {GPIO_PIN_5, GPIOB};
LCD_PIN_typedef LCD_D5 = {GPIO_PIN_4, GPIOB};
LCD_PIN_typedef LCD_D6 = {GPIO_PIN_10, GPIOB};
LCD_PIN_typedef LCD_D7 = {GPIO_PIN_8, GPIOA};
//..................................................
LCD_PIN_typedef LCD_RESET = {GPIO_PIN_1, GPIOC};
LCD_PIN_typedef LCD_RD = {GPIO_PIN_0, GPIOA};
LCD_PIN_typedef LCD_WR = {GPIO_PIN_1, GPIOA};
LCD_PIN_typedef LCD_RS = {GPIO_PIN_4, GPIOA};
LCD_PIN_typedef LCD_CS = {GPIO_PIN_0, GPIOB};
//...................................................
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//...................................................
//...............LCD_OPERATIONS.....................|
//...................................................
void LCD_PIN_WRITE(LCD_PIN_typedef pin, GPIO_PinState state);
uint32_t LCD_UPDATE(uint32_t lcd_data, LCD_OPERATION operation);
void LCD_READ_INIT(void);
void LCD_WRITE_INIT(void);
void LCD_INIT(void);
#endif /* INC_S6D0154_LCD_H_ */
I am using SW4STM32 and STM32CubeMX 6.01 and CubeF1 FW 1.83
