mirror of
https://github.com/clockworkpi/WiringPi.git
synced 2026-06-12 13:53:09 +02:00
A new version of wiringPi. Added in more stuff and fixed it up
for kernels 4.8 onwards. Some very old stuff might break. Additional fixes for the ISR code and some tweaks here and there. I've removed the checks for some operations that might fail when using the gpiomem interface - which is now the default way of doing things - if your program segfaults, then you may need to use sudo on it.
This commit is contained in:
@@ -55,6 +55,10 @@
|
||||
#include "ads1115.h"
|
||||
#include "sn3218.h"
|
||||
#include "drcSerial.h"
|
||||
#include "pseudoPins.h"
|
||||
#include "bmp180.h"
|
||||
#include "htu21d.h"
|
||||
#include "ds18b20.h"
|
||||
|
||||
#include "wpiExtensions.h"
|
||||
|
||||
@@ -428,6 +432,70 @@ static int doExtensionPcf8591 (char *progName, int pinBase, char *params)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* doExtensionPseudoPins:
|
||||
* 64 Memory resident pseudo pins
|
||||
* pseudoPins:base
|
||||
*********************************************************************************
|
||||
*/
|
||||
|
||||
static int doExtensionPseudoPins (char *progName, int pinBase, char *params)
|
||||
{
|
||||
pseudoPinsSetup (pinBase) ;
|
||||
printf ("pseudoPins: %d\n", pinBase) ;
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* doExtensionBmp180:
|
||||
* Analog Temp + Pressure
|
||||
* bmp180:base
|
||||
*********************************************************************************
|
||||
*/
|
||||
|
||||
static int doExtensionBmp180 (char *progName, int pinBase, char *params)
|
||||
{
|
||||
bmp180Setup (pinBase) ;
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* doExtensionHtu21d:
|
||||
* Analog humidity + Pressure
|
||||
* htu21d:base
|
||||
*********************************************************************************
|
||||
*/
|
||||
|
||||
static int doExtensionHtu21d (char *progName, int pinBase, char *params)
|
||||
{
|
||||
htu21dSetup (pinBase) ;
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* doExtensionDs18b20:
|
||||
* 1-Wire Temperature
|
||||
* htu21d:base:serialNum
|
||||
*********************************************************************************
|
||||
*/
|
||||
|
||||
static int doExtensionDs18b20 (char *progName, int pinBase, char *params)
|
||||
{
|
||||
char *serialNum ;
|
||||
|
||||
if ((params = extractStr (progName, params, &serialNum)) == NULL)
|
||||
return FALSE ;
|
||||
|
||||
return ds18b20Setup (pinBase, serialNum) ;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* doExtensionMax31855:
|
||||
* Analog IO
|
||||
@@ -677,6 +745,10 @@ static struct extensionFunctionStruct extensionFunctions [] =
|
||||
{ "sr595", &doExtensionSr595 },
|
||||
{ "pcf8574", &doExtensionPcf8574 },
|
||||
{ "pcf8591", &doExtensionPcf8591 },
|
||||
{ "bmp180", &doExtensionBmp180 },
|
||||
{ "pseudoPins", &doExtensionPseudoPins },
|
||||
{ "htu21d", &doExtensionHtu21d },
|
||||
{ "ds18b20", &doExtensionDs18b20 },
|
||||
{ "mcp3002", &doExtensionMcp3002 },
|
||||
{ "mcp3004", &doExtensionMcp3004 },
|
||||
{ "mcp4802", &doExtensionMcp4802 },
|
||||
|
||||
Reference in New Issue
Block a user