Speeduino
Loading...
Searching...
No Matches
speeduino
src
pins
inputPin.h
Go to the documentation of this file.
1
#pragma once
2
#include <Arduino.h>
3
#include <stdint.h>
4
#include "../../board_definition.h"
5
13
class
inputPin_t
14
{
15
public
:
17
void
setPin
(
uint8_t
pin
,
uint8_t
mode
=
INPUT
);
18
20
bool
isPinHigh
(
void
)
const
;
21
23
bool
isPinLow
(
void
)
const
24
{
25
return
!
isPinHigh
();
26
}
27
29
bool
isValid
(
void
)
const
30
{
31
return
_pin !=
NOT_A_PIN
;
32
}
33
34
private
:
35
uint8_t
_pin =
NOT_A_PIN
;
36
};
NOT_A_PIN
constexpr uint8_t NOT_A_PIN
Definition
board_definition.h:86
inputPin_t
A class for input pin operations.
Definition
inputPin.h:14
inputPin_t::setPin
void setPin(uint8_t pin, uint8_t mode=INPUT)
Set the input pin.
Definition
inputPin.cpp:6
inputPin_t::isValid
bool isValid(void) const
Is the pin set?
Definition
inputPin.h:29
inputPin_t::isPinHigh
bool isPinHigh(void) const
Check if the pin is set high.
Definition
inputPin.cpp:15
inputPin_t::isPinLow
bool isPinLow(void) const
Check if the pin is set low.
Definition
inputPin.h:23
readSerialIntegralTimeout
static TIntegral readSerialIntegralTimeout(void)
Reads an integral type, timing out if necessary.
Definition
comms.cpp:175
Generated by
1.9.8