110 #ifndef SIMPLETOOLS_H 111 #define SIMPLETOOLS_H 113 #if defined(__cplusplus) 117 #include <propeller.h> 118 #include "simpletext.h" 126 #include <sys/stat.h> 130 #include "simplei2c.h" 216 #define PI 3.141592653589793 436 #define NCO_PWM_1 (0b00100 << 26) 444 #define CTR_NCO (0b100 << 26) 452 #define CTR_PLL (0b10 << 26) 460 #define DUTY_SE (0b110 << 26) 477 #define ee_put_byte ee_putByte 483 #define ee_get_byte ee_getByte 489 #define ee_put_int ee_putInt 495 #define ee_get_int ee_getInt 501 #define ee_put_str ee_putStr 507 #define ee_get_str ee_getStr 513 #define ee_put_float32 ee_putFloat32 520 #define pause_ticks(pticks) __builtin_propeller_waitcnt(pticks+CNT, 0) 537 #define EEPROM_ADDR 0x50 611 unsigned int toggle(
int pin);
724 unsigned int get_states(
int endPin,
int startPin);
752 unsigned int get_outputs(
int endPin,
int startPin);
765 void set_directions(
int endPin,
int startPin,
unsigned int pattern);
778 void set_outputs(
int endPin,
int startPin,
unsigned int pattern);
803 void pause(
int time);
839 long count(
int pin,
long duration);
869 void dac_ctr(
int pin,
int channel,
int dacVal);
905 void freqout(
int pin,
int msTime,
int frequency);
921 int pwm_start(
unsigned int cycleMicroseconds);
948 void pwm_set(
int pin,
int channel,
int tHigh);
1005 long rc_time(
int pin,
int state);
1083 int shift_in(
int pinDat,
int pinClk,
int mode,
int bits);
1094 void shift_out(
int pinDat,
int pinClk,
int mode,
int bits,
int value);
1127 i2c *
i2c_newbus(
int sclPin,
int sdaPin,
int sclDrive);
1157 HUBTEXT
int i2c_out(i2c *busID,
int i2cAddr,
1158 int memAddr,
int memAddrCount,
1159 const unsigned char *data,
int dataCount);
1189 HUBTEXT
int i2c_in(i2c *busID,
int i2cAddr,
1190 int memAddr,
int memAddrCount,
1191 unsigned char *data,
int dataCount);
1203 HUBTEXT
int i2c_busy(i2c *busID,
int i2cAddr);
1227 void ee_putByte(
unsigned char value,
int addr);
1273 void ee_putStr(
unsigned char *s,
int n,
int addr);
1289 unsigned char*
ee_getStr(
unsigned char* s,
int n,
int addr);
1345 void ee_config(
int sclPin,
int sdaPin,
int sclDrive);
1372 int sd_mount(
int doPin,
int clkPin,
int diPin,
int csPin);
1411 int *
cog_run(
void (*
function)(
void *par),
int stacksize);
1541 void endianSwap(
void *resultAddr,
void *varAddr,
int byteCount);
1563 float mapFloat(
float value,
float fromMin,
float fromMax,
float toMin,
float toMax);
1584 int mapInt(
int value,
int fromMin,
int fromMax,
int toMin,
int toMax);
1599 int random(
int limitLow,
int limitHigh);
1680 void wait(
int time);
1690 #if defined(__cplusplus)