chiark / gitweb /
e71cb53ce4831bb04a96fd5662587029e27ff5bc
[chiark-tcl.git] / wiringpi / wiringpi.c
1 /*
2  * wiringpi setup [MODE]
3  *     MODE is one of -g -1 -p, as for gpio(1)
4  *     optional, if not called is equivalent to saying just "setup"
5  *     may not be called after any other wiringpi use in whole program
6  *     there is no way to un-setup
7  *
8  * Most of the rest are very similar to gpio(1):
9  *   boardRev => integer (see wiringPi.h)
10  *   boardId => [list MODEL REV MEM MAKER OVERVOLTED]
11  *   mode PIN MODE
12  *       MODEs are
13  *             in out pwm pwmTone clock up down tri off
14  *             alt0 alt1 alt2 alt3 alt4 alt5
15  *   read PIN => 0|1
16  *   write PIN 0|1
17  *   aread PIN => VAL
18  *   write PIN VAL
19  *   pwm PIN VAL
20  *   clock PIN FREQ
21  *   drive GROUP VALUE
22  *   pwm-bal|pwm-ms PIN
23  *   pwmr PIN RANGE
24  *   pwmc PIN CLOCK
25  *   pwmTone PIN FREQ
26  */
27 /* ---8<--- end of documentation comment --8<-- */
28
29 /*
30  * wiringpi.c - wiringPi binding for Tcl
31  * Copyright 2016 Ian Jackson
32  *
33  * This program is free software; you can redistribute it and/or
34  * modify it under the terms of the GNU General Public License as
35  * published by the Free Software Foundation; either version 2 of the
36  * License, or (at your option) any later version.
37  *
38  * This program is distributed in the hope that it will be useful, but
39  * WITHOUT ANY WARRANTY; without even the implied warranty of
40  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
41  * General Public License for more details.
42  *
43  * You should have received a copy of the GNU General Public License
44  * along with this library; if not, see <http://www.gnu.org/licenses/>.
45  */
46
47 #define _GNU_SOURCE
48
49 #include <stdio.h>
50
51 #include "chiark_tcl_wiringpi.h"
52
53 /*---------- important types and forward declarations ----------*/
54
55 /*---------- main hooks for tcl ----------*/
56
57 CHT_INIT(wiringpi, {}, CHTI_COMMANDS(cht_wiringpitoplevel_entries))