You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 4.8 KiB

2 vuotta sitten
2 vuotta sitten
2 vuotta sitten
2 vuotta sitten
2 vuotta sitten
2 vuotta sitten
2 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. # WiringPi (Unofficial Fork)
  2. This is an unofficial mirror/fork of wiringPi. This repository
  3. has become a mirror of the last "official" source release, plus a fork
  4. facilitating updates to support newer hardware (primarily for use by
  5. the ports) and fix bugs.
  6. ---
  7. ## Notable Updates
  8. I've made various updates that I've wanted to see for a long time.
  9. 1. BCM pin numbering is now the default
  10. The WiringPi pin numbering never made any sense to me. Probably because I never really got into Arduino.
  11. I modified the command line options to reflect:
  12. ```
  13. $ gpio -h
  14. Usage: gpio -v Show version info
  15. gpio -h Show Help
  16. gpio[-b|-p|-w] ... Use bcm-gpio/physical/WiringPi pin numbering scheme.
  17. If none specified, BCM GPIO numbering is used by default.
  18. [-x extension:params][[ -x ...]] ...
  19. gpio <mode/read/write/aread/awritewb/pwm/pwmTone/clock> ...
  20. gpio bank <bank>
  21. gpio <toggle/blink> <pin>
  22. gpio readall/allreadall
  23. gpio unexportall/exports
  24. gpio export/edge/unexport ...
  25. gpio wfi <pin> <mode>
  26. gpio mwfi <pin>[,<pin>...] <mode>
  27. gpio drive <group> <value>
  28. gpio pwm-bal/pwm-ms
  29. gpio pwmr <range>
  30. gpio pwmc <divider>
  31. gpio load spi/i2c
  32. gpio unload spi/i2c
  33. gpio i2cd/i2cdetect
  34. gpio rbx/rbd
  35. gpio wb <value>
  36. gpio usbp high/low
  37. ```
  38. 2. Board version reporting
  39. I'm keeping Gordon's copyright.
  40. Give credit where credit is due, since this would not exist without his work.
  41. ```
  42. $ gpio -v
  43. gpio version: 2.xx
  44. Copyright (c) 2012-2018 Gordon Henderson
  45. This is free software with ABSOLUTELY NO WARRANTY.
  46. For details type: "gpio -warranty"
  47. Raspberry Pi Details
  48. Type : Pi 4B
  49. Processor: BCM2711
  50. Revision : 1.4
  51. Memory : 8GB
  52. Maker : Sony
  53. * Device tree is enabled.
  54. * Model string: "Raspberry Pi 4 Model B Rev 1.4"
  55. * This Raspberry Pi supports user-level GPIO access.
  56. ```
  57. 3. Overall pin reporting
  58. I wanted the readall command to report the current state of pins, their alternate functions, and the names to go with them.
  59. i.e. The pin names aren't static anymore.
  60. This works on the 3B and 4B. The old A and B should be the same as before. I don't have any of the other boards,
  61. so I can't test on those.
  62. In the table below, note that I've changed pins 32 and 33 to the alt4 function to be able to use UART5:
  63. ```
  64. $ gpio readall
  65. +-----+-----+------------+------+---+---Pi 4B--+---+------+------------+-----+-----+
  66. | BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
  67. +-----+-----+------------+------+---+----++----+---+------+------------+-----+-----+
  68. | | | 3.3v | | | 1 || 2 | | | 5v | | |
  69. | 2 | 8 | SDA1 | ALT0 | 1 | 3 || 4 | | | 5v | | |
  70. | 3 | 9 | SCL1 | ALT0 | 1 | 5 || 6 | | | GND | | |
  71. | 4 | 7 | GPIO.04 | OUT | 0 | 7 || 8 | 1 | ALT5 | TXD1 | 15 | 14 |
  72. | | | GND | | | 9 || 10 | 0 | ALT5 | RXD1 | 16 | 15 |
  73. | 17 | 0 | GPIO.17 | OUT | 0 | 11 || 12 | 0 | IN | GPIO.18 | 1 | 18 |
  74. | 27 | 2 | GPIO.27 | IN | 1 | 13 || 14 | | | GND | | |
  75. | 22 | 3 | GPIO.22 | IN | 0 | 15 || 16 | 0 | IN | GPIO.23 | 4 | 23 |
  76. | | | 3.3v | | | 17 || 18 | 0 | IN | GPIO.24 | 5 | 24 |
  77. | 10 | 12 | SPI0_MOSI | ALT0 | 0 | 19 || 20 | | | GND | | |
  78. | 9 | 13 | SPI0_MISO | ALT0 | 0 | 21 || 22 | 0 | IN | GPIO.25 | 6 | 25 |
  79. | 11 | 14 | SPI0_SCLK | ALT0 | 0 | 23 || 24 | 1 | OUT | GPIO.08 | 10 | 8 |
  80. | | | GND | | | 25 || 26 | 1 | OUT | GPIO.07 | 11 | 7 |
  81. | 0 | 30 | GPIO.00 | OUT | 0 | 27 || 28 | 1 | IN | GPIO.01 | 31 | 1 |
  82. | 5 | 21 | GPIO.05 | IN | 1 | 29 || 30 | | | GND | | |
  83. | 6 | 22 | GPIO.06 | IN | 1 | 31 || 32 | 1 | ALT4 | TXD5 | 26 | 12 |
  84. | 13 | 23 | RXD5 | ALT4 | 1 | 33 || 34 | | | GND | | |
  85. | 19 | 24 | GPIO.19 | IN | 1 | 35 || 36 | 1 | IN | GPIO.16 | 27 | 16 |
  86. | 26 | 25 | GPIO.26 | IN | 1 | 37 || 38 | 1 | IN | GPIO.20 | 28 | 20 |
  87. | | | GND | | | 39 || 40 | 1 | IN | GPIO.21 | 29 | 21 |
  88. +-----+-----+------------+------+---+----++----+---+------+------------+-----+-----+
  89. | BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
  90. +-----+-----+------------+------+---+---Pi 4B--+---+------+------------+-----+-----+
  91. ```
  92. 4. Added wiringPiISRmulti
  93. This is like the existing wiringPiISR, but it takes a list of pins to wait for.
  94. Note that (for simplicity) the mode applies to all the specified pins.