MakeBlock Drive Updated Updated library for MakeBlock Ranger

Loading...
Searching...
No Matches
MeConfig.h
Go to the documentation of this file.
1
93#ifndef MeConfig_H
94#define MeConfig_H
95
96#include <utility/Servo.h>
97#include <utility/Wire.h>
98#include <utility/EEPROM.h>
99#include <utility/SoftwareSerial.h>
100#include <utility/SPI.h>
101
102#define ME_PORT_DEFINED
103
104#if defined(__AVR__)
105#define MePIN_TO_BASEREG(pin) ( portInputRegister (digitalPinToPort (pin) ) )
106#define MePIN_TO_BITMASK(pin) ( digitalPinToBitMask (pin) )
107#define MeIO_REG_TYPE uint8_t
108#define MeIO_REG_ASM asm ("r30")
109#define MeDIRECT_READ(base, mask) ( ( (*(base) ) & (mask) ) ? 1 : 0)
110#define MeDIRECT_MODE_INPUT(base, mask) ( (*( (base) + 1) ) &= ~(mask) ), ( (*( (base) + 2) ) |= (mask) ) // INPUT_PULLUP
111#define MeDIRECT_MODE_OUTPUT(base, mask) ( (*( (base) + 1) ) |= (mask) )
112#define MeDIRECT_WRITE_LOW(base, mask) ( (*( (base) + 2) ) &= ~(mask) )
113#define MeDIRECT_WRITE_HIGH(base, mask) ( (*( (base) + 2) ) |= (mask) )
114#endif // __AVR__
115
116#endif // MeConfig_H
117