Recent

Author Topic: Output/Input GPIO references with rpi_hal  (Read 218 times)

ChPr

  • New Member
  • *
  • Posts: 22
Output/Input GPIO references with rpi_hal
« on: October 08, 2019, 06:46:44 pm »
Hello everybody,

I am using the rpi_hal 5.1 for 12c application : that's fine.

I would like to use it with GPIO but I ask me what is the value of "gpio" to use in the function :

Code: Pascal  [Select]
  1. GPIO_set_OUTPUT(gpio);

is it :
  • BCM reference,
  • wPi reference,
  • physical reference (pin number).
Sincerely.

Pierre


Thaddy

  • Hero Member
  • *****
  • Posts: 8869
Re: Output/Input GPIO references with rpi_hal
« Reply #1 on: October 08, 2019, 08:51:07 pm »
Pierre, the example included explains all.
Most people that want to use threading should learn to patch their jeans first: use a needle.

ChPr

  • New Member
  • *
  • Posts: 22
Re: Output/Input GPIO references with rpi_hal
« Reply #2 on: October 09, 2019, 10:01:49 am »
Pierre, the example included explains all.

Except "testrpi.pas" and "bb_morse.pas", where I do not see explicitely information about gpio reference, I have no other examples.

What is the example you talking about ?

Sincerely.

Pierre.

Thaddy

  • Hero Member
  • *****
  • Posts: 8869
Re: Output/Input GPIO references with rpi_hal
« Reply #3 on: October 09, 2019, 10:11:00 am »
You should be able to find out why tesrtrpi.pas works and your code does not? ;D
Most people that want to use threading should learn to patch their jeans first: use a needle.

MarkMLl

  • Full Member
  • ***
  • Posts: 132
Re: Output/Input GPIO references with rpi_hal
« Reply #4 on: October 09, 2019, 10:13:14 am »
Useful example at https://forum.lazarus.freepascal.org/index.php?topic=20991.105 (question had a working program that failed for a different reason).

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

ChPr

  • New Member
  • *
  • Posts: 22
Re: Output/Input GPIO references with rpi_hal
« Reply #5 on: October 09, 2019, 11:28:34 am »
I am sorry, but, my english is not very good and this causes me sometimes problems of translation.

So, it's the reason why I did not find obvious that the number to choose were the BCM one's.

It is by testing which one of the physical, wPi and BCM number was the good one that I found it was the BCM one.

Is there a function that allows to choose physical one's instead the BCM one's ?

Sincerely.

Pierre