Navi: Unterschied zwischen den Versionen
aus Metalab Wiki, dem offenen Zentrum für meta-disziplinäre Magier und technisch-kreative Enthusiasten.
Zur Navigation springenZur Suche springenDannym (Diskussion | Beiträge) |
Dannym (Diskussion | Beiträge) K (→TODO) |
||
(60 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 10: | Zeile 10: | ||
* GPS | * GPS | ||
* FM-Radio | * FM-Radio | ||
− | * VAN Bus Controller für Display etc | + | * VAN Bus Controller für Display, Tasten etc |
= Hardware, konkret = | = Hardware, konkret = | ||
− | * 5 V " | + | * 12 V -> 5 V Anker PowerDrive 2 Auto "Ladegerät" 24W / 4.8A 2-Port USB |
− | * | + | * [https://www.olimex.com/Products/Modules/GPS/MOD-GPS/resources/UBX-G7020_HardwareIntegrationManual_-GPS.G7-HW-10003-_Confidential.pdf U-Blox 7] GPS Receiver |
− | * | + | * [http://www.atmel.com/images/doc4205.pdf TSS463-AA] VAN Bus Controller |
− | * MCP2551 CAN Line Driver | + | * [http://ww1.microchip.com/downloads/en/DeviceDoc/21667f.pdf MCP2551] CAN Line Driver |
− | * RDA5807M FM Radio | + | * [http://www.seeedstudio.com/wiki/images/8/88/RDA5807M_datasheet_v1.1.pdf RDA5807M] FM Radio |
− | * TDA7850 4-Kanal-Audio-Verstärker | + | * [http://www.st.com/web/en/resource/technical/document/datasheet/CD00145702.pdf TDA7850] 4-Kanal-Audio-Verstärker |
− | * PT7313E Audio Filter | + | * [http://www.stt-tec.com/uploadfiles/20110928055818433.pdf PT7313E] Audio Filter |
− | * A20-OLinuXIno-LIME2 Host Computer | + | * [http://datasheets.maximintegrated.com/en/ds/MAX3000E-MAX3012.pdf MAX3002] Level Shifter |
+ | * [https://www.olimex.com/Products/OLinuXino/A20/A20-OLinuXIno-LIME2/resources/A20-OLinuXino-LIME2-UM.pdf A20-OLinuXIno-LIME2] Host Computer | ||
= Verbindungen = | = Verbindungen = | ||
− | * 5 V Netzteil für Auto: ISO-Stecker, USB | + | * 12 V -> 5 V Anker Netzteil für Auto: ISO-Stecker, USB |
− | * MT3329 GPS Receiver: | + | * MT3329 GPS Receiver: UART4 |
− | * | + | * TSS463-AA VAN Bus Controller: SPI2 |
− | * MCP2551 CAN Line Driver: UART | + | * MCP2551 CAN Line Driver: UART, aber zwischen TSS463-AA und MCP2551 |
− | * RDA5807M FM Radio: | + | * RDA5807M FM Radio: I²C2, Antenne |
− | * TDA7850 4-Kanal-Audio-Verstärker: Cinch | + | * TDA7850 4-Kanal-Audio-Verstärker: Cinch, ISO-Stecker |
* PT7313E Audio Filter: I²C, Klinke | * PT7313E Audio Filter: I²C, Klinke | ||
* A20-OLinuXIno-LIME2 Host Computer: Ethernet | * A20-OLinuXIno-LIME2 Host Computer: Ethernet | ||
+ | |||
+ | = A20 Pinout = | ||
+ | |||
+ | * UART4: PG10,PG11 (on GPIO-1) | ||
+ | * SPI2: PC19,20,21,22 (on GPIO-1) | ||
+ | * I2C2: PB20, PB21 (on GPIO-1) | ||
+ | |||
+ | * maybeEINT: PI17 (pin# 38) (possible: PI10..PI13, PI16..PI19 incl.; prefer: PI16, PI17 [muxed UART2 RTS, CTS]) [muxed SPI0, SPI1, UART5, UART6] (on GPIO-2) | ||
+ | |||
+ | * CAN: PH20 [pin# 33], PH21 [pin# 35] (on GPIO-3) | ||
+ | * PS2: PH12, PH13, PI14, PI15 [muxed with SPI0 CS, SPI1 CS, EINT] (on GPIO-3) | ||
+ | * EINT: PH0, PH9..PH11, PH14..PH21 incl. [muxed UART3, CSI] (on GPIO-3) ^^^ best: PH8,9 [pin#11],10,11 | ||
+ | |||
+ | * FM In: FMINR, FMINL (on GPIO-4) | ||
+ | * Line In: LINEINR, LINEINL (on GPIO-4) | ||
+ | * [TV In: TVIN0, TVIN1, TVIN2, TVIN3 (on GPIO-4)] | ||
+ | |||
+ | * maybe TODO: IR (both CIR and IRDA) | ||
== Hardware-Fallstricke == | == Hardware-Fallstricke == | ||
Zeile 41: | Zeile 60: | ||
* hat möglicherweise eingebauten Verstärker | * hat möglicherweise eingebauten Verstärker | ||
** Verstärker schwierig zu finden (ist meist außerhalb des Autos) | ** Verstärker schwierig zu finden (ist meist außerhalb des Autos) | ||
− | ** Phantomspeisung zur Stromversorgung | + | ** Phantomspeisung zur Stromversorgung irgendwo drin? |
* Buchse? ISO oder DIN? Wahrscheinlich DIN. | * Buchse? ISO oder DIN? Wahrscheinlich DIN. | ||
− | * Impedanz? | + | * Impedanz? 150 Ω (wahrscheinlich)? 50 Ω (wahrscheinlich nicht)? Antennenanpassung nötig? |
== EMI == | == EMI == | ||
Zeile 66: | Zeile 85: | ||
** xgps-Testprogramm | ** xgps-Testprogramm | ||
− | == Linux | + | == Mainline Linux == |
− | + | * Hardware und Verbindungen müssen im Device-Tree-File eingetragen sein (d.h. eingetragen werden) | |
− | + | * Device Tree | |
− | + | ** offiziell sollten für Peripherie Device-Tree-Overlays verwendet werden (wird zusätzlich zum Board-Device-Tree-File geladen): | |
− | |||
− | |||
− | |||
*** Spezialsyntax __overlay__ { … } | *** Spezialsyntax __overlay__ { … } | ||
*** dtc -@ xxx.dts | *** dtc -@ xxx.dts | ||
*** Linux Command Line: dtoverlay=xxx.dtb beim Booten | *** Linux Command Line: dtoverlay=xxx.dtb beim Booten | ||
*** geht nicht in Debian, weil "/plugin/" unbekannt | *** geht nicht in Debian, weil "/plugin/" unbekannt | ||
− | + | ** Hack: Board-File editieren | |
− | |||
*** bei unserem Host: sun7i-a20-olinuxino-lime2.dts | *** bei unserem Host: sun7i-a20-olinuxino-lime2.dts | ||
*** folgendes hinten anhängen und dann: make dtbs und die entstehende Datei sun7i-a20-olinuxino-lime2.dtb dem Bootvorgang zur Verfügung stellen | *** folgendes hinten anhängen und dann: make dtbs und die entstehende Datei sun7i-a20-olinuxino-lime2.dtb dem Bootvorgang zur Verfügung stellen | ||
<pre> | <pre> | ||
+ | #include <dt-bindings/pwm/pwm.h> | ||
+ | |||
+ | / { | ||
+ | pwm_bl: backlight { | ||
+ | compatible = "pwm-backlight"; | ||
+ | pwms = <&pwm0 0 50000>; /* FIXME settings; FIXME use pwm0_pins_a. */ | ||
+ | brightness-levels = <0 2 5 7 10 12 15 17 255>; /* FIXME more */ | ||
+ | default-brightness-level = <0>; | ||
+ | |||
+ | pinctrl-names = "default"; | ||
+ | pinctrl-0 = <&bl_enable_pin>; | ||
+ | enable-gpios = <&pio 7 8 GPIO_ACTIVE_HIGH>; /* FIXME: LCD power: PH8. */ | ||
+ | }; | ||
+ | |||
+ | panel: panel { | ||
+ | compatible = "innolux,at070tn92", "panel-dpi"; | ||
+ | backlight = <&pwm_bl>; | ||
+ | /* TODO power-supply = <&vdd_pnl_reg> */ | ||
+ | #address-cells = <1>; | ||
+ | #size-cells = <0>; | ||
+ | port@0 { | ||
+ | reg = <0>; | ||
+ | #address-cells = <1>; | ||
+ | #size-cells = <0>; | ||
+ | panel_input: endpoint { | ||
+ | reg = <0>; | ||
+ | remote-endpoint = <&tcon0_out_lcd>; | ||
+ | }; | ||
+ | }; | ||
+ | }; | ||
+ | }; | ||
+ | |||
+ | &pio { | ||
+ | ... | ||
+ | bl_enable_pin: bl_enable_pin@0 { | ||
+ | pins = "PH8"; | ||
+ | function = "gpio_out"; | ||
+ | }; | ||
+ | lcd_rgb888_pins: lcd-rgb888 { | ||
+ | pins = "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", | ||
+ | "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", | ||
+ | "PD16", "PD17", "PD18", "PD19", "PD20", "PD21", "PD22", "PD23", | ||
+ | "PD24", "PD25", "PD26", "PD27"; | ||
+ | function = "lcd0"; | ||
+ | }; | ||
+ | }; | ||
+ | |||
&uart4 { | &uart4 { | ||
pinctrl-names = “default”; | pinctrl-names = “default”; | ||
pinctrl-0 = <&uart4_pins_a>; | pinctrl-0 = <&uart4_pins_a>; | ||
status = “okay”; | status = “okay”; | ||
+ | }; | ||
+ | |||
+ | tss463aa_clock_source: oscillator { | ||
+ | #clock-cells = <0>; | ||
+ | compatible = "fixed-clock"; | ||
+ | clock-frequency = <4000000>; | ||
}; | }; | ||
Zeile 93: | Zeile 161: | ||
status = “okay”; | status = “okay”; | ||
pinctrl-names = “default”; | pinctrl-names = “default”; | ||
− | pinctrl-0 = <&spi2_pins_a>; | + | pinctrl-0 = <&spi2_pins_a>, <&spi2_cs0_pins_a>; |
van0: tss463aa@1 { | van0: tss463aa@1 { | ||
compatible = “atmel,tss463aa”; | compatible = “atmel,tss463aa”; | ||
reg = <0>; | reg = <0>; | ||
+ | interrupt-parent = <&pio>; | ||
+ | interrupts = <8 10 IRQ_TYPE_LEVEL_LOW>; /* PI10 / EINT22 */ /* TODO specify as gpio-in */ | ||
+ | interrupt-names = "activity"; | ||
spi-max-frequency = <4000000>; | spi-max-frequency = <4000000>; | ||
spi-cpol; | spi-cpol; | ||
spi-cpha; | spi-cpha; | ||
+ | clocks = <&tss463aa_clock_source>; | ||
+ | tss463aa,diagnosis-mode = <0>; | ||
}; | }; | ||
}; | }; | ||
Zeile 111: | Zeile 184: | ||
&codec { | &codec { | ||
status = “okay”; | status = “okay”; | ||
+ | }; | ||
+ | |||
+ | /* touchscreen */ | ||
+ | &rtp { | ||
+ | allwinner,ts-attached; | ||
+ | #thermal-sensor-cells = <0>; | ||
+ | /* sensitive/noisy touch panel */ | ||
+ | allwinner,tp-sensitive-adjust = <0>; | ||
+ | allwinner,filter-type = <3>; | ||
+ | }; | ||
+ | |||
+ | &pwm { | ||
+ | pinctrl-names = "default"; | ||
+ | pinctrl-0 = <&pwm0_pins_a>, <&pwm1_pins_a>; | ||
+ | status = "okay"; | ||
+ | }; | ||
+ | |||
+ | &tcon0 { | ||
+ | pinctrl-names = "default"; | ||
+ | pinctrl-0 = <&lcd_rgb888_pins>; | ||
+ | status = "okay"; | ||
+ | }; | ||
+ | |||
+ | &tcon0_out { | ||
+ | tcon0_out_lcd: endpoint@0 { | ||
+ | reg = <0>; | ||
+ | remote-endpoint = <&panel_input>; | ||
+ | }; | ||
}; | }; | ||
</pre> | </pre> | ||
− | * Für spidev in Linux drivers/spi/spidev.c editieren : | + | * Für spidev in Linux drivers/spi/spidev.c editieren: |
** das Array spidev_dt_ids erweitern um | ** das Array spidev_dt_ids erweitern um | ||
<pre> | <pre> | ||
Zeile 131: | Zeile 232: | ||
== User-Space == | == User-Space == | ||
− | * Zugriff auf SPI über spidev | + | * Zugriff auf SPI über spidev (Später: Selbstgeschriebenes CAN-Kernel-Modul) |
** Linux-Source muss editiert werden., damit /dev/-Datei erscheint | ** Linux-Source muss editiert werden., damit /dev/-Datei erscheint | ||
+ | ** es existieren verschiedene Headerfiles für SPI. Vorsicht! linux-headers-Paket im User Space installieren&verwenden, nicht /usr/src/linux/include | ||
* Zugriff auf I2C funktioniert auch so | * Zugriff auf I2C funktioniert auch so | ||
* Zugriff auf UART funktioniert auch so | * Zugriff auf UART funktioniert auch so | ||
Zeile 141: | Zeile 243: | ||
http://svn.nomike.com/playground/trunk/Navi/ | http://svn.nomike.com/playground/trunk/Navi/ | ||
+ | |||
+ | = Softwarekonfiguration = | ||
+ | |||
+ | http://www.catb.org/gpsd/gpsd-time-service-howto.html | ||
+ | |||
+ | Linux Kernel: | ||
+ | |||
+ | CONFIG_PPS=y | ||
+ | CONFIG_PPS_CLIENT_LDISC=y | ||
= TODO = | = TODO = | ||
− | * | + | * SocketCAN-Netzwerkmodul für VAN-Bus: https://github.com/daym/linux/blob/van/drivers/net/can/spi/tss463aa.c |
− | ** | + | |
− | * | + | = VAN Bus Monitoring Ergebnisse = |
− | ** | + | |
+ | == Participiants (Arbitration IDs) on the Bus (Peugeot 307 XS) == | ||
+ | |||
+ | <pre> | ||
+ | 0x4d4/RTR Radio Settings | ||
+ | 0x4ec/RTR Track Time | ||
+ | 0x4fc/RTR Lights in Instrument Array | ||
+ | 0x524/RTR Car Status 2 | ||
+ | 0x554/RTR RDS Repeater | ||
+ | 0x664/RTR Middle Console Buttons | ||
+ | 0x824/RTR Speed and RPM | ||
+ | 0x8a4/RTR Display | ||
+ | 0x8c4/RTR Radio Buttons | ||
+ | 0x9c4/RTR Steering Wheel Radio Remote Control Stick | ||
+ | 0xe24/RTR VIN | ||
+ | </pre> | ||
+ | |||
+ | === 0x4fc/RTR Lights in Instrument Array === | ||
+ | |||
+ | * Offset 5: | ||
+ | ** Mask 0x80: Headlight low | ||
+ | ** Mask 0x40: Headlight high | ||
+ | ** Mask 0x20: Front fog lights | ||
+ | ** Mask 0x10: Rear fog lights | ||
+ | ** Mask 0x08: Right turn indicator | ||
+ | ** Mask 0x04: Left turn indicator | ||
+ | |||
+ | === 0x664/RTR Middle Console Buttons === | ||
+ | |||
+ | * Offset 0: | ||
+ | ** Mask 0x02: Hazard | ||
+ | * Offset 2: | ||
+ | ** Mask 0x40: Door lock | ||
+ | ** Mask 0x0F: Brightness | ||
+ | * Offset 3: | ||
+ | ** Mask 0x02: ESP off | ||
+ | |||
+ | === 0x824/RTR Speed and RPM === | ||
+ | |||
+ | * Offset 0 .. 1: RPM | ||
+ | ** X/10 if X != 0xFFFF else None | ||
+ | * Offset 2 .. 3: Speed | ||
+ | ** X/100 if X != 0xFFFF else None | ||
+ | * Offset 4 .. 6: Sequence | ||
+ | |||
+ | === 0x8a4/RTR Display === | ||
+ | |||
+ | * Offset 0: | ||
+ | ** Mask 0x0F: Backlight intensity | ||
+ | ** Mask 0x80: ??? | ||
+ | |||
+ | === 0x9c4/RTR Steering Wheel Radio Remote Control Stick === | ||
+ | |||
+ | * Offset 0: "Buttons" | ||
+ | ** Mask 0x02: Source (outermost right button) | ||
+ | ** Mask 0x04: Decrease volume | ||
+ | ** Mask 0x08: Increase volume | ||
+ | ** Mask 0x40: Seek- (bottom) | ||
+ | ** Mask 0x80: Seek+ (top) | ||
[[Kategorie:Projekte]] | [[Kategorie:Projekte]] |
Aktuelle Version vom 6. September 2018, 18:53 Uhr
Ziele
- Linux-Navigationsgerät fürs Auto bauen mit ausschließlich Free Software.
- Einarbeiten in UART, SPI, I²C, SPI mit Linux >= 4.4
- Spaß haben
Hardware, abstrakt
- Stromversorgung
- GPS
- FM-Radio
- VAN Bus Controller für Display, Tasten etc
Hardware, konkret
- 12 V -> 5 V Anker PowerDrive 2 Auto "Ladegerät" 24W / 4.8A 2-Port USB
- U-Blox 7 GPS Receiver
- TSS463-AA VAN Bus Controller
- MCP2551 CAN Line Driver
- RDA5807M FM Radio
- TDA7850 4-Kanal-Audio-Verstärker
- PT7313E Audio Filter
- MAX3002 Level Shifter
- A20-OLinuXIno-LIME2 Host Computer
Verbindungen
- 12 V -> 5 V Anker Netzteil für Auto: ISO-Stecker, USB
- MT3329 GPS Receiver: UART4
- TSS463-AA VAN Bus Controller: SPI2
- MCP2551 CAN Line Driver: UART, aber zwischen TSS463-AA und MCP2551
- RDA5807M FM Radio: I²C2, Antenne
- TDA7850 4-Kanal-Audio-Verstärker: Cinch, ISO-Stecker
- PT7313E Audio Filter: I²C, Klinke
- A20-OLinuXIno-LIME2 Host Computer: Ethernet
A20 Pinout
- UART4: PG10,PG11 (on GPIO-1)
- SPI2: PC19,20,21,22 (on GPIO-1)
- I2C2: PB20, PB21 (on GPIO-1)
- maybeEINT: PI17 (pin# 38) (possible: PI10..PI13, PI16..PI19 incl.; prefer: PI16, PI17 [muxed UART2 RTS, CTS]) [muxed SPI0, SPI1, UART5, UART6] (on GPIO-2)
- CAN: PH20 [pin# 33], PH21 [pin# 35] (on GPIO-3)
- PS2: PH12, PH13, PI14, PI15 [muxed with SPI0 CS, SPI1 CS, EINT] (on GPIO-3)
- EINT: PH0, PH9..PH11, PH14..PH21 incl. [muxed UART3, CSI] (on GPIO-3) ^^^ best: PH8,9 [pin#11],10,11
- FM In: FMINR, FMINL (on GPIO-4)
- Line In: LINEINR, LINEINL (on GPIO-4)
- [TV In: TVIN0, TVIN1, TVIN2, TVIN3 (on GPIO-4)]
- maybe TODO: IR (both CIR and IRDA)
Hardware-Fallstricke
FM-Antenne
- vorhanden am Auto etc
- hat möglicherweise eingebauten Verstärker
- Verstärker schwierig zu finden (ist meist außerhalb des Autos)
- Phantomspeisung zur Stromversorgung irgendwo drin?
- Buchse? ISO oder DIN? Wahrscheinlich DIN.
- Impedanz? 150 Ω (wahrscheinlich)? 50 Ω (wahrscheinlich nicht)? Antennenanpassung nötig?
EMI
- ElectroMagnetic Interference
- unsere Hardware stellt viele Hochfrequenzstörquellen dar
- Störung von außen gibt’s vielleicht auch
- Audioverstärker sollte nicht gestört werden
- Faradayscher Käfig nötig (1 oder mehr)
- Filterplatte mit Masse
- min. 2 Lagen
Ghost in the Machine
- Pull-Up-Widerstände sind auf den Kommunikationsleitungen notwendig, damit kein Blödsinn gesendet/empfangen wird, wenn ein Gerät ohne Strom ist
Software
- Selbstgebastelte (wenn sinnvoll User-Space-) Treiber für die Hardware
- MT3329 geht über gpsd schon
- xgps-Testprogramm
Mainline Linux
- Hardware und Verbindungen müssen im Device-Tree-File eingetragen sein (d.h. eingetragen werden)
- Device Tree
- offiziell sollten für Peripherie Device-Tree-Overlays verwendet werden (wird zusätzlich zum Board-Device-Tree-File geladen):
- Spezialsyntax __overlay__ { … }
- dtc -@ xxx.dts
- Linux Command Line: dtoverlay=xxx.dtb beim Booten
- geht nicht in Debian, weil "/plugin/" unbekannt
- Hack: Board-File editieren
- bei unserem Host: sun7i-a20-olinuxino-lime2.dts
- folgendes hinten anhängen und dann: make dtbs und die entstehende Datei sun7i-a20-olinuxino-lime2.dtb dem Bootvorgang zur Verfügung stellen
- offiziell sollten für Peripherie Device-Tree-Overlays verwendet werden (wird zusätzlich zum Board-Device-Tree-File geladen):
#include <dt-bindings/pwm/pwm.h> / { pwm_bl: backlight { compatible = "pwm-backlight"; pwms = <&pwm0 0 50000>; /* FIXME settings; FIXME use pwm0_pins_a. */ brightness-levels = <0 2 5 7 10 12 15 17 255>; /* FIXME more */ default-brightness-level = <0>; pinctrl-names = "default"; pinctrl-0 = <&bl_enable_pin>; enable-gpios = <&pio 7 8 GPIO_ACTIVE_HIGH>; /* FIXME: LCD power: PH8. */ }; panel: panel { compatible = "innolux,at070tn92", "panel-dpi"; backlight = <&pwm_bl>; /* TODO power-supply = <&vdd_pnl_reg> */ #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; #address-cells = <1>; #size-cells = <0>; panel_input: endpoint { reg = <0>; remote-endpoint = <&tcon0_out_lcd>; }; }; }; }; &pio { ... bl_enable_pin: bl_enable_pin@0 { pins = "PH8"; function = "gpio_out"; }; lcd_rgb888_pins: lcd-rgb888 { pins = "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PD16", "PD17", "PD18", "PD19", "PD20", "PD21", "PD22", "PD23", "PD24", "PD25", "PD26", "PD27"; function = "lcd0"; }; }; &uart4 { pinctrl-names = “default”; pinctrl-0 = <&uart4_pins_a>; status = “okay”; }; tss463aa_clock_source: oscillator { #clock-cells = <0>; compatible = "fixed-clock"; clock-frequency = <4000000>; }; &spi2 { status = “okay”; pinctrl-names = “default”; pinctrl-0 = <&spi2_pins_a>, <&spi2_cs0_pins_a>; van0: tss463aa@1 { compatible = “atmel,tss463aa”; reg = <0>; interrupt-parent = <&pio>; interrupts = <8 10 IRQ_TYPE_LEVEL_LOW>; /* PI10 / EINT22 */ /* TODO specify as gpio-in */ interrupt-names = "activity"; spi-max-frequency = <4000000>; spi-cpol; spi-cpha; clocks = <&tss463aa_clock_source>; tss463aa,diagnosis-mode = <0>; }; }; &i2c2 { pinctrl-names = “default”; pinctrl-0 = <&i2c2_pins_a>; status = “okay”; }; &codec { status = “okay”; }; /* touchscreen */ &rtp { allwinner,ts-attached; #thermal-sensor-cells = <0>; /* sensitive/noisy touch panel */ allwinner,tp-sensitive-adjust = <0>; allwinner,filter-type = <3>; }; &pwm { pinctrl-names = "default"; pinctrl-0 = <&pwm0_pins_a>, <&pwm1_pins_a>; status = "okay"; }; &tcon0 { pinctrl-names = "default"; pinctrl-0 = <&lcd_rgb888_pins>; status = "okay"; }; &tcon0_out { tcon0_out_lcd: endpoint@0 { reg = <0>; remote-endpoint = <&panel_input>; }; };
- Für spidev in Linux drivers/spi/spidev.c editieren:
- das Array spidev_dt_ids erweitern um
{ .compatible = “atmel,tss463aa” },
- vor dem (existierenden) Sentinel
{},
- dann ausführen:
make modules make modules_install
User-Space
- Zugriff auf SPI über spidev (Später: Selbstgeschriebenes CAN-Kernel-Modul)
- Linux-Source muss editiert werden., damit /dev/-Datei erscheint
- es existieren verschiedene Headerfiles für SPI. Vorsicht! linux-headers-Paket im User Space installieren&verwenden, nicht /usr/src/linux/include
- Zugriff auf I2C funktioniert auch so
- Zugriff auf UART funktioniert auch so
- Interrupts (EINTxx):
- /sys/class/gpioXXX/edge
- /sys/class/gpioXXX/uevent
- poll() oder select() auf errors
http://svn.nomike.com/playground/trunk/Navi/
Softwarekonfiguration
http://www.catb.org/gpsd/gpsd-time-service-howto.html
Linux Kernel:
CONFIG_PPS=y CONFIG_PPS_CLIENT_LDISC=y
TODO
- SocketCAN-Netzwerkmodul für VAN-Bus: https://github.com/daym/linux/blob/van/drivers/net/can/spi/tss463aa.c
VAN Bus Monitoring Ergebnisse
Participiants (Arbitration IDs) on the Bus (Peugeot 307 XS)
0x4d4/RTR Radio Settings 0x4ec/RTR Track Time 0x4fc/RTR Lights in Instrument Array 0x524/RTR Car Status 2 0x554/RTR RDS Repeater 0x664/RTR Middle Console Buttons 0x824/RTR Speed and RPM 0x8a4/RTR Display 0x8c4/RTR Radio Buttons 0x9c4/RTR Steering Wheel Radio Remote Control Stick 0xe24/RTR VIN
0x4fc/RTR Lights in Instrument Array
- Offset 5:
- Mask 0x80: Headlight low
- Mask 0x40: Headlight high
- Mask 0x20: Front fog lights
- Mask 0x10: Rear fog lights
- Mask 0x08: Right turn indicator
- Mask 0x04: Left turn indicator
0x664/RTR Middle Console Buttons
- Offset 0:
- Mask 0x02: Hazard
- Offset 2:
- Mask 0x40: Door lock
- Mask 0x0F: Brightness
- Offset 3:
- Mask 0x02: ESP off
0x824/RTR Speed and RPM
- Offset 0 .. 1: RPM
- X/10 if X != 0xFFFF else None
- Offset 2 .. 3: Speed
- X/100 if X != 0xFFFF else None
- Offset 4 .. 6: Sequence
0x8a4/RTR Display
- Offset 0:
- Mask 0x0F: Backlight intensity
- Mask 0x80: ???
0x9c4/RTR Steering Wheel Radio Remote Control Stick
- Offset 0: "Buttons"
- Mask 0x02: Source (outermost right button)
- Mask 0x04: Decrease volume
- Mask 0x08: Increase volume
- Mask 0x40: Seek- (bottom)
- Mask 0x80: Seek+ (top)