--[[
ģƣPWM
ģ鹦ܣPWM
ģ޸ʱ䣺2017.07.31
ע⣺
1֧2·PWM֧
22·PWMõuart2txrxʹuart2ĴڹܣʹPWMʹPWMʹuart2Ĵڹܣ
   ڹܻPWMʹʱ뱣֤һܴڹر״̬ܴڿ״̬ͨuart.closemisc.closepwmӿڹر
]]
require"misc"
module(...,package.seeall)

--[[
print
  ӡӿڣļедӡtestǰ׺
  
ֵ
]]
local function print(...)
	_G.print("test",...)
end

--[[
testpwm0
  PWMͨ0
  
ֵ
]]
local function testpwm0()
	--Ƶ1000Hz1һڣÿڣ0.5룬0.5
	misc.openpwm(0,1000,50)
	--2ӺرPWM0
	sys.timer_start(misc.closepwm,120000,0)
end

--[[
testpwm1
  PWMͨ1
  
ֵ
]]
local function testpwm1()
	--1024һڣÿڣ110룬1024-110=914
	misc.openpwm(1,3,7)
	--2ӺرPWM0
	sys.timer_start(misc.closepwm,120000,1)
end

testpwm0()
testpwm1()
