summaryrefslogtreecommitdiff
path: root/components/external/espruino/src/jswrap_io.h
blob: 68760c103ca64af1c07bb64e93d38b1d741c0749 (plain)
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
/*
 * This file is part of Espruino, a JavaScript interpreter for Microcontrollers
 *
 * Copyright (C) 2013 Gordon Williams <[email protected]>
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * ----------------------------------------------------------------------------
 * JavaScript Hardware IO Functions
 * ----------------------------------------------------------------------------
 */
#include "jsvar.h"
#include "jsinteractive.h"

void jswrap_io_analogWrite(Pin pin, JsVarFloat value, JsVar *options);
void jswrap_io_digitalPulse(Pin pin, bool value, JsVarFloat time);
void jswrap_io_digitalWrite(JsVar *pinVar, JsVarInt value);
JsVarInt jswrap_io_digitalRead(JsVar *pinVar);
void jswrap_io_pinMode(Pin pin, JsVar *mode);

JsVar *jswrap_interface_setInterval(JsVar *func, JsVarFloat timeout);
JsVar *jswrap_interface_setTimeout(JsVar *func, JsVarFloat timeout);
JsVar *jswrap_interface_setWatch(JsVar *funcVar, Pin pin, JsVar *repeatOrObject);
void jswrap_interface_clearInterval(JsVar *idVar);
void jswrap_interface_clearTimeout(JsVar *idVar);
void jswrap_interface_changeInterval(JsVar *idVar, JsVarFloat interval);
void jswrap_interface_clearWatch(JsVar *idVar);