<commit_before><!--

Main variant of TrikControl configuration file.

Use it if JCx ports are configured to work as PWM signal generators.

-->

<config>
	<!-- Initialization sh script, will be executed on creation of Brick object. -->
	<initScript>
		echo 1 > /sys/class/gpio/gpio62/value

		i2cset -y 2 0x48 0x10 0x1000 w
		i2cset -y 2 0x48 0x11 0x1000 w
		i2cset -y 2 0x48 0x12 0x1000 w
		i2cset -y 2 0x48 0x13 0x1000 w

		echo 1 > /sys/class/pwm/ehrpwm.1:1/request
		echo 1 > /sys/class/pwm/ehrpwm.1:1/run

		echo 1 > /sys/class/pwm/ehrpwm.1:0/request
		echo 1 > /sys/class/pwm/ehrpwm.1:0/run

		echo 1 > /sys/class/pwm/ehrpwm.0:1/request
		echo 1 > /sys/class/pwm/ehrpwm.0:1/run

		echo 1 > /sys/class/pwm/ecap.0/request
		echo 1 > /sys/class/pwm/ecap.0/run

		echo 1 > /sys/class/pwm/ecap.1/request
		echo 1 > /sys/class/pwm/ecap.1/run

		echo 1 > /sys/class/pwm/ecap.2/request
		echo 1 > /sys/class/pwm/ecap.2/run

		#cat /sys/class/pwm/ecap_cap.0/config > /dev/null

		#cat /sys/class/pwm/ecap_cap.1/config > /dev/null

		#cat /sys/class/pwm/ecap_cap.2/config > /dev/null

		echo 1 > /sys/devices/virtual/input/input1/enable_device

		amixer -q set PCM 127

		cd /home/root/dsp-modules &amp;&amp; ./load.sh
	</initScript>
	
	<!-- Servomotors configuration, maps logical port to device file, file for setting period,
	     initial period value and type of motor on that port.
	     Motor type parameters like calibration curve are described separately, in "motorTypes" section. -->
	<servoMotors>
		<servoMotor
			port="JE1"
			deviceFile="/sys/class/pwm/ehrpwm.1:1/duty_ns"
			periodFile="/sys/class/pwm/ehrpwm.1:1/period_ns"
			period="20000000"
			defaultType="defaultServo"
			invert="false"
		/>
		<servoMotor
			port="JE2"
			deviceFile="/sys/class/pwm/ehrpwm.1:0/duty_ns"
			periodFile="/sys/class/pwm/ehrpwm.1:0/period_ns"
			period="20000000"
			defaultType="defaultServo"
			invert="false"
		/>
		<servoMotor
			port="JE4"
			deviceFile="/sys/class/pwm/ehrpwm.0:1/duty_ns"
			periodFile="/sys/class/pwm/ehrpwm.0:1/period_ns"
			period="20000000"
			defaultType="defaultServo"
			invert="false"
		/>
		<servoMotor
			port="JC1"
			deviceFile="/sys/class/pwm/ecap.0/duty_ns"
			periodFile="/sys/class/pwm/ecap.0/period_ns"
			period="20000000"
			defaultType="defaultServo"
			invert="false"
		/>
		<servoMotor
			port="JC2"
			deviceFile="/sys/class/pwm/ecap.1/duty_ns"
			periodFile="/sys/class/pwm/ecap.1/period_ns"
			period="20000000"
			defaultType="defaultServo"
			invert="false"
		/>
		<servoMotor
			port="JC3"
			deviceFile="/sys/class/pwm/ecap.2/duty_ns"
			periodFile="/sys/class/pwm/ecap.2/period_ns"
			period="20000000"
			defaultType="defaultServo"
			invert="false"
		/>
	</servoMotors>

	<pwmCaptures>
<!--
		<capture
			port="JC1"
			frequencyFile="/sys/class/pwm/ecap_cap.0/freq"
			dutyFile="/sys/class/pwm/ecap_cap.0/duty_percentage"
		/>
		<capture
			port="JC2"
			frequencyFile="/sys/class/pwm/ecap_cap.1/freq"
			dutyFile="/sys/class/pwm/ecap_cap.1/duty_percentage"
		/>
		<capture
			port="JC3"
			frequencyFile="/sys/class/pwm/ecap_cap.2/freq"
			dutyFile="/sys/class/pwm/ecap_cap.2/duty_percentage"
		/>
-->
	</pwmCaptures>

	<!-- Power motors configuration, maps logical port to I2C command. 
	     I2C device path and device id are set separately, in "i2c" section. 
	     Power motors do not have a type, because their driver is controlled by high-level 
	     commands and handles motor specifics by itself. -->
	<powerMotors>
		<powerMotor port="JM1" i2cCommandNumber="0x14" invert="false" />
		<powerMotor port="JM2" i2cCommandNumber="0x15" invert="false" />
		<powerMotor port="M1" i2cCommandNumber="0x16" invert="true" />
		<powerMotor port="JM3" i2cCommandNumber="0x17" invert="false" />
	</powerMotors>

	<!-- Aanalog sensors configuration, maps logical port to I2C command. 
	     I2C device path and device id are set separately, in "i2c" section. 
	     Analog sensors do not have a type, because their driver is controlled by high-level 
	     commands and handles sensor specifics by itself. -->
	<analogSensors>
		<analogSensor port="JA1" i2cCommandNumber="0x25" />
		<analogSensor port="JA2" i2cCommandNumber="0x24" />
		<analogSensor port="JA3" i2cCommandNumber="0x23" />
		<analogSensor port="JA4" i2cCommandNumber="0x22" />
		<analogSensor port="JA5" i2cCommandNumber="0x21" />
		<analogSensor port="JA6" i2cCommandNumber="0x20" />
	</analogSensors>

	<!-- Encoders configuration, maps logical port to I2C command. 
	     I2C device path and device id are set separately, in "i2c" section. -->
	<encoders>
		<encoder port="JB2" i2cCommandNumber="0x31" />
		<encoder port="JB4" i2cCommandNumber="0x32" />
		<encoder port="JB3" i2cCommandNumber="0x33" />
	</encoders>
	
	<!-- Description of servo motor types used in servo motors mapping. Supplied values correspond to 
	     full reverse (for "min" parameter), full forward ("max" parameter),
	     non-breaking stop ("zero" parameter), breaking stop ("stop" parameter). -->
	<servoMotorTypes>
		<defaultServo min="1200000" max="1800000" zero="1450000" stop="0" />
	</servoMotorTypes>

	<!-- Digital sensors configuration, maps logical port to digital sensor device file and digital sensor type used by default 
	     (if not configured programmatically). -->
	<digitalSensors>
		<digitalSensor port="JD1" deviceFile="/sys/devices/platform/da850_trik/sensor_d1" defaultType="lightSensor" />
		<digitalSensor port="JD2" deviceFile="/sys/devices/platform/da850_trik/sensor_d2" defaultType="lightSensor" />
		<accelerometer min="-32767" max="32767" deviceFile="/dev/input/by-path/platform-i2c_davinci.1-event" />
		<gyroscope min="-32767" max="32767" deviceFile="/dev/input/by-path/platform-spi_davinci.1-event" />
	</digitalSensors>
	
	<!-- Description of sensor types used in digital sensor mappings. Provides minimal reading value <commit_msg>1500000 is force-break.<commit_after><!--

Main variant of TrikControl configuration file.

Use it if JCx ports are configured to work as PWM signal generators.

-->

<config>
	<!-- Initialization sh script, will be executed on creation of Brick object. -->
	<initScript>
		echo 1 > /sys/class/gpio/gpio62/value

		i2cset -y 2 0x48 0x10 0x1000 w
		i2cset -y 2 0x48 0x11 0x1000 w
		i2cset -y 2 0x48 0x12 0x1000 w
		i2cset -y 2 0x48 0x13 0x1000 w

		echo 1 > /sys/class/pwm/ehrpwm.1:1/request
		echo 1 > /sys/class/pwm/ehrpwm.1:1/run

		echo 1 > /sys/class/pwm/ehrpwm.1:0/request
		echo 1 > /sys/class/pwm/ehrpwm.1:0/run

		echo 1 > /sys/class/pwm/ehrpwm.0:1/request
		echo 1 > /sys/class/pwm/ehrpwm.0:1/run

		echo 1 > /sys/class/pwm/ecap.0/request
		echo 1 > /sys/class/pwm/ecap.0/run

		echo 1 > /sys/class/pwm/ecap.1/request
		echo 1 > /sys/class/pwm/ecap.1/run

		echo 1 > /sys/class/pwm/ecap.2/request
		echo 1 > /sys/class/pwm/ecap.2/run

		#cat /sys/class/pwm/ecap_cap.0/config > /dev/null

		#cat /sys/class/pwm/ecap_cap.1/config > /dev/null

		#cat /sys/class/pwm/ecap_cap.2/config > /dev/null

		echo 1 > /sys/devices/virtual/input/input1/enable_device

		amixer -q set PCM 127

		cd /home/root/dsp-modules &amp;&amp; ./load.sh
	</initScript>
	
	<!-- Servomotors configuration, maps logical port to device file, file for setting period,
	     initial period value and type of motor on that port.
	     Motor type parameters like calibration curve are described separately, in "motorTypes" section. -->
	<servoMotors>
		<servoMotor
			port="JE1"
			deviceFile="/sys/class/pwm/ehrpwm.1:1/duty_ns"
			periodFile="/sys/class/pwm/ehrpwm.1:1/period_ns"
			period="20000000"
			defaultType="defaultServo"
			invert="false"
		/>
		<servoMotor
			port="JE2"
			deviceFile="/sys/class/pwm/ehrpwm.1:0/duty_ns"
			periodFile="/sys/class/pwm/ehrpwm.1:0/period_ns"
			period="20000000"
			defaultType="defaultServo"
			invert="false"
		/>
		<servoMotor
			port="JE4"
			deviceFile="/sys/class/pwm/ehrpwm.0:1/duty_ns"
			periodFile="/sys/class/pwm/ehrpwm.0:1/period_ns"
			period="20000000"
			defaultType="defaultServo"
			invert="false"
		/>
		<servoMotor
			port="JC1"
			deviceFile="/sys/class/pwm/ecap.0/duty_ns"
			periodFile="/sys/class/pwm/ecap.0/period_ns"
			period="20000000"
			defaultType="defaultServo"
			invert="false"
		/>
		<servoMotor
			port="JC2"
			deviceFile="/sys/class/pwm/ecap.1/duty_ns"
			periodFile="/sys/class/pwm/ecap.1/period_ns"
			period="20000000"
			defaultType="defaultServo"
			invert="false"
		/>
		<servoMotor
			port="JC3"
			deviceFile="/sys/class/pwm/ecap.2/duty_ns"
			periodFile="/sys/class/pwm/ecap.2/period_ns"
			period="20000000"
			defaultType="defaultServo"
			invert="false"
		/>
	</servoMotors>

	<pwmCaptures>
<!--
		<capture
			port="JC1"
			frequencyFile="/sys/class/pwm/ecap_cap.0/freq"
			dutyFile="/sys/class/pwm/ecap_cap.0/duty_percentage"
		/>
		<capture
			port="JC2"
			frequencyFile="/sys/class/pwm/ecap_cap.1/freq"
			dutyFile="/sys/class/pwm/ecap_cap.1/duty_percentage"
		/>
		<capture
			port="JC3"
			frequencyFile="/sys/class/pwm/ecap_cap.2/freq"
			dutyFile="/sys/class/pwm/ecap_cap.2/duty_percentage"
		/>
-->
	</pwmCaptures>

	<!-- Power motors configuration, maps logical port to I2C command. 
	     I2C device path and device id are set separately, in "i2c" section. 
	     Power motors do not have a type, because their driver is controlled by high-level 
	     commands and handles motor specifics by itself. -->
	<powerMotors>
		<powerMotor port="JM1" i2cCommandNumber="0x14" invert="false" />
		<powerMotor port="JM2" i2cCommandNumber="0x15" invert="false" />
		<powerMotor port="M1" i2cCommandNumber="0x16" invert="true" />
		<powerMotor port="JM3" i2cCommandNumber="0x17" invert="false" />
	</powerMotors>

	<!-- Aanalog sensors configuration, maps logical port to I2C command. 
	     I2C device path and device id are set separately, in "i2c" section. 
	     Analog sensors do not have a type, because their driver is controlled by high-level 
	     commands and handles sensor specifics by itself. -->
	<analogSensors>
		<analogSensor port="JA1" i2cCommandNumber="0x25" />
		<analogSensor port="JA2" i2cCommandNumber="0x24" />
		<analogSensor port="JA3" i2cCommandNumber="0x23" />
		<analogSensor port="JA4" i2cCommandNumber="0x22" />
		<analogSensor port="JA5" i2cCommandNumber="0x21" />
		<analogSensor port="JA6" i2cCommandNumber="0x20" />
	</analogSensors>

	<!-- Encoders configuration, maps logical port to I2C command. 
	     I2C device path and device id are set separately, in "i2c" section. -->
	<encoders>
		<encoder port="JB2" i2cCommandNumber="0x31" />
		<encoder port="JB4" i2cCommandNumber="0x32" />
		<encoder port="JB3" i2cCommandNumber="0x33" />
	</encoders>
	
	<!-- Description of servo motor types used in servo motors mapping. Supplied values correspond to 
	     full reverse (for "min" parameter), full forward ("max" parameter),
	     non-breaking stop ("zero" parameter), breaking stop ("stop" parameter). -->
	<servoMotorTypes>
		<defaultServo min="1200000" max="1800000" zero="1500000" stop="0" />
	</servoMotorTypes>

	<!-- Digital sensors configuration, maps logical port to digital sensor device file and digital sensor type used by default 
	     (if not configured programmatically). -->
	<digitalSensors>
		<digitalSensor port="JD1" deviceFile="/sys/devices/platform/da850_trik/sensor_d1" defaultType="lightSensor" />
		<digitalSensor port="JD2" deviceFile="/sys/devices/platform/da850_trik/sensor_d2" defaultType="lightSensor" />
		<accelerometer min="-32767" max="32767" deviceFile="/dev/input/by-path/platform-i2c_davinci.1-event" />
		<gyroscope min="-32767" max="32767" deviceFile="/dev/input/by-path/platform-spi_davinci.1-event" />
	</digitalSensors>
	
	<!-- Description of sensor types used in digital sensor mappings. Provides minimal reading value 
{'fraction_non_alphanumeric': 0.1400545888775162, 'fraction_numerical': 0.05228590924599113, 'mean_word_length': 3.6657381615598887, 'pattern_counts': {'":': 0, '<': 111, '<?xml version=': 0, '>': 143, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 12, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5412220', 'n_tokens_mistral': 5154, 'n_tokens_neox': 4368, 'n_words': 918}