Commit graph

72 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
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
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
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
705368d91e only check kernel overlays if u-boot overlays are not being used 2017-11-01 04:15:08 +00:00
Drew Fustini
1b3dab6950 add "Adafruit_BBIO" to syslog() 2017-10-31 03:53:02 +00:00
Drew Fustini
8e64f67ff0 convert fprintf() to syslog() for #178 2017-10-31 02:41:07 +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
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
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
Mark A. Yoder
ff54b61fa1 Adding GPIO defs for uart1 2017-08-01 15:06:06 -04:00
Mark A. Yoder
35718a959b Added red and green LEDs 2017-07-28 16:53:39 -04:00
Mark A. Yoder
6480b0042c Added GP0 1, 2 and 3 2017-07-28 16:09:01 -04:00
Mark A. Yoder
27635a6261 Have GP0_1 working 2017-07-28 15:35:37 -04:00
Drew Fustini
feb3c63f50 Skip check for device tree loaded if u-boot overlays enabled 2017-06-28 09:39:38 +00:00
Drew Fustini
344014d9ce remove debug printing 2017-06-28 09:06:35 +00:00
Drew Fustini
f069dd784e Return BBIO_OK when u-boot overlays ared enabled
When Linux kernel boots with u-boot overlays enabled,
do not load overlays via slots file as the write will
hang due to kernel bug in cape manager driver.

Skip cape manager and just return BBIO_OK.
2017-06-28 09:03:04 +00:00
Drew Fustini
ae47281a0e Add documentation about u-boot overlays 2017-06-28 08:15:36 +00:00
Drew Fustini
ae38e86006 check if kernel cmdline for uboot overlay
Test on Debian Jessie 2017-06-18 image:

debian@beaglebone:~$ cat /proc/cmdline
console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet
debian@beaglebone:~$ grep -c bone_capemgr.uboot_capemgr_enabled=1 /proc/cmdline
1
debian@beaglebone:~$ sudo python ~/read_adc.py
load_device_tree: cmd=grep -c bone_capemgr.uboot_capemgr_enabled=1 /proc/cmdline
load_device_tree: uboot_overlay=1
load_device_tree: uboot_overlay is 1
2017-06-28 08:05:07 +00:00
Drew Fustini
d93466ff23 Test if kernel booted wit u-boot overlays 2017-06-28 05:10:02 +00:00
Drew Fustini
ff57ef2558 increase size of ctrl_dir and ocp_dir for future use
Pad the size of ctrl_dir and ocp_dir to be on the safe side
2017-04-19 04:00:36 +00:00
Drew Fustini
01f73c578c remove conditional logic for ctrl_dir and ocp_dir size
Remove conditional logic for kernel version to determine the
size of ctrl_dir and ocp_dir.  Instead, the maximum possible
size is used for these arrays regardless of the kernel version

Resolves #144
2017-04-19 03:14:31 +00:00
cocasema
ceb468108f Add libadafruit-bbio with C++ wrappers for PWM/GPIO 2017-03-31 02:17:00 -07:00
cocasema
6c489fce8e Add syslog and debugging messages 2017-03-31 02:16:21 -07:00
Marius Elvert
4a4130e3b6 Fix build_path memory leak 2017-03-21 16:38:38 +01:00
Drew Fustini
6d78f9db06 Fix gcc warnings about comparing signed and unsigned values
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
2017-01-11 09:14:38 +00:00
Drew Fustini
d727792e28 Silence gcc warning -Wsign-compare
TODO: fix source the actual cause of the warning:
source/common.c:344:14: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
2017-01-10 10:55:12 +00:00
Drew Fustini
edac02a875 Fix gcc warning -Wno-format-security 2017-01-10 10:52:01 +00:00
Drew Fustini
db9b3b7b1b fix PWM for ECAP pins (P9_28 and P9_42) 2016-12-18 07:03:58 +00:00
Drew Fustini
452f2e7ee3 Buffer for SPI bus sysfs path too small
@kozga advised in issue #94 of a bug in
get_spi_bus_path_number()

> In version 1.0 declared path length is too low (50 bytes)
> But for kernels 4.1 path length is 54 bytes.
> In result, path is shortened to
> '/sys/devices/platform/ocp/48030000.spi/spi_master/'
> and function always return 1,
> even if you try to open /dev/spidev2.x.

These are the sysfs paths for the SPI bus 1 and 2
for Debian 8.6 with Linux 4.4.21-bone13 kernel:

/sys/devices/platform/ocp/48030000.spi/spi_master/spi1/
/sys/devices/platform/ocp/481a0000.spi/spi_master/spi2/

I have fixed by increasing the size of path to MAX_PATH.
MAX_PATH is defined as 256.  This should provide enough
extra margin for any future kernel changes in sysfs paths.
2016-10-19 23:05:52 +00:00
cocasema
efc0a25f65 Treat warnings as errors 2016-10-18 21:59:24 -07:00
Matthew West
565f2dc27e Fix return convention errors 2016-08-11 15:21:41 -07:00
Matthew West
dea25a6d84 Switch back to included device trees - possibly it was a regression on upgraded 7.11. 2016-08-10 09:25:29 -07:00
Matthew West
8fe1336b0a Bug fixes almost to stability 2016-08-08 10:51:15 -07:00
Matthew West
6b2aa7aabc Change return value convention for errors
Replace 1 for success and 0/-1 for failure with an enum type.
2016-08-05 13:19:54 -07:00
Matthew West
8a2e4d1b85 Switch from this library's Device Tree Overlays to those included on every image. 2016-08-05 11:31:08 -07:00
Matthew West
599ec57f4c Fix PWM in Linux 4.1+ 2016-08-05 10:16:34 -07:00
Matthew West
926b253498 Bug fix - move necessary string print outside version guards 2016-08-05 09:52:29 -07:00
Matthew West
9f38244b60 Remove broken version check in common.c (now in setup.py) 2016-08-05 09:51:29 -07:00
Matthew West
b07d85d65e Small formatting fixes to common.c 2016-08-05 09:50:57 -07:00
Matthew West
aca9eb480b Replace build_path impementation with glob 2016-08-05 09:42:32 -07:00
Peter Lawler
ac517ff7fb No, really. Death to stray whitespace. 2016-05-11 09:14:05 +10:00