Commit Graph

43 Commits

Author SHA1 Message Date
Aleksei Fedotov
904f4f9711 Add conversion from physical PIN to BCM notation.
On Open() detect the board model and configure how physical PINs are
mapped to GPIO pin numbers [1].

Model detection is based on content of
/sys/firmware/devicetree/base/model [2] . If you are running a weird or
very old system which does not have the file, GetBoardPin() won't work.

[1] https://pinout.xyz/
[2] https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
2020-04-26 18:54:01 +02:00
CodeLingo Bot
0720c3a89d Fix function comments based on best practices from Effective Go
Signed-off-by: CodeLingo Bot <bot@codelingo.io>
2019-02-14 20:50:48 +00:00
Drahoslav
84326092ab Disable gpio IRQ on Detect edge 2018-12-01 15:59:22 +01:00
Drahoslav
631591fc01 Add IRQ enable/disable 2018-12-01 05:28:32 +01:00
Drahoslav
794e6ddd7e Improve doc 2018-11-28 10:22:30 +01:00
Drahoslav
094a866c10 Implement basic SPI 2018-10-04 23:20:31 +02:00
Drahoslav
3084a4df91 Improve doc of edge detection 2018-06-06 17:54:16 +02:00
Drahoslav
4ae1cfd964 Minor change in edge event detection api
Also other minor changes and gofmt
2018-06-06 13:34:52 +02:00
Drahoslav
22c39c30df Fix falling edge detection 2018-06-04 16:32:46 +02:00
Drahoslav
46ba7f5934 Test edge events 2018-06-04 16:29:39 +02:00
Drahoslav
2ec057fd07 Impelement edge event detection 2018-06-04 14:46:15 +02:00
Drahoslav
544f9accf1 Add missing unmap to Close 2018-01-12 15:55:26 +01:00
Drahoslav
ec49196c8c Update doc overview 2017-11-20 12:14:52 +01:00
Drahoslav
a1c4bb376e Improve doc 2017-11-20 10:26:42 +01:00
Drahoslav
b1c90c6087 Fix pwmMem and some pwm Regs 2017-11-20 09:29:43 +01:00
Drahoslav
7445bb69a5 Implement pwm methods 2017-11-19 17:23:48 +01:00
Drahoslav
cc678981b0 Mmap pwm memmory 2017-11-17 09:37:18 +01:00
Drahoslav
4a31f2cfa6 Add Pwm mode for pins 2017-11-17 03:03:19 +01:00
Drahoslav
c0dfd7a7e3 fixup! Use mash filter if it makes sense 2017-11-16 13:52:24 +01:00
Drahoslav
7e21224c69 Do not change mash while busy 2017-11-16 01:47:08 +01:00
Drahoslav
ec703e92e8 Use /mem/dev primarily - it is needed for clock settings to work 2017-11-16 01:28:34 +01:00
Drahoslav
95bb91625f Use mash filter if it makes sense 2017-11-16 01:14:01 +01:00
Drahoslav
fd0764b709 Fix bad indexing of clk rigisters 2017-11-16 01:12:13 +01:00
Drahoslav Bednář
8208ca5f0d
fix memMap base attr
How could it even work before?
2017-11-15 17:48:18 +01:00
Drahoslav
0122f1902d Fix divf computation 2017-11-15 11:26:49 +01:00
Drahoslav
9b13a0969b Change clock public api 2017-11-14 23:16:39 +01:00
Drahoslav
cdcd97f287 go fmt 2017-11-14 22:33:04 +01:00
Drahoslav
b604d03178 Minor fixes 2017-11-14 22:25:26 +01:00
Drahoslav
b7b1bd8b81 Do minor renaming 2017-11-14 22:16:15 +01:00
Drahoslav
aae3fc6504 Implement setClock - using clock manager registers 2017-11-14 22:04:03 +01:00
Drahoslav
12feac8555 Add pin mode Clock 2017-11-14 17:52:05 +01:00
Drahoslav
3e0491354c Do minor refactoring 2017-11-14 17:06:00 +01:00
Artem Sheremet
f2af793fd7 Use /dev/gpiomem (with offset=0), if available
/dev/gpiomem is a map of GPIO-related memory region.
No longer need root for user GPIO access, but without relaxing
permissions on /dev/mem.

See https://github.com/raspberrypi/linux/pull/1112/files
2015-12-07 13:31:10 +01:00
Adam Kramer
07b12a1539 Removing a debugging statement 2015-03-07 19:01:39 -08:00
Adam Kramer
10a90652fd Fixed the comment for getGPIOBase() 2015-03-07 18:54:44 -08:00
Adam Kramer
733fee47fc Fixing a bug (oops) 2015-03-07 18:53:00 -08:00
Adam Kramer
cf3a8b7ed1 Using a better method of base address detection. 2015-03-07 18:45:00 -08:00
Adam Kramer
acd8baadbf Support the new IO port range for raspberry pi 2. 2015-03-07 17:57:06 -08:00
Kris Budde
8492756a0e Always unlock mutex. Just to be sure. 2014-08-23 14:43:15 +02:00
Stian Eikeland
1d8a97a9f8 Fix some comments 2014-01-07 23:15:25 +01:00
Stian Eikeland
e934c432f9 Added support for PullUp / PullDown / PullOff 2013-07-30 19:25:43 +02:00
Stian Eikeland
ce23315e88 Package name: rpio 2013-07-30 16:12:13 +02:00
Stian Eikeland
cc2855b1d8 Basic functionality working
Added support for:
- pin mode
- write
- read
2013-07-30 16:06:02 +02:00