|
Modmata
v0
An arduino communications server using Modbus
|
Header file for 'Functions.cpp'. More...
#include <stdlib.h>#include <stdint.h>#include <Arduino.h>#include <Servo.h>#include <Wire.h>#include <SPI.h>

Go to the source code of this file.
Classes | |
| struct | registers |
| A data structure to describe function arguments and return values. More... | |
| struct | spi_settings |
| A data structure to describe a SPI connection's configuration settings. Essentially the same as Arduino's 'SPIsettings' object. More... | |
Macros | |
| #define | makeDWord(i0, i1, i2, i3) ((uint32_t) (i0 << 24 | i1 << 16 | i2 << 8 | i3)) |
| Combine four 8-bit integral types into one 32-bit integral type, or in simpler terms, reassemble a uint32_t from four uint8_t's. | |
| #define | IDLE 0 |
| #define | PINMODE 1 |
| #define | DIGITALWRITE 2 |
| #define | DIGITALREAD 3 |
| #define | ANALOGREFERENCE 4 |
| #define | ANALOGWRITE 5 |
| #define | ANALOGREAD 6 |
| #define | SERVOATTACH 7 |
| #define | SERVODETACH 8 |
| #define | SERVOWRITE 9 |
| #define | SERVOREAD 10 |
| #define | WIREBEGIN 11 |
| #define | WIREEND 12 |
| #define | WIRECLOCK 13 |
| #define | WIREWRITE 14 |
| #define | WIREREAD 15 |
| #define | SPIBEGIN 16 |
| #define | SPISETTINGS 17 |
| #define | SPITRANSFER 18 |
| #define | SPIEND 19 |
Functions | |
| struct registers | pinMode (uint8_t argc, uint8_t *argv) |
| Change the settings of the Arduino I/O pins. More... | |
| struct registers | digitalWrite (uint8_t argc, uint8_t *argv) |
| Write a digital (HIGH/LOW) value to the Arduino I/O pins. More... | |
| struct registers | digitalRead (uint8_t argc, uint8_t *argv) |
| Read a digital value (HIGH/LOW) from the Arduino I/O pins. More... | |
| struct registers | analogWrite (uint8_t argc, uint8_t *argv) |
| Write an analog value (0-255) to the Arduino I/O pins. More... | |
| struct registers | analogRead (uint8_t argc, uint8_t *argv) |
| Read an analog value (0-1023) from the Arduino I/O pins. More... | |
| struct registers | servoAttach (uint8_t argc, uint8_t *argv) |
| Attach a connected servo to a control interface. More... | |
| struct registers | servoDetach (uint8_t argc, uint8_t *argv) |
| Detach a servo from the the control interface. More... | |
| struct registers | servoWrite (uint8_t argc, uint8_t *argv) |
| Write a value to the connected servo. More... | |
| struct registers | servoRead (uint8_t argc, uint8_t *argv) |
| Read a value from the connected servo. More... | |
| struct registers | wireBegin (uint8_t argc, uint8_t *argv) |
| Begin an I2C connection between the Arduino and a peripheral. More... | |
| struct registers | wireEnd (uint8_t argc, uint8_t *argv) |
| End an I2C connection between the Arduino and a peripheral. More... | |
| struct registers | wireSetClock (uint8_t argc, uint8_t *argv) |
| Change the clock speed settings of the I2C connection. More... | |
| struct registers | wireWrite (uint8_t argc, uint8_t *argv) |
| Write data to the connected I2C peripheral. More... | |
| struct registers | wireRead (uint8_t argc, uint8_t *argv) |
| Read data from the connected I2C peripheral. More... | |
| struct registers | spiBegin (uint8_t argc, uint8_t *argv) |
| Begin a SPI connection between the Arduino and a peripheral. More... | |
| struct registers | spiSettings (uint8_t argc, uint8_t *argv) |
| Change the settings of the SPI connection. More... | |
| struct registers | spiTransferBuf (uint8_t argc, uint8_t *argv) |
| Exchange data over the SPI connection (Read + Write) More... | |
| struct registers | spiEnd (uint8_t argc, uint8_t *argv) |
| End a SPI connection between the Arduino and a peripheral. More... | |
| struct registers |
A data structure to describe function arguments and return values.
| count | The number of arguments contained within the array 'value'. |
| value | A pointer to an array of bytes (8-bit integral types) that contains the values of the arguments or return values for a command. |
Definition at line 59 of file Functions.h.
| struct spi_settings |
A data structure to describe a SPI connection's configuration settings. Essentially the same as Arduino's 'SPIsettings' object.
| speed | The baud rate/clock speed of the connection. |
| order | The order of bits sent over the wire |
| mode | The clock polarity and phase |
Definition at line 74 of file Functions.h.
| Class Members | ||
|---|---|---|
| uint8_t | mode |
The clock polarity and phase. |
| bool | order |
The order of bits sent over the wire. |
| uint32_t | speed |
The baud rate/clock speed of the connection. |
| struct registers analogRead | ( | uint8_t | argc, |
| uint8_t * | argv | ||
| ) |
Read an analog value (0-1023) from the Arduino I/O pins.
| argc | The number of arguments contained within the 'argv' array (1) |
| argv | The arguments to use within the function (pin #) |
Definition at line 29 of file Functions.cpp.
| struct registers analogWrite | ( | uint8_t | argc, |
| uint8_t * | argv | ||
| ) |
Write an analog value (0-255) to the Arduino I/O pins.
| argc | The number of arguments contained within the 'argv' array (3) |
| argv | The arguments to use within the function (pin #, 16-bit value split into 2 8-bit values) |
Definition at line 29 of file Functions.cpp.
| struct registers digitalRead | ( | uint8_t | argc, |
| uint8_t * | argv | ||
| ) |
Read a digital value (HIGH/LOW) from the Arduino I/O pins.
| argc | The number of arguments contained within the 'argv' array (1) |
| argv | The arguments to use within the function (pin #) |
Definition at line 29 of file Functions.cpp.
| struct registers digitalWrite | ( | uint8_t | argc, |
| uint8_t * | argv | ||
| ) |
Write a digital (HIGH/LOW) value to the Arduino I/O pins.
| argc | The number of arguments contained within the 'argv' array (2) |
| argv | The arguments to use within the function (pin #, value) |
Definition at line 29 of file Functions.cpp.
| struct registers pinMode | ( | uint8_t | argc, |
| uint8_t * | argv | ||
| ) |
Change the settings of the Arduino I/O pins.
| argc | The number of arguments contained within the 'argv' array (2) |
| argv | The arguments to use within the function (pin #, mode) |
Definition at line 29 of file Functions.cpp.
| struct registers servoAttach | ( | uint8_t | argc, |
| uint8_t * | argv | ||
| ) |
Attach a connected servo to a control interface.
| argc | The number of arguments contained within the 'argv' array (1) |
| argv | The arguments to use within the function (pin #) |
Definition at line 29 of file Functions.cpp.
| struct registers servoDetach | ( | uint8_t | argc, |
| uint8_t * | argv | ||
| ) |
Detach a servo from the the control interface.
| argc | The number of arguments contained within the 'argv' array (1) |
| argv | The arguments to use within the function (pin #) |
Definition at line 29 of file Functions.cpp.
| struct registers servoRead | ( | uint8_t | argc, |
| uint8_t * | argv | ||
| ) |
Read a value from the connected servo.
| argc | The number of arguments contained within the 'argv' array |
| argv | The arguments to use within the function |
Definition at line 29 of file Functions.cpp.
| struct registers servoWrite | ( | uint8_t | argc, |
| uint8_t * | argv | ||
| ) |
Write a value to the connected servo.
| argc | The number of arguments contained within the 'argv' array (2) |
| argv | The arguments to use within the function (pin #, value) |
Definition at line 29 of file Functions.cpp.
| struct registers spiBegin | ( | uint8_t | argc, |
| uint8_t * | argv | ||
| ) |
Begin a SPI connection between the Arduino and a peripheral.
| argc | The number of arguments contained within the 'argv' array |
| argv | The arguments to use within the function |
Definition at line 29 of file Functions.cpp.
| struct registers spiEnd | ( | uint8_t | argc, |
| uint8_t * | argv | ||
| ) |
End a SPI connection between the Arduino and a peripheral.
| argc | The number of arguments contained within the 'argv' array (0) |
| argv | The arguments to use within the function (None) |
Definition at line 29 of file Functions.cpp.
| struct registers spiSettings | ( | uint8_t | argc, |
| uint8_t * | argv | ||
| ) |
Change the settings of the SPI connection.
| argc | The number of arguments contained within the 'argv' array |
| argv | The arguments to use within the function |
Definition at line 29 of file Functions.cpp.
| struct registers spiTransferBuf | ( | uint8_t | argc, |
| uint8_t * | argv | ||
| ) |
Exchange data over the SPI connection (Read + Write)
| argc | The number of arguments contained within the 'argv' array |
| argv | The arguments to use within the function |
Definition at line 29 of file Functions.cpp.
| struct registers wireBegin | ( | uint8_t | argc, |
| uint8_t * | argv | ||
| ) |
Begin an I2C connection between the Arduino and a peripheral.
| argc | The number of arguments contained within the 'argv' array |
| argv | The arguments to use within the function |
Definition at line 29 of file Functions.cpp.
| struct registers wireEnd | ( | uint8_t | argc, |
| uint8_t * | argv | ||
| ) |
End an I2C connection between the Arduino and a peripheral.
| argc | The number of arguments contained within the 'argv' array |
| argv | The arguments to use within the function |
Definition at line 29 of file Functions.cpp.
| struct registers wireRead | ( | uint8_t | argc, |
| uint8_t * | argv | ||
| ) |
Read data from the connected I2C peripheral.
| argc | The number of arguments contained within the 'argv' array |
| argv | The arguments to use within the function |
Definition at line 29 of file Functions.cpp.
| struct registers wireSetClock | ( | uint8_t | argc, |
| uint8_t * | argv | ||
| ) |
Change the clock speed settings of the I2C connection.
| argc | The number of arguments contained within the 'argv' array |
| argv | The arguments to use within the function |
Definition at line 29 of file Functions.cpp.
| struct registers wireWrite | ( | uint8_t | argc, |
| uint8_t * | argv | ||
| ) |
Write data to the connected I2C peripheral.
| argc | The number of arguments contained within the 'argv' array |
| argv | The arguments to use within the function |
Definition at line 29 of file Functions.cpp.