MCPcopy Create free account
hub / github.com/Santroller/Santroller / clock

Method clock

lib/SNESpad/SNESpad.cpp:223–245  ·  view source on GitHub ↗

clock in a data bit

Source from the content-addressed store, hash-verified

221
222// clock in a data bit
223uint32_t SNESpad::clock()
224{
225 uint32_t ret = 0;
226
227#ifdef ARDUINO
228 digitalWrite(clockPin,LOW);
229 delayMicroseconds(6);
230
231 ret = digitalRead(dataPin);
232 digitalWrite(clockPin,HIGH);
233
234 delayMicroseconds(6);
235#else
236 gpio_put(clockPin,0);
237 busy_wait_us(6);
238
239 ret = gpio_get(dataPin);
240 gpio_put(clockPin,1);
241
242 busy_wait_us(6);
243#endif
244 return ret;
245}
246
247// latch to start read
248void SNESpad::latch()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected