cancel
Showing results for 
Search instead for 
Did you mean: 

Can i use GPIO pins in modbus.h and modbus.c?

Lchal.1
Associate II

Hi, i want to use GPIO pin in Modbus.h and Modbus.c file using stm32f103. But even if I mention header file in my Modbus.h the code is not working. it shows error.

stm32f1xx_hal_gpio.h is the header file I included in Modbus.h.

HAL _ GPIO _ Write Pin(rs_485_TXEN_GPIO_Port,rs_485_TXEN_Pin, GPIO_PIN_SET); // This is the code I have written in Modbus.c

the error I am getting is ../Core/ Src /modbus.c:265:20: error: 'rs_485_TXEN_GPIO_Port' undeclared (first use in this function)

 HAL _ GPIO _ Write Pin(rs_485_TXEN_GPIO_Port,rs_485_TXEN_Pin, GPIO_PIN_SET);

can anyone please help me what is the error I have done and what i need to add to my code please.

Thank You

0 REPLIES 0