libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
gatein.h
Go to the documentation of this file.
1#pragma once
2#ifndef DSY_GATEIN_H
3#define DSY_GATEIN_H
4#include "per/gpio.h"
5
6namespace daisy
7{
14class GateIn
15{
16 public:
18 GateIn() {}
19
22
32 void Init(Pin pin, bool invert = true);
33
37 bool Trig();
38
42 inline bool State() { return invert_ ? !pin_.Read() : pin_.Read(); }
43
44 private:
45 GPIO pin_;
46 bool prev_state_, state_;
47 bool invert_;
48};
49} // namespace daisy
50#endif
General Purpose I/O control.
Definition gpio.h:22
bool Read()
Reads the state of the GPIO.
Generic Class for handling gate inputs through GPIO.
Definition gatein.h:15
bool State()
Definition gatein.h:42
GateIn()
Definition gatein.h:18
void Init(Pin pin, bool invert=true)
Initializes the gate input with specified hardware pin.
~GateIn()
Definition gatein.h:21
Definition leddriver.h:33
Hardware defines and helpers for daisy field platform.
Definition index.h:2
representation of hardware port/pin combination
Definition daisy_core.h:193