16 #include "modbus/modbus.h"
20 #define DIGITALWRITE 2
22 #define ANALOGREFERENCE 4
35 #define SPISETTINGS 17
36 #define SPITRANSFER 18
48 #define SPI_MODE0 0x00
49 #define SPI_MODE1 0x04
50 #define SPI_MODE2 0x08
51 #define SPI_MODE3 0x0C
53 static modbus_t* arduino;
60 static void safe_exit(
int signal);
74 void delay(
int millis);
100 void pinMode(uint8_t pinNum, uint8_t mode);
152 void servoWrite(uint16_t pinNum, uint16_t input);
188 void wireWrite(uint8_t addr, uint8_t reg, uint8_t num_bytes, uint8_t* data);
197 uint8_t*
wireRead(uint8_t addr, uint8_t reg,
int num_bytes);
212 uint8_t*
spiTransferBuf(
int CS_pin, uint8_t *buf, uint8_t length);
221 void spiSettings(uint32_t speed, uint8_t order, uint8_t mode);
void wireWrite(uint8_t addr, uint8_t reg, uint8_t num_bytes, uint8_t *data)
Definition: ModmataC.c:340
void delayMicroseconds(int micros)
Definition: ModmataC.c:62
int connectArduino(char *port, int baudRate, int id)
Definition: ModmataC.c:93
int digitalRead(uint8_t pinNum)
Definition: ModmataC.c:161
void spiBegin()
Definition: ModmataC.c:388
uint8_t * wireRead(uint8_t addr, uint8_t reg, int num_bytes)
Definition: ModmataC.c:362
void pinMode(uint8_t pinNum, uint8_t mode)
Definition: ModmataC.c:121
void wireEnd()
Definition: ModmataC.c:317
int isValidPin(int pinNum)
Definition: ModmataC.c:74
uint8_t * spiTransferBuf(int CS_pin, uint8_t *buf, uint8_t length)
Definition: ModmataC.c:400
void servoWrite(uint16_t pinNum, uint16_t input)
Definition: ModmataC.c:264
int analogRead(uint16_t pinNum)
Definition: ModmataC.c:212
void spiSettings(uint32_t speed, uint8_t order, uint8_t mode)
Definition: ModmataC.c:439
void closeConnection()
Definition: ModmataC.c:51
void wireBegin()
Definition: ModmataC.c:308
void servoDetach(uint16_t pinNum)
Definition: ModmataC.c:250
void servoAttach(uint16_t pinNum)
Definition: ModmataC.c:237
void delay(int millis)
Definition: ModmataC.c:56
void analogWrite(uint8_t pinNum, uint16_t input)
Definition: ModmataC.c:190
void wireSetClock(uint32_t)
Definition: ModmataC.c:327
void transmitRegisters(uint8_t fn_code, uint8_t argc, uint8_t *argv)
Definition: ModmataC.c:457
int servoRead(uint16_t pinNum)
Definition: ModmataC.c:281
void spiEnd()
Definition: ModmataC.c:448
void digitalWrite(uint8_t pinNum, uint8_t input)
Definition: ModmataC.c:143