repl_gpio.h 1.12 KB
Newer Older
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
30
31
32
33
34
35
36
37
38
/*-----------------------------------------------------------------------------
 *  Author: Nelso G. Jost (nelsojost@gmail.com)
 *  License: GPLv2
 *  Purpose: Provide basic GPIO control commands for the REPL.
 *---------------------------------------------------------------------------*/
#ifndef REPL_GPIO_H
#define REPL_GPIO_H

#define CMD_REPL_BLINK {\
    "blink", REPL_BLINK, "blink <interval>", \
    "Blink builtin led (pin 2) with given <interval> in seconds (int|float). " \
    "Use \"blink 0\" to stop it."}

#define CMD_REPL_DWRITE {\
    "dwrite", REPL_DWRITE, "dwrite <pin> <value>",\
    "Digital write <value> (number|high|low) on <pin>. "}

#define CMD_REPL_AREAD {\
    "aread", REPL_AREAD, "aread <pin>", \
    "Read analogic pin and print out the value."}

#define CMD_REPL_ALOG {\
    "alog", REPL_ALOG, "alog <pin> <interval>", \
    "Start datalog on analogic pin with given interval."}


#define ALLCMD_REPL_GPIO\
    CMD_REPL_BLINK,\
    CMD_REPL_DWRITE,\
    CMD_REPL_AREAD,\
    CMD_REPL_ALOG

void REPL_BLINK(REPL * repl);
void REPL_DWRITE(REPL * repl);
void REPL_AREAD(REPL * repl);
void REPL_ALOG(REPL * repl);

#endif