hybridgroup.gobot/system
Thomas Kohler ad12eaca69
system(syscall): switch to x/sys (#963)
2023-06-19 16:06:44 +02:00
..
GPIO.md Build(v2): revert move to v2 subfolder (#932) 2023-05-29 19:23:28 +02:00
I2C.md Build(v2): revert move to v2 subfolder (#932) 2023-05-29 19:23:28 +02:00
PWM.md Build(v2): revert move to v2 subfolder (#932) 2023-05-29 19:23:28 +02:00
README.md Build(v2): revert move to v2 subfolder (#932) 2023-05-29 19:23:28 +02:00
digitalpin_access.go Build(v2): revert move to v2 subfolder (#932) 2023-05-29 19:23:28 +02:00
digitalpin_access_test.go Build(v2): revert move to v2 subfolder (#932) 2023-05-29 19:23:28 +02:00
digitalpin_bench_test.go all(style) : fix linter issues for errcheck, ineffassign, unused and fix errors (#950) 2023-06-12 19:51:25 +02:00
digitalpin_config.go Build(v2): revert move to v2 subfolder (#932) 2023-05-29 19:23:28 +02:00
digitalpin_config_test.go Build(v2): revert move to v2 subfolder (#932) 2023-05-29 19:23:28 +02:00
digitalpin_gpiod.go Build(v2): revert move to v2 subfolder (#932) 2023-05-29 19:23:28 +02:00
digitalpin_gpiod_test.go Build(v2): revert move to v2 subfolder (#932) 2023-05-29 19:23:28 +02:00
digitalpin_mock.go Build(v2): revert move to v2 subfolder (#932) 2023-05-29 19:23:28 +02:00
digitalpin_sysfs.go system(syscall): switch to x/sys (#963) 2023-06-19 16:06:44 +02:00
digitalpin_sysfs_test.go system(syscall): switch to x/sys (#963) 2023-06-19 16:06:44 +02:00
doc.go Build(v2): revert move to v2 subfolder (#932) 2023-05-29 19:23:28 +02:00
fs.go Build(v2): revert move to v2 subfolder (#932) 2023-05-29 19:23:28 +02:00
fs_mock.go all: substitute deprecated ioutil methods (#923) 2023-06-10 19:25:01 +02:00
fs_mock_test.go all(style) : fix linter issues for errcheck, ineffassign, unused and fix errors (#950) 2023-06-12 19:51:25 +02:00
fs_test.go Build(v2): revert move to v2 subfolder (#932) 2023-05-29 19:23:28 +02:00
i2c_device.go system(syscall): switch to x/sys (#963) 2023-06-19 16:06:44 +02:00
i2c_device_test.go system(syscall): switch to x/sys (#963) 2023-06-19 16:06:44 +02:00
pwmpin_sysfs.go system(syscall): switch to x/sys (#963) 2023-06-19 16:06:44 +02:00
pwmpin_sysfs_test.go system(syscall): switch to x/sys (#963) 2023-06-19 16:06:44 +02:00
spi_access.go Build(v2): revert move to v2 subfolder (#932) 2023-05-29 19:23:28 +02:00
spi_access_test.go Build(v2): revert move to v2 subfolder (#932) 2023-05-29 19:23:28 +02:00
spi_gpio.go all(style) : fix linter issues for errcheck, ineffassign, unused and fix errors (#950) 2023-06-12 19:51:25 +02:00
spi_mock.go Build(v2): revert move to v2 subfolder (#932) 2023-05-29 19:23:28 +02:00
spi_periphio.go Build(v2): revert move to v2 subfolder (#932) 2023-05-29 19:23:28 +02:00
syscall.go system(syscall): switch to x/sys (#963) 2023-06-19 16:06:44 +02:00
syscall_mock.go system(syscall): switch to x/sys (#963) 2023-06-19 16:06:44 +02:00
system.go system(syscall): switch to x/sys (#963) 2023-06-19 16:06:44 +02:00
system_options.go Build(v2): revert move to v2 subfolder (#932) 2023-05-29 19:23:28 +02:00
system_test.go Build(v2): revert move to v2 subfolder (#932) 2023-05-29 19:23:28 +02: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