<root>
<document scada='0' schema='103' license='10,79829088,FTRCKB' title='' description='' fcversion='655364' target='ESP.ESP32.ESP32_WROOM_32' >
	<config data='' clkspd='240000000' simspd='0' usewdt='0' constif='0' commport='3' Use3V3='0' />
	<plugins >
		<dll_models enabled='1' />
	</plugins>
	<supplement use='1' head='#include &lt;driver/ledc.h&gt;' body='' />
	<debug />
	<traces />
	<ghost >
		<FK2 >
			<data name='FK2D0' port='4294967295' pin='4294967295' />
			<data name='FK2D1' port='4294967295' pin='4294967295' />
			<data name='FK2D2' port='4294967295' pin='4294967295' />
			<data name='FK2D3' port='4294967295' pin='4294967295' />
			<data name='FK2D4' port='4294967295' pin='4294967295' />
			<data name='FK2D5' port='4294967295' pin='4294967295' />
			<data name='FK2D6' port='4294967295' pin='4294967295' />
			<data name='FK2D7' port='4294967295' pin='4294967295' />
			<data name='FK2D8' port='4294967295' pin='4294967295' />
			<data name='FK2D9' port='4294967295' pin='4294967295' />
			<data name='FK2D10' port='4294967295' pin='4294967295' />
			<data name='FK2D11' port='4294967295' pin='4294967295' />
			<data name='FK2D12' port='4294967295' pin='4294967295' />
			<data name='FK2D13' port='4294967295' pin='4294967295' />
			<data name='FK2D14' port='4294967295' pin='4294967295' />
			<data name='FK2D15' port='4294967295' pin='4294967295' />
			<data name='FK2A0' port='4294967295' pin='4294967295' />
			<data name='FK2A1' port='4294967295' pin='4294967295' />
			<data name='FK2A2' port='4294967295' pin='4294967295' />
			<data name='FK2A3' port='4294967295' pin='4294967295' />
			<data name='FK2A4' port='4294967295' pin='4294967295' />
			<data name='FK2A5' port='4294967295' pin='4294967295' />
		</FK2>
		<ICD >
			<data name='AnalogPrescaleValue' value='19' />
			<data name='DigitalSampleRate' value='100000' />
			<data name='BreakpointCount' value='8' />
			<data name='CallStackDepthCount' value='8' />
			<data name='ClockPort' value='1' />
			<data name='ClockPin' value='6' />
			<data name='DataPort' value='1' />
			<data name='DataPin' value='7' />
			<data name='UseDefaultPins' value='1' />
			<data name='WrapEnabled' value='1' />
			<data name='CommsDelayOverridden' value='0' />
			<data name='CommsDelay' value='1' />
			<data name='CalculatedCommsDelay' value='1' />
			<data name='AnalogEB2PrescaleValue' value='2' />
			<data name='DigitalEB2SampleRate' value='100000' />
		</ICD>
		<pins >
			<digital A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
			<analog A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
		</pins>
	</ghost>
	<components >
		<settings autoimg='0' center='1' unitscale='0' fixedscale='0' fixedx='25' fixedy='25' fixedz='25' headcode='0' />
		<definition guid='26f2f3b4-9731-4ebf-94ed-df09c8648074' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='' description='' category='' category2='' category3='' bIs2dOnly='0' bIs3dOnly='0' catenable='1' author='' manuname='' manucode='' sysinfo='0' keywords='' dynamic='1' scadaCompatible='0' embeddedCompatible='1' showmacros='1' iconpath='' />
		<component class_type='root' codename='ComponentRoot' panelId='-1' x='0' y='0' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' comp2dType='0' >
			<resources />
			<properties >
				<property name='GPIO pin' target='gpio' typeid='21' hidden='0' locked='0' info='' />
				<property name='Frequency (Hz)' target='frequency' typeid='21' hidden='0' locked='0' info='' />
				<property name='Channel' target='channel' typeid='16' hidden='0' locked='0' info='' filter='0000
0011
0022
0033
0044
0055
0066
0077' />
				<property name='Speed' target='speed' typeid='16' hidden='0' locked='0' info='' filter='000High
001Low' />
				<property name='Clock' target='clock' typeid='16' hidden='0' locked='0' info='' filter='000APB_Clk (High/Low)
001Ref_tick (High/Low)
002RC_Fast_Clk (Low)' />
				<property name='Timer' target='timer' typeid='16' hidden='0' locked='0' info='' filter='0000
0011
0022
0033' />
			</properties>
			<values >
				<value target='gpio' data='16' />
				<value target='frequency' data='5000' />
				<value target='channel' data='001' />
				<value target='speed' data='000' />
				<value target='clock' data='001' />
				<value target='timer' data='000' />
			</values>
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='false' type='b1' description='' isconst='1' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LEDC_Timer_Config' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LEDC_Channel_config' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='true' type='b1' description='' isconst='1' isHidden='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='SetFade' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='duty' type='u32' description='Duty to fade too' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='time' type='u32' description='Time to fade over in ms' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='mode' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='channel' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='4399907' cmdcolor_sec='16772075' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='1' >
							<exp exp='.channel = channel' />
							<exp exp='.mode = speed' />
						</command>
						<command class_type='native' title='C Code' ccode='ledc_fade_func_install(0);
ledc_set_fade_with_time(FCL_MODE, FCL_CHANNEL, FCL_DUTY, FCL_TIME);
ledc_fade_start(FCL_MODE, FCL_CHANNEL, LEDC_FADE_NO_WAIT);


' cmdcolor='4399907' cmdcolor_sec='16772075' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='1' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='SetDutyCycle' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='duty' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='channel' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='speed' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='4399907' cmdcolor_sec='16772075' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='1' >
							<exp exp='.channel = channel' />
							<exp exp='.speed = speed' />
						</command>
						<command class_type='native' title='C Code' ccode='ledc_set_duty(FCL_SPEED, FCL_CHANNEL, FCL_DUTY);
ledc_update_duty(FCL_SPEED, FCL_CHANNEL);
' cmdcolor='4399907' cmdcolor_sec='16772075' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='1' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='User Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='Initialise' />
						<command class_type='call' title='User Macro' disable='1' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='SetDutyCycle' >
							<argument exp='0' />
						</command>
						<command class_type='loop' title='Loop' cmdcolor='5912608' cmdcolor_sec='16777192' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='1' type='0' exp='1' >
							<flowline >
								<command class_type='call' title='User Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='SetFade' >
									<argument exp='8191' />
									<argument exp='3000' />
								</command>
								<command class_type='delay' title='Delay' cmdcolor='4399907' cmdcolor_sec='16772075' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='1' exp='3' type='2' />
								<command class_type='call' title='User Macro' cmdcolor='4487093' cmdcolor_sec='11066367' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='0.64' macro='SetFade' >
									<argument exp='0' />
									<argument exp='3000' />
								</command>
								<command class_type='delay' title='Delay' cmdcolor='4399907' cmdcolor_sec='16772075' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='1' exp='3' type='2' />
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Initialise' description='' statediag='0' >
						<return name='Return' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='speed' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='channel' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='clock' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='gpio' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='timer' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='frequency' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='4399907' cmdcolor_sec='16772075' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='1' >
							<exp exp='.speed = speed' />
							<exp exp='.gpio = gpio' />
							<exp exp='.channel = channel' />
							<exp exp='.timer = timer' />
							<exp exp='.frequency = frequency' />
						</command>
						<command class_type='native' title='C Code' ccode='ledc_timer_config_t *config = malloc(sizeof(ledc_timer_config_t));
ledc_channel_config_t *channel = malloc(sizeof(ledc_channel_config_t));

FCV_LEDC_TIMER_CONFIG = (MX_UINT32)config;
FCV_LEDC_CHANNEL_CONFIG = (MX_UINT32) channel;
channel-&gt;speed_mode = config-&gt;speed_mode = FCL_SPEED;
config-&gt;timer_num = FCL_TIMER;
config-&gt;duty_resolution = LEDC_TIMER_13_BIT;
config-&gt;freq_hz = FCL_FREQUENCY;
config-&gt;clk_cfg = LEDC_AUTO_CLK;
ledc_timer_config(config);

channel-&gt;channel = FCL_CHANNEL;
channel-&gt;timer_sel = FCL_TIMER;
channel-&gt;intr_type = LEDC_INTR_DISABLE;
channel-&gt;gpio_num = FCL_GPIO;
channel-&gt;duty = 0;
channel-&gt;hpoint = 0;

ledc_channel_config(channel);
' cmdcolor='4399907' cmdcolor_sec='16772075' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='1' language='C' />
						<command class_type='calculation' title='Calculation' cmdcolor='4399907' cmdcolor_sec='16772075' cmdcolor_txt='16777215' cmdgradient='4' cmdopacity='1' >
							<exp exp='.Return = true' />
						</command>
					</flowline>
				</macro>
			</macros>
		</component>
	</components>
	<scadaresourcelookup />
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' >
		<background rgb='7292207' img='' style='0' />
		<camera xe='0' ye='0' ze='1183.38' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<viewport dx='128' dy='128' zoom='13.0879' fix_topleft='0' />
		<page x='1000' y='1000' show='0' rgb='16777215' />
		<winpos ID='7005' RectRecentFloat='532,111,1148,925' RectRecentDocked='2456,220,3454,2051' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='0' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='0' />
	</panel2d>
	<panel3d shadows='0' lighting='2' brightness='0' perspective='1' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='0' />
		<camera xe='0' ye='0' ze='781.66' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey0 xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey1 xe='-3.67394e-14' ye='0' ze='-300' xt='0' yt='0' zt='0' xquat='0' yquat='1' zquat='0' wquat='6.12323e-17' />
		<camerakey2 xe='0' ye='-300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.707107' yquat='0' zquat='0' wquat='0.707107' />
		<camerakey3 xe='-3.67394e-14' ye='300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-4.32978e-17' yquat='0.707107' zquat='0.707107' wquat='4.32978e-17' />
		<camerakey4 xe='-300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='0.5' zquat='0.5' wquat='0.5' />
		<camerakey5 xe='300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='-0.5' zquat='-0.5' wquat='0.5' />
		<camerakey6 xe='-173.205' ye='-173.205' ze='173.205' xt='0' yt='0' zt='0' xquat='-0.424708' yquat='0.17592' zquat='0.339851' wquat='0.820473' />
		<winpos ID='7004' RectRecentFloat='869,166,1400,980' RectRecentDocked='0,0,646,535' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='0' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='0' />
	</panel3d>
	<panels2d count='1' >
		<panel2d_0 id='0' name='2D Panel' >
			<winpos ID='1171' RectRecentFloat='406,234,1056,684' RectRecentDocked='407,269,1049,677' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='0' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='0' />
			<background fill='288230376143454283' showgrid='1' gridstyle='1' gridsize='10' gridbrush='71776119075691740' snaptogrid='1' />
		</panel2d_0>
	</panels2d>
	<layout >
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAiAAAAPgQAACQHAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Initialise' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAiAAAAPgQAACQHAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='SetDutyCycle' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAiAAAAPgQAACQHAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='SetFade' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAiAAAAPgQAACQHAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
