|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2019 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module containing stubs for API generation of the def 'pyb' module. |
|
8 """ |
|
9 |
|
10 hid_mouse = 0 |
|
11 hid_keyboard = 0 |
|
12 |
|
13 def delay(ms): |
|
14 pass |
|
15 |
|
16 def udelay(us): |
|
17 pass |
|
18 |
|
19 def millis(): |
|
20 pass |
|
21 |
|
22 def micros(): |
|
23 pass |
|
24 |
|
25 def elapsed_millis(start): |
|
26 pass |
|
27 |
|
28 def elapsed_micros(start): |
|
29 pass |
|
30 |
|
31 def hard_reset(): |
|
32 pass |
|
33 |
|
34 def bootloader(): |
|
35 pass |
|
36 |
|
37 def fault_debug(value): |
|
38 pass |
|
39 |
|
40 def disable_irq(): |
|
41 pass |
|
42 |
|
43 def enable_irq(state=True): |
|
44 pass |
|
45 |
|
46 def freq(sysclk=None, hclk=None, pclk1=None, pclk2=None): |
|
47 pass |
|
48 |
|
49 def wfi(): |
|
50 pass |
|
51 |
|
52 def stop(): |
|
53 pass |
|
54 |
|
55 def standby(): |
|
56 pass |
|
57 |
|
58 def have_cdc(): |
|
59 pass |
|
60 |
|
61 def hid(buttons, x, y, z): |
|
62 pass |
|
63 |
|
64 def info(dump_alloc_table=None): |
|
65 pass |
|
66 |
|
67 def main(filename): |
|
68 pass |
|
69 |
|
70 def mount(device, mountpoint, *, readonly=False, mkfs=False): |
|
71 pass |
|
72 |
|
73 def repl_uart(uart): |
|
74 pass |
|
75 |
|
76 def rng(): |
|
77 pass |
|
78 |
|
79 def sync(): |
|
80 pass |
|
81 |
|
82 def unique_id(): |
|
83 pass |
|
84 |
|
85 def usb_mode(modestr=None, vid=0xf055, pid=0x9801, hid=hid_mouse): |
|
86 pass |
|
87 |
|
88 class Accel(): |
|
89 def __init__(self): |
|
90 pass |
|
91 |
|
92 def filtered_xyz(self): |
|
93 pass |
|
94 |
|
95 def tilt(self): |
|
96 pass |
|
97 |
|
98 def x(self): |
|
99 pass |
|
100 |
|
101 def y(self): |
|
102 pass |
|
103 |
|
104 def z(self): |
|
105 pass |
|
106 |
|
107 class ADC(): |
|
108 def __init__(self, pin): |
|
109 pass |
|
110 |
|
111 def read(self): |
|
112 pass |
|
113 |
|
114 def read_timed(self, buf, timer): |
|
115 pass |
|
116 |
|
117 def read_timed_multi(self, adcs, bufs, timer): |
|
118 pass |
|
119 |
|
120 class CAN(): |
|
121 NORMAL = 0 |
|
122 LOOPBACK = 0 |
|
123 SILENT = 0 |
|
124 SILENT_LOOPBACK = 0 |
|
125 STOPPED = 0 |
|
126 ERROR_ACTIVE = 0 |
|
127 ERROR_WARNING = 0 |
|
128 ERROR_PASSIVE = 0 |
|
129 BUS_OFF = 0 |
|
130 LIST16 = 0 |
|
131 MASK16 = 0 |
|
132 LIST32 = 0 |
|
133 MASK32 = 0 |
|
134 |
|
135 def __init__(self, bus, mode, extframe=False, prescaler=100, *, sjw=1, |
|
136 bs1=6, bs2=8, auto_restart=False): |
|
137 pass |
|
138 |
|
139 def init(self, mode, extframe=False, prescaler=100, *, sjw=1, bs1=6, bs2=8, |
|
140 auto_restart=False): |
|
141 pass |
|
142 |
|
143 @classmethod |
|
144 def initfilterbanks(cls, nr): |
|
145 pass |
|
146 |
|
147 def deinit(self): |
|
148 pass |
|
149 |
|
150 def restart(self): |
|
151 pass |
|
152 |
|
153 def state(self): |
|
154 pass |
|
155 |
|
156 def info(self, list=None): |
|
157 pass |
|
158 |
|
159 def setfilter(self, bank, mode, fifo, params, *, rtr): |
|
160 pass |
|
161 |
|
162 def clearfilter(self, bank): |
|
163 pass |
|
164 |
|
165 def any(self, fifo): |
|
166 pass |
|
167 |
|
168 def recv(self, fifo, list=None, *, timeout=5000): |
|
169 pass |
|
170 |
|
171 def send(self, data, id, *, timeout=0, rtr=False): |
|
172 pass |
|
173 |
|
174 def rxcallback(self, fifo, fun): |
|
175 pass |
|
176 |
|
177 # TODO: complete this |