chip

package
v2.2.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package chip contains header definitions for NextThing Co's C.H.I.P. board.

CHIP uses the Allwinner R8 processor and thus the allwinner host package is automatically imported.

This package exports the U13 header, which is opposite the power LED, and U14, which is right next to the power LED. Most of the pins are usable as GPIO and are directly to the processor. These can use memory-mapped GPIO, which is very fast. The XIO-P0 through XIO-P7 pins are attached to a pcf8574 I²C expander which has the result that all accesses to these pins have to go through the kernel and the I²C bus protocol, i.e., they're slow.

GPIO edge detection (using interrupts) is only supported on a few of the processor's pins: AP-EINT1, AP-EINT3, CSIPCK, and CSICK. Edge detection is also supported on the XIO pins, but this feature is rather limited due to the device and the driver (for example, the driver interrupts on all edges).

References

http://www.chip-community.org/index.php/Hardware_Information

http://docs.getchip.com/chip.html#chip-hardware

A graphical view of the board headers is available at: http://docs.getchip.com/chip.html#pin-headers

Index

Constants

This section is empty.

Variables

View Source
var (
	TEMP_SENSOR = &pin.BasicPin{N: "TEMP_SENSOR"}
	PWR_SWITCH  = &pin.BasicPin{N: "PWR_SWITCH"}
	// XIO "gpio" pins attached to the pcf8574 I²C port extender.
	XIO0, XIO1, XIO2, XIO3, XIO4, XIO5, XIO6, XIO7 gpio.PinIO
)

C.H.I.P. hardware pins.

View Source
var (
	U13_1  = pin.GROUND     //
	U13_2  = pin.DC_IN      //
	U13_3  = pin.V5         // (filtered)
	U13_4  = pin.GROUND     //
	U13_5  = pin.V3_3       //
	U13_6  = TEMP_SENSOR    // Analog temp sensor input
	U13_7  = pin.V1_8       //
	U13_8  = pin.BAT_PLUS   // External LiPo battery
	U13_9  = allwinner.PB16 // I2C1_SDA
	U13_10 = PWR_SWITCH     // Power button
	U13_11 = allwinner.PB15 // I2C1_SCL
	U13_12 = pin.GROUND     //
	U13_13 = allwinner.X1   // Touch screen X1
	U13_14 = allwinner.X2   // Touch screen X2
	U13_15 = allwinner.Y1   // Touch screen Y1
	U13_16 = allwinner.Y2   // Touch screen Y2
	U13_17 = allwinner.PD2  // LCD-D2; UART2_TX firmware probe for 1-wire to detect DIP at boot; http://docs.getchip.com/dip.html#dip-identification
	U13_18 = allwinner.PB2  // PWM0; EINT16
	U13_19 = allwinner.PD4  // LCD-D4; UART2_CTS
	U13_20 = allwinner.PD3  // LCD-D3; UART2_RX
	U13_21 = allwinner.PD6  // LCD-D6
	U13_22 = allwinner.PD5  // LCD-D5
	U13_23 = allwinner.PD10 // LCD-D10
	U13_24 = allwinner.PD7  // LCD-D7
	U13_25 = allwinner.PD12 // LCD-D12
	U13_26 = allwinner.PD11 // LCD-D11
	U13_27 = allwinner.PD14 // LCD-D14
	U13_28 = allwinner.PD13 // LCD-D13
	U13_29 = allwinner.PD18 // LCD-D18
	U13_30 = allwinner.PD15 // LCD-D15
	U13_31 = allwinner.PD20 // LCD-D20
	U13_32 = allwinner.PD19 // LCD-D19
	U13_33 = allwinner.PD22 // LCD-D22
	U13_34 = allwinner.PD21 // LCD-D21
	U13_35 = allwinner.PD24 // LCD-CLK
	U13_36 = allwinner.PD23 // LCD-D23
	U13_37 = allwinner.PD26 // LCD-VSYNC
	U13_38 = allwinner.PD27 // LCD-HSYNC
	U13_39 = pin.GROUND     //
	U13_40 = allwinner.PD25 // LCD-DE: RGB666 data
)

The U13 header is opposite the power LED.

The alternate pin functionality is described at pages 322-323 of https://github.com/NextThingCo/CHIP-Hardware/raw/master/CHIP%5Bv1_0%5D/CHIPv1_0-BOM-Datasheets/Allwinner%20R8%20User%20Manual%20V1.1.pdf

View Source
var (
	U14_1  = pin.GROUND         //
	U14_2  = pin.V5             // (filtered)
	U14_3  = allwinner.PG3      // UART1_TX; EINT3
	U14_4  = allwinner.HP_LEFT  // Headphone left output
	U14_5  = allwinner.PG4      // UART1_RX; EINT4
	U14_6  = allwinner.HP_COM   // Headphone amp out
	U14_7  = allwinner.FEL      // Boot mode selection
	U14_8  = allwinner.HP_RIGHT // Headphone right output
	U14_9  = pin.V3_3           //
	U14_10 = allwinner.MIC_GND  // Microphone ground
	U14_11 = allwinner.KEY_ADC  // LRADC Low res analog to digital
	U14_12 = allwinner.MIC_IN   // Microphone input
	U14_13 = XIO0               // gpio via I²C controller
	U14_14 = XIO1               // gpio via I²C controller
	U14_15 = XIO2               // gpio via I²C controller
	U14_16 = XIO3               // gpio via I²C controller
	U14_17 = XIO4               // gpio via I²C controller
	U14_18 = XIO5               // gpio via I²C controller
	U14_19 = XIO6               // gpio via I²C controller
	U14_20 = XIO7               // gpio via I²C controller
	U14_21 = pin.GROUND         //
	U14_22 = pin.GROUND         //
	U14_23 = allwinner.PG1      // GPS_CLK; AP-EINT1
	U14_24 = allwinner.PB3      // IR_TX; AP-EINT3 (EINT17)
	U14_25 = allwinner.PB18     // I2C2_SDA
	U14_26 = allwinner.PB17     // I2C2_SCL
	U14_27 = allwinner.PE0      // CSIPCK: CMOS serial interface; SPI2_CS0; EINT14
	U14_28 = allwinner.PE1      // CSICK: CMOS serial interface; SPI2_CLK; EINT15
	U14_29 = allwinner.PE2      // CSIHSYNC; SPI2_MOSI
	U14_30 = allwinner.PE3      // CSIVSYNC; SPI2_MISO
	U14_31 = allwinner.PE4      // CSID0
	U14_32 = allwinner.PE5      // CSID1
	U14_33 = allwinner.PE6      // CSID2
	U14_34 = allwinner.PE7      // CSID3
	U14_35 = allwinner.PE8      // CSID4
	U14_36 = allwinner.PE9      // CSID5
	U14_37 = allwinner.PE10     // CSID6; UART1_RX
	U14_38 = allwinner.PE11     // CSID7; UART1_TX
	U14_39 = pin.GROUND         //
	U14_40 = pin.GROUND         //
)

The U14 header is right next to the power LED.

Functions

func Present

func Present() bool

Present returns true if running on a NextThing Co's C.H.I.P. board.

It looks for "C.H.I.P" in the device tree. The following information is expected in the device dtree:

root@chip2:/proc/device-tree# od -c compatible
0000000   n   e   x   t   t   h   i   n   g   ,   c   h   i   p  \0   a
0000020   l   l   w   i   n   n   e   r   ,   s   u   n   5   i   -   r
0000040   8  \0
root@chip2:/proc/device-tree# od -c model
0000000   N   e   x   t   T   h   i   n   g       C   .   H   .   I   .
0000020   P   .  \0

Types

This section is empty.

Directories

Path Synopsis
Package chipsmoketest is leveraged by periph-smoketest to verify that basic CHIP specific functionality works.
Package chipsmoketest is leveraged by periph-smoketest to verify that basic CHIP specific functionality works.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL