ZIA CB(EN) - DigitalMediaProfessionals/dv-sdk GitHub Wiki

Register

The followings are register configuration for zia-firmware-c3* newer than version 7.0.20190215. The base address is 0xa0001000. LED is not available. Use /dev/mem to read the status.

bit R/W Functionality Remark
31:20 - Reserved
19 R State of CB S6-4 (0:ON, 1:OFF)
18 R State of CB S6-3 (0:ON, 1:OFF)
17 R State of CB S6-2 (0:ON, 1:OFF)
16 R State of CB S6-1 (0:ON, 1:OFF)
15:4 - Reserved
3 R Push Button(S5) State
2 R Push Button(S4) State
1 R Push Button(S3) State
0 R Push Button(S2) State

The followings are configurations for zia-firmware-c3* version 7.0.20190215 or older.

Offset Register R/W Functionality Remarks
0x0000 GPI_00 R DIP Switch(S6) State
0x0010 GPI_P0 R Push Button(S2) State
0x0014 GPI_P1 R Push Button(S3) State
0x0018 GPI_P2 R Push Button(S4) State
0x001C GPI_P3 R Push Button(S5) State
0x0020 GPO_0 RW General LED(LED1-4) Read Modify Write is required
0x0030 GPIO_00 GPIO control for PF_IO0(K12)
0x0034 GPIO_01 GPIO control for PF_IO1(K13)
0x0038 GPIO_02 GPIO control for PF_IO2(F13)

Detail of Register

GPI_00

bit R/W Functionality Remark
31:4 - Reserved
3 R State of CB S6-4 (0:ON, 1:OFF)
2 R State of CB S6-3 (0:ON, 1:OFF)
1 R State of CB S6-2 (0:ON, 1:OFF)
0 R State of CB S6-1 (0:ON, 1:OFF)

GPI_P0

bit R/W Functionality Remark
31:1 - Reserved
0 R State of CB S2 (0:Not Pushed, 1:Pushed) State is reset to zero upon read

GPI_P1

bit R/W Functionality Remark
31:1 - Reserved
0 R State of CB S3 (0:Not Pushed, 1:Pushed) State is reset to zero upon read

GPI_P2

bit R/W Functionality Remark
31:1 - Reserved
0 R State of CB S4 (0:Not Pushed, 1:Pushed) State is reset to zero upon read

GPI_P3

bit R/W Functionality Remark
31:1 - Reserved
0 R State of CB S5 (0:Not Pushed, 1:Pushed) State is reset to zero upon read

GPO_0

bit R/W Functionality Remark
31:4 - Reserved
3 RW CB LED4 Control(0:OFF, 1:ON)
2 RW CB LED3 Control(0:OFF, 1:ON)
1 RW CB LED2 Control(0:OFF, 1:ON)
0 RW CB LED1 Control(0:OFF, 1:ON)

GPIO_00

bit R/W Functionality Remark
31:2 - Reserved
1 RW RF_IO0 DIR(0:Input, 1:Output) Output will be Hi-z when set to Input
0 R Data Access (Input Case)
0 RW Data Access (Ouput Case)

GPIO_01

bit R/W Functionality Remark
31:2 - Reserved
1 RW RF_IO1 DIR(0:Input, 1:Output) Output will be Hi-z when set to Input
0 R Data Access (Input Case)
0 RW Data Access (Ouput Case)

GPIO_02

bit R/W Functionality Remark
31:2 - Reserved
1 RW RF_IO2 DIR(0:Input, 1:Output) Output will be Hi-z when set to Input
0 R Data Access (Input Case)
0 RW Data Access (Ouput Case)

GPIO

Here describes how to use GPIO

PS_MIOxx

You can operate PS_MIOxx(x is a numeral) by Linux sysfs which is described in an official documentation.

Before accessing sysfs, configure your module to enable GPIO by our program.


$ # initialize gpio by DMP program
$ cd /home/ubuntu/dv-sdk/utils/ && make
$ sudo ./reset_mio_c3 xx

$ # /sys/class/gpio/gpioxx/ is created.
$ echo $(( $(cat /sys/class/gpio/gpiochip*/base) + xx )) > /sys/class/gpio/export

$ # You can get information by `cat /sys/class/gpio/gpioxx/{direction,value,edge,active_low}`. 
$ # See [https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/Documentation/gpio/sysfs.txt?h=v4.14.96] for each file.

$ # finalize
$ echo $(( $(cat /sys/class/gpio/gpiochip*/base) + xx )) > /sys/class/gpio/unexport

C programs can operate as well. See Xilinx-Wiki.

NOTE PS_MIO32/PS_MIO33/PS_MIO42 are reserved and not avaiable to users.

PF_IOx

PF_IOx is not available yet.