Commit graph

233 commits

Author SHA1 Message Date
Drew Fustini
9e44c5dca0 add alternate name for pin P8_19 (issue #239)
Allow P8_19 to be referenced as GPIO0_22.

Add temporary debugging output to test.
2018-03-23 04:47:53 +00:00
zserg
e9c70f7d23 * Fixed SEGFAULT when calling remove_event_detect() inside python callback function. 2018-02-18 00:06:57 +00:00
Drew Fustini
8dfbf64c36
Fix spidev path mismatch (#216)
Remove unnecessary call to get_spi_bus_path_number()
and use the bus and device passed to SPI_open().

Signed-off-by: Drew Fustini <drew@pdp7.com>
2017-12-01 06:36:50 -06:00
Drew Fustini
61af64e734
use set_pin_mode() to set uart pinmux (#158)
Use set_pin_mode() to set pinmux for UART
RX and TX pins. This is similar effect as
running the config-pin utility.

Signed-off-by: Drew Fustini <drew@pdp7.com>
2017-11-30 22:39:14 -06:00
Drew Fustini
a22cd5fd24
Fix seg fault of PWM in Python 3.6 (#189)
PWM.set_frequency() and PWM.set_duty_cycle()
were resulting in a seg fault inside the
call to PyArg_ParseTupleAndKeywords().

Signed-off-by: Drew Fustini <drew@pdp7.com>
2017-11-25 05:24:44 -06:00
Drew Fustini
503e8397e6
Fix leak of pwm enable file descriptor (#197)
Make sure that the file descriptor for pwm enable
is closed along with the other pwm file descriptors

Signed-off-by: Drew Fustini <drew@pdp7.com>
2017-11-24 00:29:04 -06:00
Drew Fustini
f82ba3a1ec
close enable_fd when stopping PWM output (#197)
Issue #197: JesseMcL raised the issue that running
PWM.start() and PWM.start() in a loop will eventually
exhaust the number of open file descriptors and
PWM.start() will raise the error:

  RuntimeError: problem with sysfs file.

The file descriptor for the enable file should
be closed in pwm_disable() to avoid the leak

Signed-off-by: Drew Fustini <drew@pdp7.com>
2017-11-22 04:38:14 -06:00
Drew Fustini
32814797ff
cache board type to avoid poor performance (#196)
cache board type to avoid poor performance
in functions that are called frequently like
gpio_set_value() in source/event_gpio.c

Signed-off-by: Drew Fustini <drew@pdp7.com>
2017-11-18 23:18:21 -06:00
Drew Fustini
b328cddd13
Fix PocketBeagle PWM pin typo (#192)
ehrpwm0 channel 1 is  P1_33 on a the PocketBeagle

Signed-off-by: Drew Fustini <drew@pdp7.com>
2017-11-17 03:23:29 -06:00
Drew Fustini
335e105bc1
Comment out debug log in gpio hotpath #188
Signed-off-by: Drew Fustini <drew@pdp7.com>
2017-11-08 17:43:19 -06:00
Drew Fustini
794d7136b4 Change log level from INFO to DEBUG #188
Signed-off-by: Drew Fustini <drew@pdp7.com>
2017-11-08 03:16:47 -06:00
Drew Fustini
ca0a4afcdb Filter DEBUG syslog to avoid poor performance #188 2017-11-08 03:03:52 -06:00
Drew Fustini
b65cbf8e41 sleep to avoid udev race condition #185
sleep 100 ms after export to avoid race condition as udev
needs the opportunity to set group ownership and permission

Test instructions:
==================
reboot, log back in, wait for udev to set group ownership and permission:

$ ls -la /sys/devices/platform/ocp/48304000.epwmss/48304200.pwm/pwm/pwmchip6/export
-rw-rw---- 1 root pwm 4096 Nov  2 04:02 /sys/devices/platform/ocp/48304000.epwmss/48304200.pwm/pwm/pwmchip6/export

run test program:

python ~/issue185.py

contents of test program:

import Adafruit_BBIO.PWM as PWM
PWM.start("P8_13", 50, 1000, 0)
PWM.stop("P8_13")
PWM.cleanup()
2017-11-02 04:08:48 +00:00
Robert Nelson
1ead3f90eb source/common.c: PocketBeagle Fix P2.24
I copied the initial schematic when i setup this pinmux table...

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
2017-11-01 21:24:30 -05:00
Drew Fustini
f267ec01b1 minor change to pwm debug logging 2017-11-01 09:11:44 +00:00
Drew Fustini
58eb54679c Attempt to use udev ecap path for pwm path
Example of pwm and ecap paths for pwm outputs in the 4.14 kernel:

/sys/devices/platform/ocp/48300000.epwmss/48300100.ecap/pwm/pwmchip0/pwm-0:0/duty_cycle
/sys/devices/platform/ocp/48300000.epwmss/48300200.pwm/pwm/pwmchip1/pwm-1:0/duty_cycle
/sys/devices/platform/ocp/48300000.epwmss/48300200.pwm/pwm/pwmchip1/pwm-1:1/duty_cycle
/sys/devices/platform/ocp/48302000.epwmss/48302200.pwm/pwm/pwmchip3/pwm-3:0/duty_cycle
/sys/devices/platform/ocp/48302000.epwmss/48302200.pwm/pwm/pwmchip3/pwm-3:1/duty_cycle
/sys/devices/platform/ocp/48304000.epwmss/48304100.ecap/pwm/pwmchip5/pwm-5:0/duty_cycle

Note that the ecap path is longer than pwm path by 1 character
2017-11-01 09:05:12 +00:00
Drew Fustini
705368d91e only check kernel overlays if u-boot overlays are not being used 2017-11-01 04:15:08 +00:00
Drew Fustini
5af654ca14 change fprintf() to syslog() 2017-10-31 07:19:53 +00:00
Drew Fustini
8e08a40f14 move pwm_set_polarity() after period is set 2017-10-31 06:39:20 +00:00
Drew Fustini
73ea172d21 remove polarity "hack" for PWM #170 2017-10-31 05:37:14 +00:00
Drew Fustini
1b3dab6950 add "Adafruit_BBIO" to syslog() 2017-10-31 03:53:02 +00:00
Drew Fustini
1edb20770e change syslog mask level to DEBUG 2017-10-31 03:13:50 +00:00
Drew Fustini
5f32b56e99 convert debug output to syslog 2017-10-31 02:55:02 +00:00
Drew Fustini
8e64f67ff0 convert fprintf() to syslog() for #178 2017-10-31 02:41:07 +00:00
Drew Fustini
becbc95861 check if BeagleBone Blue before accessing non-standard LEDs
This check is needed as BeagleBone Blue has additional LEDs
connected to GPIO pins that other BeagleBone models do not
2017-10-28 05:28:51 +00:00
Drew Fustini
5e2e785b51 check if board is BeagleBone Blue or PocketBeagle
This check is needed as BeagleBone Blue and PocketBeagle
have additional LEDs connected to GPIO pins that other
BeagleBone models do not
2017-10-28 04:27:03 +00:00
Drew Fustini
2cb837618a Merge pull request #163 from MarkAYoder/master
Added BAT25, BAT50, BAT75, BAT100 and WIFI LEDs
2017-10-17 10:08:15 -05:00
Drew Fustini
41094a2042 Merge pull request #173 from RobertCNelson/PocketBeagle
source/common.c: add initial PocketBeagle values
2017-10-17 10:06:18 -05:00
Robert Nelson
0735ad0352 source/common.c: Blue Fix GP0_3 id
fixes: https://github.com/adafruit/adafruit-beaglebone-io-python/issues/174

Reported-by: Randy Rossi <randy.rossi@gmail.com>
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
2017-10-13 14:06:44 -05:00
Robert Nelson
c35e4cb98a source/c_pwm.c: disable pwm_set_polarity (broken in v4.9.x/v4.14.x)
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
2017-10-12 16:33:43 -05:00
Robert Nelson
02c6ca5924 source/c_pwm.c: pwm: add support for pwmchipX/pwm-X:Y syntax
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
2017-10-12 16:31:20 -05:00
Robert Nelson
2d5a88aee9 source/c_pwm.c: debug pwm_path/pwm_path_udev
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
2017-10-12 16:05:23 -05:00
Robert Nelson
d201c910ec source/c_pwm.c: HACK: PocketBeagle: v4.14.x
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
2017-10-12 16:00:43 -05:00
Robert Nelson
4e180c54cf source/c_pwm.c: HACK: U-Boot pre-setup everything, dont search for specific overlay
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
2017-10-12 15:04:17 -05:00
Robert Nelson
0f2bdd1410 source/common.c: PocketBeagle, no slots file disable here too
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
2017-10-12 14:55:45 -05:00
Robert Nelson
49927af269 source/common.c: PocketBeagle, no slots file, everything built-in
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
2017-10-12 14:38:32 -05:00
Robert Nelson
5f47eb008a source/common.c: add initial PocketBeagle values
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
2017-10-12 14:20:49 -05:00
Mark A. Yoder
cc96193d31 Added BAT25, BAT50, BAT75, BAT100 and WIFI LEDs 2017-09-13 11:46:09 -04:00
Drew Fustini
8b6c083162 Merge pull request #160 from MarkAYoder/master
Switched to new Blue gpio numbering:  GP0_0 is now GP0_3
2017-08-30 19:39:19 -05:00
Mark A. Yoder
6ef19e209f Added PAUSE and MODE buttons.
Also add 100ms sleep after exporting a new pin to give the OS time to set the
correct owner and group
2017-08-30 13:41:19 -04:00
Mark A. Yoder
af47930f0a Switched GP0_0 to GP0_3, etc. 2017-08-30 13:02:27 -04:00
Drew Fustini
a0ffd19873 Merge pull request #153 from MarkAYoder/master
Adding GPIO for BeagleBone Blue
2017-08-23 16:05:17 -05:00
Mark A. Yoder
e18f5c20c0 Testing UT1_0, not working yet 2017-08-01 15:07:03 -04:00
Mark A. Yoder
ff54b61fa1 Adding GPIO defs for uart1 2017-08-01 15:06:06 -04:00
Mark A. Yoder
47bfe24813 Added fade 2017-07-31 16:03:46 -04:00
Mark A. Yoder
24844800af Removed newline from print 2017-07-31 15:43:21 -04:00
Mark A. Yoder
c5fdf47415 Added LED matrix example 2017-07-31 15:39:39 -04:00
Mark A. Yoder
5024694c59 Added tmp101 to name 2017-07-31 15:25:29 -04:00
Mark A. Yoder
354c187e24 Switched to apt install 2017-07-31 15:24:42 -04:00
Mark A. Yoder
87ef745193 Added port setup 2017-07-31 15:24:12 -04:00