|
Peritoneal Dialysis Capstone
Controlling catheter for peritoneal dialysis
|
An implementation of IHAL for Arduino. More...
#include <ArduinoHAL.h>


Public Member Functions | |
| ArduinoHAL (int serialBaud) | |
| AnalogValue | analogRead (int pin) override |
| Samples an analog input pin. | |
| void | analogWrite (int pin, AnalogValue value) override |
| Drives an analog output pin. | |
| AnalogValue | getMaxAnalogReadQuant () const override |
| Returns the maximum quantized value of an analog read. | |
| AnalogValue | getMaxAnalogWriteQuant () const override |
| Returns the maximum quantized value of an analog write. | |
| void | configurePin (int pin, PinMode mode) override |
| Configures a pin for use as an input or output. | |
| DigitalValue | digitalRead (int pin) override |
| Samples a digital input pin. | |
| void | digitalWrite (int pin, DigitalValue value) override |
| Drives a digital output pin. | |
| void | beginSerial () override |
| Initializes the serial interface. | |
| size_t | print (const char *s) override |
| Transmits an ASCII string over serial. | |
| size_t | println (const char *s) override |
| Transmits an ASCII string with trailing newline over serial. | |
| void | delayMs (unsigned long durationMs) override |
| Suspends execution for a specified duration in milliseconds. | |
| unsigned long | getTimeMs () override |
| Returns the number of milliseconds elapsed since the start of execution, modulo ULONG_MAX-1. | |
| Public Member Functions inherited from IHAL | |
| virtual | ~IHAL ()=default |
Private Attributes | |
| int | m_serialBaud |
Static Private Attributes | |
| static constexpr AnalogValue | MAX_ANALOG_READ_QUANT = 1023 |
| static constexpr AnalogValue | MAX_ANALOG_WRITE_QUANT = 255 |
An implementation of IHAL for Arduino.
This class provides Arduino-specific implementations of all hardware operations defined in the IHAL interface.
| ArduinoHAL::ArduinoHAL | ( | int | serialBaud | ) |
|
overridevirtual |
Samples an analog input pin.
The pin must be valid for analog reading.
| pin | The pin number. |
N is the maximum value indicated by getMaxAnalogReadQuant. Implements IHAL.
|
overridevirtual |
Drives an analog output pin.
The pin must be valid for analog writing.
| pin | The pin number. |
| value | The quantized value to write. Must be in the range [0,
N] where N is the maximum value indicated by getMaxAnalogWriteQuant. |
Implements IHAL.
|
overridevirtual |
Initializes the serial interface.
This method must be called before using the serial print functions.
Implements IHAL.
|
overridevirtual |
Configures a pin for use as an input or output.
| pin | The pin number. |
| mode | The mode (input or output) to set. |
Implements IHAL.
|
overridevirtual |
Suspends execution for a specified duration in milliseconds.
| durationMs | The duration in milliseconds. |
Implements IHAL.
|
overridevirtual |
Samples a digital input pin.
The pin must be valid for digital reading.
| pin | The pin number. |
Implements IHAL.
|
overridevirtual |
Drives a digital output pin.
The pin must be valid for digital writing.
| pin | The pin number. |
| value | The digital value to write. |
Implements IHAL.
|
overridevirtual |
Returns the maximum quantized value of an analog read.
For an analog read, a real input value in the range [0, 1] can be obtained by dividing the quantized value by this maximum value.
Implements IHAL.
|
overridevirtual |
Returns the maximum quantized value of an analog write.
For an analog write, a real output value in the range [0, 1] can be converted to a quantized value by multiplying by this maximum value.
Implements IHAL.
|
overridevirtual |
Returns the number of milliseconds elapsed since the start of execution, modulo ULONG_MAX-1.
Implements IHAL.
|
overridevirtual |
Transmits an ASCII string over serial.
| s | The NUL-terminated ASCII string to write. |
Implements IHAL.
|
overridevirtual |
Transmits an ASCII string with trailing newline over serial.
The string s is written, followed by an appropriate end-of-line indicator (e.g., CR-LF).
| s | The NUL-terminated ASCII string to write. |
Implements IHAL.
|
private |
|
staticconstexprprivate |
|
staticconstexprprivate |