MCPcopy Create free account
hub / github.com/WiringPi/WiringPi / doExtensionSr595

Function doExtensionSr595

wiringPi/wpiExtensions.c:352–379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350 */
351
352static int doExtensionSr595 (char *progName, int pinBase, char *params)
353{
354 int pins, data, clock, latch ;
355
356// Extract pins
357
358 if ((params = extractInt (progName, params, &pins)) == NULL)
359 return false ;
360
361 if ((pins < 8) || (pins > 32))
362 {
363 verbError ("%s: pin count (%d) out of range - 8-32 expected.", progName, pins) ;
364 return false ;
365 }
366
367 if ((params = extractInt (progName, params, &data)) == NULL)
368 return false ;
369
370 if ((params = extractInt (progName, params, &clock)) == NULL)
371 return false ;
372
373 if ((params = extractInt (progName, params, &latch)) == NULL)
374 return false ;
375
376 sr595Setup (pinBase, pins, data, clock, latch) ;
377
378 return true ;
379}
380
381
382/*

Callers

nothing calls this directly

Calls 3

extractIntFunction · 0.85
verbErrorFunction · 0.85
sr595SetupFunction · 0.85

Tested by

no test coverage detected