X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=mTask.dcl;h=114012caade1e5acd37ae967d0f9c898aa9cdd58;hb=68e65ffa79b10fc6762a0f7989a268126fc20c1b;hp=9207cb4113152528dc9a2bb5c93f73383ec42981;hpb=93cabbcd5d18b7b45d6f43a6ff39f94cfcb95522;p=mTask.git diff --git a/mTask.dcl b/mTask.dcl index 9207cb4..114012c 100644 --- a/mTask.dcl +++ b/mTask.dcl @@ -32,6 +32,7 @@ import mTaskSerial, mTaskLCD :: DigitalPin = D0 | D1 | D2 | D3 | D4 | D5 |D6 | D7 | D8 | D9 | D10 | D11 | D12 | D13 :: AnalogPin = A0 | A1 | A2 | A3 | A4 | A5 +:: UserLED = LED1 | LED2 | LED3 :: PinMode = INPUT | OUTPUT | INPUT_PULLUP :: Pin = Digital DigitalPin | Analog AnalogPin @@ -88,6 +89,7 @@ class var2 v where class sds v where sds :: ((v t Upd)->In t (Main (v c s))) -> (Main (v c s)) | type, toByteCode, toCode t con :: ((v t Expr) ->In t (Main (v c s))) -> (Main (v c s)) | type t + pub :: (v t Upd) -> v t Expr | type t class seq v where (>>=.) infixr 0 :: (v t p) ((v t Expr) -> (v u q)) -> (v u Stmt) | type t & type u (:.) infixr 0 :: (v t p) (v u q) -> v u Stmt | type t & type u @@ -126,6 +128,10 @@ class time v where delay :: (v Long p) -> (v Long Expr) millis :: (v Long Expr) +class userLed v where + ledOn :: UserLED -> (v () Stmt) + ledOff :: UserLED -> (v () Stmt) + class pio p t where pio :: p -> v t Upd | aIO v & dIO v instance pio AnalogPin Int instance pio AnalogPin Bool