Function 'hal_pi_gpio.pin-NN-in' not working
29 Feb 2024 03:28 - 29 Feb 2024 03:31 #294746
by GoldenHym
Function 'hal_pi_gpio.pin-NN-in' not working was created by GoldenHym
Hello everyone,
I am trying to configure an RPi4 to receive an input signal from two optical sensors, acting as my all-home and all-limit sensors for my machine. I am using the hal_pi_gpio.c driver to configure my system to utilize the RPi4's gpio pins. The issue is I get an error upon starting my program: "Pin 'hal_pi_gpio.pin-08-in' does not exist". This error is repeated for all of my input pin commands, while my output pin commands work as intended. What am I missing here?
Below is the hal code in my custom.hal file:
loadrt hal_pi_gpio dir=0x231B007 exclude=0x1CE4FF8
addf hal_pi_gpio.read base-thread
addf hal_pi_gpio.write base-thread
net xstep => hal_pi_gpio.pin-03-out
net xdir => hal_pi_gpio.pin-05-out
net xenable => hal_pi_gpio.pin-07-out
net ystep => hal_pi_gpio.pin-11-out
net ydir => hal_pi_gpio.pin-13-out
net all-home <= hal_pi_gpio.pin-08-in
net all-limit <= hal_pi_gpio.pin-10-in
net estop-ext <= hal_pi_gpio.pin-15-in
net coolant-flood => hal_pi_gpio.pin-12-out
net din-00 <= hal_pi_gpio.pin-16-in
I am trying to configure an RPi4 to receive an input signal from two optical sensors, acting as my all-home and all-limit sensors for my machine. I am using the hal_pi_gpio.c driver to configure my system to utilize the RPi4's gpio pins. The issue is I get an error upon starting my program: "Pin 'hal_pi_gpio.pin-08-in' does not exist". This error is repeated for all of my input pin commands, while my output pin commands work as intended. What am I missing here?
Below is the hal code in my custom.hal file:
loadrt hal_pi_gpio dir=0x231B007 exclude=0x1CE4FF8
addf hal_pi_gpio.read base-thread
addf hal_pi_gpio.write base-thread
net xstep => hal_pi_gpio.pin-03-out
net xdir => hal_pi_gpio.pin-05-out
net xenable => hal_pi_gpio.pin-07-out
net ystep => hal_pi_gpio.pin-11-out
net ydir => hal_pi_gpio.pin-13-out
net all-home <= hal_pi_gpio.pin-08-in
net all-limit <= hal_pi_gpio.pin-10-in
net estop-ext <= hal_pi_gpio.pin-15-in
net coolant-flood => hal_pi_gpio.pin-12-out
net din-00 <= hal_pi_gpio.pin-16-in
Last edit: 29 Feb 2024 03:31 by GoldenHym.
Please Log in or Create an account to join the conversation.
29 Feb 2024 05:47 #294751
by cornholio
Replied by cornholio on topic Function 'hal_pi_gpio.pin-NN-in' not working
Give this a shot
github.com/jethornton/rpi_gpio
The man page seems to suggest the dir list is for the pins you want as outputs, The exclude list for pins you don’t want to use and those in neither list are inputs.
github.com/jethornton/rpi_gpio
The man page seems to suggest the dir list is for the pins you want as outputs, The exclude list for pins you don’t want to use and those in neither list are inputs.
Please Log in or Create an account to join the conversation.
01 Mar 2024 02:48 - 01 Mar 2024 02:48 #294817
by GoldenHym
Replied by GoldenHym on topic Function 'hal_pi_gpio.pin-NN-in' not working
Thank you so much, I thought the dir mask was for both inputs and outputs.
Last edit: 01 Mar 2024 02:48 by GoldenHym.
Please Log in or Create an account to join the conversation.
Time to create page: 0.127 seconds