Fixed delayMicroseconds for more than 1 second.

Added new code for max31855
This commit is contained in:
Gordon Henderson
2013-06-27 21:51:55 +01:00
parent 348bc739d1
commit 27698766b2
5 changed files with 62 additions and 108 deletions

View File

@@ -43,6 +43,7 @@
#include <sr595.h>
#include <pcf8591.h>
#include <pcf8574.h>
#include <max31855.h>
#include <mcp3002.h>
#include <mcp3004.h>
#include <mcp4802.h>
@@ -334,6 +335,32 @@ static int doExtensionPcf8591 (char *progName, int pinBase, char *params)
}
/*
* doExtensionMax31855:
* Analog IO
* max31855:base:spiChan
*********************************************************************************
*/
static int doExtensionMax31855 (char *progName, int pinBase, char *params)
{
int spi ;
if ((params = extractInt (progName, params, &spi)) == NULL)
return FALSE ;
if ((spi < 0) || (spi > 1))
{
fprintf (stderr, "%s: SPI channel (%d) out of range\n", progName, spi) ;
return FALSE ;
}
max31855Setup (pinBase, spi) ;
return TRUE ;
}
/*
* doExtensionMcp3002:
* Analog IO
@@ -475,6 +502,7 @@ struct extensionFunctionStruct extensionFunctions [] =
{ "mcp3004", &doExtensionMcp3004 },
{ "mcp4802", &doExtensionMcp4802 },
{ "mcp3422", &doExtensionMcp3422 },
{ "max31855", &doExtensionMax31855 },
{ NULL, NULL },
} ;