Difference between revisions of "PINE64 PinePhone (pine64-pinephone)"
|Line 104:||Line 104:|
== Components ==
== Components ==
Revision as of 13:29, 6 November 2019
The PinePhone has a serial port in the headphone connector, it's activated by the 6th contact on the dipswitch. If the switch is on then the headphone connector is in audio mode, if it's off then it's in UART mode.
The uart is 115200n8
The pinout for the serial connector on the tablet side is:
- Tip: RX
- Ring: TX
- Sleeve: GND
The serial connection is 3.3V
You can also buy the debug cable from PINE64 Store
There's a 6 contact dipswitch on the back of the phone underneath the back cover. The 6 switches are for enableing/disableing hardware components. The switch has tiny numbers 1-6 beneath the contacts, moving the contact up sets that contact on.
|1||Modem disabled||Modem enabled|
|2||Wifi/BT disabled||Wifi/BT enabled|
|3||Microphone disabled||Microphone enabled|
|4||Rear camera disabled||Rear camera enabled|
|5||Front camera disabled||Front camera enabled|
|6||Headphone UART mode||Headphone audio mode|
There is a 2x3 grid of pogo pins on the back of the pinephone for connecting a back cover with extra hardware like an extended battery case or a keyboard case. The pinout for this connector:
the USB5v line is meant to charge the phone and the 3v3 is to power peripherals to the phone. The I2C and interrupt lines have pull-ups on the phone side.
|Rear camera||OmniVision OV5640||VIDEO_OV5640|
|Camera flash||SGMICRO SGM3140||LEDS_SGM3140|
|Front camera||GalaxyCore GC2145||Nope|
|Ambient light / Proximity||SensorTek STK3335||STK3310|
|Volume buttons||Buttons connected to the KEYADC||KEYBOARD_SUN4I_LRADC|
|Power button||X-Powers AXP803||INPUT_AXP20X_PEK|
|Battery fuel gauge||X-Powers AXP803||BATTERY_AXP20X|
The camera's both share the csi-0 bus. Currently only the rear camera (OV5640) has mainline linux support.
It's also not clear how the camera switching would work on the software side, maybe Linux just deals with it if the device tree nodes for the second camera get added.
The camera hardware pipeline is controlled with
media-ctl, the result is on
pine-dontbeevil:~# media-ctl --set-v4l2 '"ov5640 2-003c":0[fmt:UYVY8_2X8/1280x720]' pine-dontbeevil:~# ffmpeg -s 1280x720 -f video4linux2 -i /dev/video0 -vframes 1 selfie.jpg
The camera flash consist out of a SG Micro SGM3140 "500mA Buck/Boost Charge Pump LED Driver" and a EHP-C04 LED.
The driver supports Flash and Torch mode, the first being brighter but only for about 300ms, when it switches to Torch mode. Torch mode is lower brightness but can be turned on continuously.
# Turn on Flash, wait 0.3s, turn off echo 1 > /sys/class/leds/sgm3140-flash/flash_strobe sleep 0.3 echo 0 > /sys/class/leds/sgm3140-flash/flash_strobe
# Turn on Torch echo 1 > /sys/class/leds/sgm3140-flash/brightness # Turn off Torch echo 0 > /sys/class/leds/sgm3140-flash/flash_strobe
There is a patch series on lkml. A v2 for this series is in progress.
Receiving text messages works. Calls should work too but weren't tested yet.
All sensors work and are accessible as Industrial I/O (iio) devices in linux. To query the data you can cat the files in `/sys/bus/iio/` to make the kernel module query the sensors
dontbeevil:~# cat /sys/bus/iio/devices/iio\:device0/name mpu6050 dontbeevil:~# cat /sys/bus/iio/devices/iio\:device0/in_accel_z_raw -17594 dontbeevil:~# echo "Verified gravity still exists"
The RGB led works with the led driver, but due to hardware bugs there can be only one led active at the same time and the blue led doesn't work because some pins are reversed.
# Activate LED echo 1 > /sys/class/leds/$COLOR/brightness # Deactivate LED echo 0 > /sys/class/leds/$COLOR/brightness
Sound output should work after unmuting
AIF1 Slot 0 digital
Doesn't work yet.
Doesn't work for MartijnBraam, reported to work for other people.
- pmaports!308 Initial merge request