MySensors Library & Examples  2.3.2
RPi.h
1 /*
2  * The MySensors Arduino library handles the wireless radio link and protocol
3  * between your home built sensors/actuators and HA controller of choice.
4  * The sensors forms a self healing radio network with optional repeaters. Each
5  * repeater and gateway builds a routing tables in EEPROM which keeps track of the
6  * network topology allowing messages to be routed to nodes.
7  *
8  * Created by Henrik Ekblad <[email protected]>
9  * Copyright (C) 2013-2019 Sensnology AB
10  * Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
11  *
12  * Documentation: http://www.mysensors.org
13  * Support Forum: http://forum.mysensors.org
14  *
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License
17  * version 2 as published by the Free Software Foundation.
18  */
19 
20 #ifndef RPi_h
21 #define RPi_h
22 
23 #include <stdint.h>
24 #include "BCM.h"
25 
29 class RPiClass
30 {
31 
32 public:
39  void pinMode(uint8_t physPin, uint8_t mode);
46  void digitalWrite(uint8_t physPin, uint8_t value);
53  uint8_t digitalRead(uint8_t physPin);
60  uint8_t digitalPinToInterrupt(uint8_t physPin);
68  static int physToGPIO(uint8_t physPin, uint8_t *gpio);
69 
70 private:
71  static const int *phys_to_gpio;
72 
77  static int rpiGpioLayout(void);
78 };
79 
80 extern RPiClass RPi;
81 
82 #endif
RPiClass::pinMode
void pinMode(uint8_t physPin, uint8_t mode)
Configures the specified pin to behave either as an input or an output.
RPiClass
RPi class.
Definition: RPi.h:29
RPiClass::digitalRead
uint8_t digitalRead(uint8_t physPin)
Reads the value from a specified pin.
RPiClass::digitalWrite
void digitalWrite(uint8_t physPin, uint8_t value)
Write a high or a low value for the given pin.
RPiClass::digitalPinToInterrupt
uint8_t digitalPinToInterrupt(uint8_t physPin)
Translate the physical pin number to the GPIO number for use in interrupt.
RPiClass::physToGPIO
static int physToGPIO(uint8_t physPin, uint8_t *gpio)
Translate the physical pin number to the GPIO number.