Skip to main content
Lchal.1
Associate III
January 27, 2021
Question

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

  • January 27, 2021
  • 0 replies
  • 511 views

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

This topic has been closed for replies.