hybridgroup.gobot/system
Thomas Kohler 915d0c89b8
raspi(pwm): add support for sysfs and fix pi-blaster (#1048)
2023-12-11 19:09:00 +01:00
..
GPIO.md system(gpio): add edge polling function (#1015) 2023-10-26 20:41:41 +02:00
I2C.md Build(v2): revert move to v2 subfolder (#932) 2023-05-29 19:23:28 +02:00
PWM.md platforms(adaptors): add a generic analog pin adaptor (#1041) 2023-11-26 19:47:28 +01:00
README.md Build(v2): revert move to v2 subfolder (#932) 2023-05-29 19:23:28 +02:00
analogpin_sysfs.go platforms(adaptors): add a generic analog pin adaptor (#1041) 2023-11-26 19:47:28 +01:00
analogpin_sysfs_test.go platforms(adaptors): add a generic analog pin adaptor (#1041) 2023-11-26 19:47:28 +01:00
digitalpin_access.go platforms(adaptors): add a generic analog pin adaptor (#1041) 2023-11-26 19:47:28 +01:00
digitalpin_access_test.go lint(all): fix issues of errorlint etc (#1037) 2023-11-15 20:51:52 +01:00
digitalpin_bench_test.go build(style): switch to gofumpt and add linters (#1009) 2023-10-20 20:50:42 +02:00
digitalpin_config.go lint(all): fix issues of errorlint etc (#1037) 2023-11-15 20:51:52 +01:00
digitalpin_config_test.go lint(all): fix issues of errorlint etc (#1037) 2023-11-15 20:51:52 +01:00
digitalpin_gpiod.go lint(all): fix issues of errorlint etc (#1037) 2023-11-15 20:51:52 +01:00
digitalpin_gpiod_test.go lint(all): fix issues of errorlint etc (#1037) 2023-11-15 20:51:52 +01:00
digitalpin_mock.go lint(all): fix issues of errorlint etc (#1037) 2023-11-15 20:51:52 +01:00
digitalpin_poll.go system(gpio): add edge polling function (#1015) 2023-10-26 20:41:41 +02:00
digitalpin_poll_test.go lint(all): switch to 1.55.2 and adjust linter issues (#1036) 2023-11-12 14:17:02 +01:00
digitalpin_sysfs.go platforms(adaptors): add a generic analog pin adaptor (#1041) 2023-11-26 19:47:28 +01:00
digitalpin_sysfs_test.go platforms(adaptors): add a generic analog pin adaptor (#1041) 2023-11-26 19:47:28 +01:00
doc.go Build(v2): revert move to v2 subfolder (#932) 2023-05-29 19:23:28 +02:00
fs.go lint(all): fix issues of errorlint etc (#1037) 2023-11-15 20:51:52 +01:00
fs_mock.go platforms(adaptors): add a generic analog pin adaptor (#1041) 2023-11-26 19:47:28 +01:00
fs_mock_test.go lint(all): switch to 1.55.2 and adjust linter issues (#1036) 2023-11-12 14:17:02 +01:00
fs_test.go lint(all): switch to 1.55.2 and adjust linter issues (#1036) 2023-11-12 14:17:02 +01:00
i2c_device.go lint(all): fix issues of errorlint etc (#1037) 2023-11-15 20:51:52 +01:00
i2c_device_test.go lint(all): fix issues of errorlint etc (#1037) 2023-11-15 20:51:52 +01:00
pwmpin_sysfs.go gpio(all): introduce functional options (#1045) 2023-12-03 18:03:02 +01:00
pwmpin_sysfs_test.go raspi(pwm): add support for sysfs and fix pi-blaster (#1048) 2023-12-11 19:09:00 +01:00
spi_access.go lint(all): fix issues of errorlint etc (#1037) 2023-11-15 20:51:52 +01:00
spi_access_test.go build(style): switch to gofumpt and add linters (#1009) 2023-10-20 20:50:42 +02:00
spi_gpio.go lint(all): fix issues of errorlint etc (#1037) 2023-11-15 20:51:52 +01:00
spi_mock.go lint(all): fix issues of errorlint etc (#1037) 2023-11-15 20:51:52 +01:00
spi_periphio.go Build(v2): revert move to v2 subfolder (#932) 2023-05-29 19:23:28 +02:00
syscall.go lint(all): fix issues of errorlint etc (#1037) 2023-11-15 20:51:52 +01:00
syscall_mock.go lint(all): fix issues of errorlint etc (#1037) 2023-11-15 20:51:52 +01:00
sysfsfile_access.go platforms(adaptors): add a generic analog pin adaptor (#1041) 2023-11-26 19:47:28 +01:00
system.go platforms(adaptors): add a generic analog pin adaptor (#1041) 2023-11-26 19:47:28 +01:00
system_options.go build(style): switch to gofumpt and add linters (#1009) 2023-10-20 20:50:42 +02:00
system_test.go platforms(adaptors): add a generic analog pin adaptor (#1041) 2023-11-26 19:47:28 +01:00

README.md

system

This document describes some basics for developers.

The gobot package name is a little bit misleading, because also contains /dev/i2c-* usage with syscall for i2c interface and the file system mock for unit testing.

Change available features on TinkerOS (Tinkerboard)

Open the file /boot/config.txt and add lines/remove comment sign. Then save the file, close and reboot.

For PWM on TinkerOS (Tinkerboard)

intf:pwm2=on intf:pwm3=on

For i2c on TinkerOS (Tinkerboard)

intf:i2c1=on intf:i2c4=on

Device tree overlays can also be provided, e.g. "overlay=i2c-100kbit-tinker-overlay".

Create a dts-file "i2c1-100kbit-tinker-overlay.dts" with this content:

// Definitions for i2c1 with 100 kbit
/dts-v1/;
/plugin/;

/ {
  compatible = "rockchip,rk3288-evb-rk808-linux", "rockchip,rk3288";

  fragment@0 {
    target = <&i2c1>;
    __overlay__ {
      status = "okay";
      clock-frequency = <100000>;
    };
  };
};

Compile the tree overlay:

dtc -@ -I dts -O dtb -o i2c1-100kbit-tinker-overlay.dtbo i2c1-100kbit-tinker-overlay.dts

Copy the file to "/boot/overlays/i2c-100kbit-tinker-overlay.dtbo"

Package "device-tree-compiler" needs to be installed for "dtc" command.

Change available features on raspi

Start "raspi-config" and go to the menu "interface options". After change something save and reboot the device.

Change available features on armbian

Install the armbian-config utility (howto is shown after each login) and start it.

For i2c on armbian

Open the related menu entry and activate/deactivate the needed features.

For PWM on armbian

Go to the device tree menu - this opens the device tree for editing.
Looking for the pwm entries. There are some marked with "disabled". Change the entry to "okay" for your needed pwm.

Example for Tinkerboard:

ff680020 => pwm2, pin33 ff680030 => pwm3, pin32

Next steps for developers

  • test gpio
  • test pwm
  • background information for i2c in gobot