2022-11-27 23:06:09 +08:00
|
|
|
# system
|
2022-10-27 00:21:34 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
This document describes some basics for developers.
|
2022-10-27 00:21:34 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
> 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.
|
2022-10-27 00:21:34 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
## Change available features on TinkerOS (Tinkerboard)
|
2022-10-27 00:21:34 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
Open the file /boot/config.txt and add lines/remove comment sign. Then save the file, close and reboot.
|
2022-10-27 00:21:34 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
### For PWM on TinkerOS (Tinkerboard)
|
2022-10-27 00:21:34 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
intf:pwm2=on
|
|
|
|
intf:pwm3=on
|
2022-10-27 00:21:34 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
### For i2c on TinkerOS (Tinkerboard)
|
2022-10-27 00:21:34 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
intf:i2c1=on
|
|
|
|
intf:i2c4=on
|
2022-10-27 00:21:34 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
Device tree overlays can also be provided, e.g. "overlay=i2c-100kbit-tinker-overlay".
|
2022-10-27 00:21:34 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
Create a dts-file "i2c1-100kbit-tinker-overlay.dts" with this content:
|
2022-11-05 14:42:28 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
```c
|
|
|
|
// Definitions for i2c1 with 100 kbit
|
|
|
|
/dts-v1/;
|
|
|
|
/plugin/;
|
2022-11-05 14:42:28 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
/ {
|
|
|
|
compatible = "rockchip,rk3288-evb-rk808-linux", "rockchip,rk3288";
|
2022-11-05 14:42:28 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
fragment@0 {
|
|
|
|
target = <&i2c1>;
|
|
|
|
__overlay__ {
|
|
|
|
status = "okay";
|
|
|
|
clock-frequency = <100000>;
|
|
|
|
};
|
|
|
|
};
|
2022-11-05 14:42:28 +08:00
|
|
|
};
|
|
|
|
```
|
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
Compile the tree overlay:
|
2022-11-05 14:42:28 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
```sh
|
|
|
|
dtc -@ -I dts -O dtb -o i2c1-100kbit-tinker-overlay.dtbo i2c1-100kbit-tinker-overlay.dts
|
2022-11-05 14:42:28 +08:00
|
|
|
```
|
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
Copy the file to "/boot/overlays/i2c-100kbit-tinker-overlay.dtbo"
|
2022-11-05 14:42:28 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
> Package "device-tree-compiler" needs to be installed for "dtc" command.
|
2022-11-05 14:42:28 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
## Change available features on raspi
|
2022-11-05 14:42:28 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
Start "raspi-config" and go to the menu "interface options". After change something save and reboot the device.
|
2022-11-05 14:42:28 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
## Change available features on armbian
|
2022-11-05 14:42:28 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
Install the armbian-config utility (howto is shown after each login) and start it.
|
2022-11-05 14:42:28 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
### For i2c on armbian
|
2022-11-05 14:42:28 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
Open the related menu entry and activate/deactivate the needed features.
|
2022-11-05 14:42:28 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
### For PWM on armbian
|
2022-11-05 14:42:28 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
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.
|
2022-11-05 14:42:28 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
Example for Tinkerboard:
|
2022-11-05 14:42:28 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
ff680020 => pwm2, pin33
|
|
|
|
ff680030 => pwm3, pin32
|
2022-11-05 14:42:28 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
## Next steps for developers
|
2022-11-05 14:42:28 +08:00
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
* test [gpio](GPIO.md)
|
|
|
|
* test [pwm](PWM.md)
|
|
|
|
* background information for [i2c](I2C.md) in gobot
|
2022-11-05 14:42:28 +08:00
|
|
|
|
|
|
|
## Links
|
|
|
|
|
2022-11-13 23:26:26 +08:00
|
|
|
* <https://www.digi.com/resources/documentation/digidocs/embedded/dey/3.0/cc8x/bsp_r_create-dt-overlays>
|