sysfs-platform-unipi.txt 14.5 KB
Newer Older
Tom Knot's avatar
Tom Knot committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345
What:		/sys/devices/platform/unipi_plc/model_name
Date:		January 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file stores the name of the UniPi PLC model detected on 
		SPI, as formed by the individual PLC boards.
		
		Returns an error if no valid combination corresponding to a 
		UniPi device can be found.

What:		/sys/devices/platform/unipi_plc/sys_eeprom_name
Date:		February 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file stores the name of the UniPi PLC model, as detected 
		on the SPI, in a four byte format which is used in the I2C 
		EEPROM. It is read only.
		
		Returns an error if no valid combination corresponding to a 
		UniPi device can be found.
		
What:		/sys/devices/platform/unipi_plc/io_group[1-9]/sys_board_name
Date:		February 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file contains the name of the UniPi PLC coprocessor board,
		the [1-9] corresponding to the SPI address which it is connected 
		to. It is read only.

		Returns an error if it a board which is a valid UniPi PLC board 
		with an unknown device id, and therefore no corresponding board
		name.
		
What:		/sys/devices/platform/unipi_plc/io_group[1-9]/sys_board_serial
Date:		February 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file contains the serial number of a UniPi PLC coprocessor
		board, with the [1-9] corresponding to the SPI address which it
		is connected to. It is read only.

		Returns a zero if the serial number is not valid.

What:		/sys/devices/platform/unipi_plc/io_group[1-9]/firmware_version
Date:		January 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file contains the firmware version number of a UniPi PLC
		coprocessor	board, with the [1-9] corresponding to the SPI address
		which it is connected to. The firmware version number uses the
		following format: [0-9,A-F].[0-9,A-F][0-9,A-F]. The file is read
		only.

		Returns an error if the version number is not valid.
		
What:		/sys/devices/platform/unipi_plc/io_group[1-9]/sys_primary_minor_id
Date:		February 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file contains the factory flashed bootloader hardware version
		of a UniPi PLC coprocessor board, with the [1-9] corresponding to
		the SPI address which it is connected to. The file is read only.

		Returns an error if the version number is not valid.
		
What:		/sys/devices/platform/unipi_plc/io_group[1-9]/sys_secondary_minor_id
Date:		February 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file contains the hardware revision of the underlying UniPi PLC
		coprocessor board, with the [1-9] corresponding to the SPI address
		which it is connected to. The file is read only.

		Returns an error if the version number is not valid.	
		
		
What:		/sys/devices/platform/unipi_plc/io_group[1-9]/sys_primary_major_id
Date:		February 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file contains the numerical hardware id reported by the underlying
		UniPi PLC coprocessor board, with the [1-9] corresponding to the SPI
		address which it is connected to. The file is read only.

		Returns the value "255" if the id request does not give a valid response.	

What:		/sys/devices/platform/unipi_plc/io_group[1-9]/sys_secondary_major_id
Date:		February 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file contains the numerical hardware id of an expension board 
		reported by the underlying UniPi PLC coprocessor board it is connected to,
		with the [1-9] corresponding to its SPI	address. The file is read only.

		Returns the value "255" if the id request does not give a valid response,
		and 0 if no coprocessor satellite expansion board is present on the SPI
		address.	


What:		/sys/devices/platform/unipi_plc/io_group[1-9]/uart_config
Date:		January 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file contains tunneled serial port termios settings for 
		the underlying Neuron board, with the [1-9] corresponding
		to its SPI address. This file can be both read and written to.

		Returns the value "0" if the underlying board does not support serial
		port tunneling.

What:		/sys/devices/platform/unipi_plc/io_group[1-9]/register_read
Date:		February 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file allows directly reading register of the underlying
		Neuron board, with the [1-9] corresponding to its SPI address.
		This file can be both read and written to; writing sets the register
		address to be read, and reading returns the value of the register in
		hexadecimal format.

		Returns the value "0" if the underlying board does not support serial
		port tunneling.
		
What:		/sys/devices/platform/unipi_plc/io_group[1-9]/uart_queue_length
Date:		January 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file contains the number of characters in the tunneled serial port
		recieve buffer on the underlying Neuron board, with the [1-9] corresponding
		to its SPI address. The file is read only.

		Returns the value "0" if the underlying board does not support serial
		port tunneling.
		
What:		/sys/devices/platform/unipi_plc/io_group[1-9]/watchdog_status
Date:		January 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file contains a '1' if the watchdog on the underlying Neuron PLC
		board has been triggered, '0' otherwise. The [1-9] corresponds to the
		SPI address of the underlying board. The file is read only.

		
What:		/sys/devices/platform/unipi_plc/io_group[1-9]/watchdog_timeout
Date:		January 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file contains the SPI watchdog timeout (in ms.) on the 
		underlying Neuron PLC board. The [1-9] corresponds to the
		SPI address of the board. This file can be both read and written to.
		
What:		/sys/devices/platform/unipi_plc/io_group[1-9]/di_[1-9]_[0-9][0-9]/direct_switch_enable
Date:		February 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file allows enabling the DirectSwitch feature for one of the inputs
		on the Neuron PLC group specified by the [1-9] address. Reading the file
		returns a 0 if the DirectSwitch feature is disabled and 1 if it is enabled.
		
		Writing a value of '1' to the file turns the DirectSwitch feature on
		for the given input in the group, while writing a value of '0' turns
		DirectSwitch for the corresponding input off.
		
What:		/sys/devices/platform/unipi_plc/io_group[1-9]/di_[1-9]_[0-9][0-9]/direct_switch_polarity
Date:		February 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file allows enabling the DirectSwitch feature for one of the inputs
		on the Neuron PLC group specified by the [1-9] address. Reading the file
		returns a 1 if the DirectSwitch feature polarity is reversed and 1 if it
		is not.

		Writing a value of '1' to the file inverts the DirectSwitch feature
		polarity for the given input in the group, while writing a value of '0'
		switches the DirectSwitch feature back to normal polarity mode.

		
What:		/sys/devices/platform/unipi_plc/io_group[1-9]/di_[1-9]_[0-9][0-9]/direct_switch_toggle
Date:		February 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file allows enabling the toggle function for the DirectSwitch 
		feature on one of the inputs on the Neuron PLC group specified by
		the [1-9] address. Reading the file	returns a value of '0' if the 
		toggle feature for the given input is enabled, and a value of '1'
		if it is not.
		
		Writing a value of '1' to the file turns the DirectSwitch toggle 
		function on	for the given input in the group, while writing a value
		of '0' turns the DirectSwitch toggle function for the corresponding 
		input off.
		
What:		/sys/devices/platform/unipi_plc/io_group[1-9]/di_[1-9]_[0-9][0-9]/di_value
Date:		February 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file contains the current status for one of the inputs on the
		Neuron PLC group specified by the [1-9] address. Reading the file
		returns a value of '0' if the corresponding digital input detects
		a logical value of 0 and a value of '1'	if it detects a logical
		value of 1.
		
		This file cannot be written to.
		
What:		/sys/devices/platform/unipi_plc/io_group[1-9]/di_[1-9]_[0-9][0-9]/counter
Date:		February 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file contains the current number of debounced impulses read in
		by the digital input on the Neuron PLC group specified by the [1-9]
		address. This file can be both read and written to.
		
		Writing to the file sets the corresponding counter to the value which
		is written into it.
		
What:		/sys/devices/platform/unipi_plc/io_group[1-9]/di_[1-9]_[0-9][0-9]/debounce
Date:		February 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file contains the number of milliseconds for which an input is 
		debounced, to prevent harmonics from accidentally triggering the
		digital input on the Neuron PLC group specified by the [1-9] 
		address. This file can be both read and written to; value of
		'0' is special and indicates that no debouncing of the input
		should be done.
		
		Writing a value of '1' to the file turns the DirectSwitch toggle 
		function on	for the given input in the group, while writing a value
		of '0' turns the DirectSwitch toggle function for the corresponding 
		input off.
		
What:		/sys/devices/platform/unipi_plc/io_group[1-9]/di_[1-9]_[0-9][0-9]/sys_gpio_di_base
Date:		February 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file specifies the internal GPIO chip number which should be used
		when the digital input is intended to be utilised as an ordinary sysfs
		GPIO device. This file can only be read.
		
What:		/sys/devices/platform/unipi_plc/io_group[1-9]/di_[1-9]_[0-9][0-9]/sys_gpio_di_prefix
Date:		February 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file specifies the internal GPIO chip prefix which should be used
		when the digital input is intended to be utilised as an ordinary sysfs
		GPIO device. This file can only be read.
		
		
What:		/sys/devices/platform/unipi_plc/io_group[1-9]/di_[1-9]_[0-9][0-9]/sys_gpio_di_count
Date:		February 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file specifies the internal GPIO chip line count which should be
		used when the digital input is intended to be used as an ordinary sysfs
		GPIO device. This file can only be read.
		
		
What:		/sys/devices/platform/unipi_plc/io_group[1-9]/do_[1-9]_[0-9][0-9]/pwm_duty_cycle
Date:		February 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file is used to set the PWM duty cycle of a digital input [0-9][1-9]
		on the undelying UniPi Neuron PLC group [1-9]. It is relative to the
		pwm_frequency_cycle	setting, i.e. for duty cycle of 50% one would use a
		value which is exactly half of the pwm_frequency_cycle setting. This file
		can be both read and written to; and -unlike the frequency options- is
		unique for each output within the group.

		The maximum allowable value is 65535, i.e. the limit of the underlying 16-bit
		unsigned register.
		
What:		/sys/devices/platform/unipi_plc/io_group[1-9]/do_[1-9]_[0-9][0-9]/pwm_frequency_cycle
Date:		February 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file is used to set the PWM cycle frequency for the _entire_ group
		[1-9] on the undelying UniPi Neuron PLC. It is used in conjunction with the
		pwm_prescale setting, with the product of these two values used as a 
		divider for the PWM clock. The PWM clock runs on 48Mhz by default; therefore
		the allowable PWM frequencies range from 24Mhz to ~0.0111Hz. One should note
		that at the high end of this range the PWM square wave will be quite irregular,
		due to the time the underlying transistors need to change state. This file
		can be both read and written to.

		The maximum allowable value is 65535, i.e. the limit of the underlying 16-bit
		unsigned register.

What:		/sys/devices/platform/unipi_plc/io_group[1-9]/do_[1-9]_[0-9][0-9]/pwm_prescale
Date:		February 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file is used to set the PWM frequency prescaler for the _entire_ group
		[1-9] on the undelying UniPi Neuron PLC. It is used in conjunction with the
		pwm_frequency_cycle setting, with the product of these two values used as a 
		divider for the PWM clock. It differs from pwm_frequency_cycle in that it has
		no effect on the maximum precision of the pwm_duty_cycle setting; for this 
		reason the pwm_frequency_cycle setting should be maximised where possible, 
		while this setting should be minimised.
		
		The PWM clock runs on 48Mhz by default; therefore the allowable PWM frequencies
		range from 24Mhz to ~0.0111Hz. One should note that at the high end of this
		range the PWM square wave will be quite irregular, due to the time the PWM
		transistors need to change state.  This file can be both read and written to. 

		The maximum allowable value is 65535, i.e. the limit of the underlying 16-bit
		unsigned register.
		
What:		/sys/devices/platform/unipi_plc/io_group[1-9]/do_[1-9]_[0-9][0-9]/do_value
Date:		February 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file contains the current status of one of the transistor outputs on
		the	Neuron PLC group specified by the [1-9] address. Reading the file
		returns a value of '0' if the corresponding digital output is set to
		a logical value of 0 and a value of '1'	if the corresponding digital
		output is set to a logical value of 1. 	This file can be both read and
		written into.
		
		Writing to this file will change the digital output state according to the
		rules above.
		
What:		/sys/devices/platform/unipi_plc/io_group[1-9]/do_[1-9]_[0-9][0-9]/sys_gpio_do_base
Date:		February 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file specifies the internal GPIO chip number which should be used
		when the digital output is intended to be utilised as an ordinary sysfs
		GPIO device. This file can only be read.
		
What:		/sys/devices/platform/unipi_plc/io_group[1-9]/do_[1-9]_[0-9][0-9]/sys_gpio_do_prefix
Date:		February 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file specifies the internal GPIO chip prefix which should be used
		when the digital output is intended to be utilised as an ordinary sysfs
		GPIO device. This file can only be read.
		
What:		/sys/devices/platform/unipi_plc/io_group[1-9]/do_[1-9]_[0-9][0-9]/sys_gpio_do_count
Date:		February 2018
Contact:	Tomas Knot <tomasknot@gmail.com>
Description:
		This file specifies the internal GPIO chip line count which should be
		used when the digital output is intended to be used as an ordinary sysfs
		GPIO device. This file can only be read.