Ein Roboter mit bürstenlosem Antrieb, differenzial und NRF24L01 Funk. Großflächig gebaut um ein großes Solarpanel aufzunehmen. https://gitlab.informatik.hs-fulda.de/fdai5253/roboter
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

420 lines
16 KiB

  1. #ifndef OneWire_Direct_GPIO_h
  2. #define OneWire_Direct_GPIO_h
  3. // This header should ONLY be included by OneWire.cpp. These defines are
  4. // meant to be private, used within OneWire.cpp, but not exposed to Arduino
  5. // sketches or other libraries which may include OneWire.h.
  6. #include <stdint.h>
  7. // Platform specific I/O definitions
  8. #if defined(__AVR__)
  9. #define PIN_TO_BASEREG(pin) (portInputRegister(digitalPinToPort(pin)))
  10. #define PIN_TO_BITMASK(pin) (digitalPinToBitMask(pin))
  11. #define IO_REG_TYPE uint8_t
  12. #define IO_REG_BASE_ATTR asm("r30")
  13. #define IO_REG_MASK_ATTR
  14. #if defined(__AVR_ATmega4809__)
  15. #define DIRECT_READ(base, mask) (((*(base)) & (mask)) ? 1 : 0)
  16. #define DIRECT_MODE_INPUT(base, mask) ((*((base)-8)) &= ~(mask))
  17. #define DIRECT_MODE_OUTPUT(base, mask) ((*((base)-8)) |= (mask))
  18. #define DIRECT_WRITE_LOW(base, mask) ((*((base)-4)) &= ~(mask))
  19. #define DIRECT_WRITE_HIGH(base, mask) ((*((base)-4)) |= (mask))
  20. #else
  21. #define DIRECT_READ(base, mask) (((*(base)) & (mask)) ? 1 : 0)
  22. #define DIRECT_MODE_INPUT(base, mask) ((*((base)+1)) &= ~(mask))
  23. #define DIRECT_MODE_OUTPUT(base, mask) ((*((base)+1)) |= (mask))
  24. #define DIRECT_WRITE_LOW(base, mask) ((*((base)+2)) &= ~(mask))
  25. #define DIRECT_WRITE_HIGH(base, mask) ((*((base)+2)) |= (mask))
  26. #endif
  27. #elif defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK66FX1M0__) || defined(__MK64FX512__)
  28. #define PIN_TO_BASEREG(pin) (portOutputRegister(pin))
  29. #define PIN_TO_BITMASK(pin) (1)
  30. #define IO_REG_TYPE uint8_t
  31. #define IO_REG_BASE_ATTR
  32. #define IO_REG_MASK_ATTR __attribute__ ((unused))
  33. #define DIRECT_READ(base, mask) (*((base)+512))
  34. #define DIRECT_MODE_INPUT(base, mask) (*((base)+640) = 0)
  35. #define DIRECT_MODE_OUTPUT(base, mask) (*((base)+640) = 1)
  36. #define DIRECT_WRITE_LOW(base, mask) (*((base)+256) = 1)
  37. #define DIRECT_WRITE_HIGH(base, mask) (*((base)+128) = 1)
  38. #elif defined(__MKL26Z64__)
  39. #define PIN_TO_BASEREG(pin) (portOutputRegister(pin))
  40. #define PIN_TO_BITMASK(pin) (digitalPinToBitMask(pin))
  41. #define IO_REG_TYPE uint8_t
  42. #define IO_REG_BASE_ATTR
  43. #define IO_REG_MASK_ATTR
  44. #define DIRECT_READ(base, mask) ((*((base)+16) & (mask)) ? 1 : 0)
  45. #define DIRECT_MODE_INPUT(base, mask) (*((base)+20) &= ~(mask))
  46. #define DIRECT_MODE_OUTPUT(base, mask) (*((base)+20) |= (mask))
  47. #define DIRECT_WRITE_LOW(base, mask) (*((base)+8) = (mask))
  48. #define DIRECT_WRITE_HIGH(base, mask) (*((base)+4) = (mask))
  49. #elif defined(__IMXRT1052__) || defined(__IMXRT1062__)
  50. #define PIN_TO_BASEREG(pin) (portOutputRegister(pin))
  51. #define PIN_TO_BITMASK(pin) (digitalPinToBitMask(pin))
  52. #define IO_REG_TYPE uint32_t
  53. #define IO_REG_BASE_ATTR
  54. #define IO_REG_MASK_ATTR
  55. #define DIRECT_READ(base, mask) ((*((base)+2) & (mask)) ? 1 : 0)
  56. #define DIRECT_MODE_INPUT(base, mask) (*((base)+1) &= ~(mask))
  57. #define DIRECT_MODE_OUTPUT(base, mask) (*((base)+1) |= (mask))
  58. #define DIRECT_WRITE_LOW(base, mask) (*((base)+34) = (mask))
  59. #define DIRECT_WRITE_HIGH(base, mask) (*((base)+33) = (mask))
  60. #elif defined(__SAM3X8E__) || defined(__SAM3A8C__) || defined(__SAM3A4C__)
  61. // Arduino 1.5.1 may have a bug in delayMicroseconds() on Arduino Due.
  62. // http://arduino.cc/forum/index.php/topic,141030.msg1076268.html#msg1076268
  63. // If you have trouble with OneWire on Arduino Due, please check the
  64. // status of delayMicroseconds() before reporting a bug in OneWire!
  65. #define PIN_TO_BASEREG(pin) (&(digitalPinToPort(pin)->PIO_PER))
  66. #define PIN_TO_BITMASK(pin) (digitalPinToBitMask(pin))
  67. #define IO_REG_TYPE uint32_t
  68. #define IO_REG_BASE_ATTR
  69. #define IO_REG_MASK_ATTR
  70. #define DIRECT_READ(base, mask) (((*((base)+15)) & (mask)) ? 1 : 0)
  71. #define DIRECT_MODE_INPUT(base, mask) ((*((base)+5)) = (mask))
  72. #define DIRECT_MODE_OUTPUT(base, mask) ((*((base)+4)) = (mask))
  73. #define DIRECT_WRITE_LOW(base, mask) ((*((base)+13)) = (mask))
  74. #define DIRECT_WRITE_HIGH(base, mask) ((*((base)+12)) = (mask))
  75. #ifndef PROGMEM
  76. #define PROGMEM
  77. #endif
  78. #ifndef pgm_read_byte
  79. #define pgm_read_byte(addr) (*(const uint8_t *)(addr))
  80. #endif
  81. #elif defined(__PIC32MX__)
  82. #define PIN_TO_BASEREG(pin) (portModeRegister(digitalPinToPort(pin)))
  83. #define PIN_TO_BITMASK(pin) (digitalPinToBitMask(pin))
  84. #define IO_REG_TYPE uint32_t
  85. #define IO_REG_BASE_ATTR
  86. #define IO_REG_MASK_ATTR
  87. #define DIRECT_READ(base, mask) (((*(base+4)) & (mask)) ? 1 : 0) //PORTX + 0x10
  88. #define DIRECT_MODE_INPUT(base, mask) ((*(base+2)) = (mask)) //TRISXSET + 0x08
  89. #define DIRECT_MODE_OUTPUT(base, mask) ((*(base+1)) = (mask)) //TRISXCLR + 0x04
  90. #define DIRECT_WRITE_LOW(base, mask) ((*(base+8+1)) = (mask)) //LATXCLR + 0x24
  91. #define DIRECT_WRITE_HIGH(base, mask) ((*(base+8+2)) = (mask)) //LATXSET + 0x28
  92. #elif defined(ARDUINO_ARCH_ESP8266)
  93. // Special note: I depend on the ESP community to maintain these definitions and
  94. // submit good pull requests. I can not answer any ESP questions or help you
  95. // resolve any problems related to ESP chips. Please do not contact me and please
  96. // DO NOT CREATE GITHUB ISSUES for ESP support. All ESP questions must be asked
  97. // on ESP community forums.
  98. #define PIN_TO_BASEREG(pin) ((volatile uint32_t*) GPO)
  99. #define PIN_TO_BITMASK(pin) (1 << pin)
  100. #define IO_REG_TYPE uint32_t
  101. #define IO_REG_BASE_ATTR
  102. #define IO_REG_MASK_ATTR
  103. #define DIRECT_READ(base, mask) ((GPI & (mask)) ? 1 : 0) //GPIO_IN_ADDRESS
  104. #define DIRECT_MODE_INPUT(base, mask) (GPE &= ~(mask)) //GPIO_ENABLE_W1TC_ADDRESS
  105. #define DIRECT_MODE_OUTPUT(base, mask) (GPE |= (mask)) //GPIO_ENABLE_W1TS_ADDRESS
  106. #define DIRECT_WRITE_LOW(base, mask) (GPOC = (mask)) //GPIO_OUT_W1TC_ADDRESS
  107. #define DIRECT_WRITE_HIGH(base, mask) (GPOS = (mask)) //GPIO_OUT_W1TS_ADDRESS
  108. #elif defined(ARDUINO_ARCH_ESP32)
  109. #include <driver/rtc_io.h>
  110. #define PIN_TO_BASEREG(pin) (0)
  111. #define PIN_TO_BITMASK(pin) (pin)
  112. #define IO_REG_TYPE uint32_t
  113. #define IO_REG_BASE_ATTR
  114. #define IO_REG_MASK_ATTR
  115. static inline __attribute__((always_inline))
  116. IO_REG_TYPE directRead(IO_REG_TYPE pin)
  117. {
  118. if ( pin < 32 )
  119. return (GPIO.in >> pin) & 0x1;
  120. else if ( pin < 40 )
  121. return (GPIO.in1.val >> (pin - 32)) & 0x1;
  122. return 0;
  123. }
  124. static inline __attribute__((always_inline))
  125. void directWriteLow(IO_REG_TYPE pin)
  126. {
  127. if ( pin < 32 )
  128. GPIO.out_w1tc = ((uint32_t)1 << pin);
  129. else if ( pin < 34 )
  130. GPIO.out1_w1tc.val = ((uint32_t)1 << (pin - 32));
  131. }
  132. static inline __attribute__((always_inline))
  133. void directWriteHigh(IO_REG_TYPE pin)
  134. {
  135. if ( pin < 32 )
  136. GPIO.out_w1ts = ((uint32_t)1 << pin);
  137. else if ( pin < 34 )
  138. GPIO.out1_w1ts.val = ((uint32_t)1 << (pin - 32));
  139. }
  140. static inline __attribute__((always_inline))
  141. void directModeInput(IO_REG_TYPE pin)
  142. {
  143. if ( digitalPinIsValid(pin) )
  144. {
  145. uint32_t rtc_reg(rtc_gpio_desc[pin].reg);
  146. if ( rtc_reg ) // RTC pins PULL settings
  147. {
  148. ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_gpio_desc[pin].mux);
  149. ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_gpio_desc[pin].pullup | rtc_gpio_desc[pin].pulldown);
  150. }
  151. if ( pin < 32 )
  152. GPIO.enable_w1tc = ((uint32_t)1 << pin);
  153. else
  154. GPIO.enable1_w1tc.val = ((uint32_t)1 << (pin - 32));
  155. uint32_t pinFunction((uint32_t)2 << FUN_DRV_S); // what are the drivers?
  156. pinFunction |= FUN_IE; // input enable but required for output as well?
  157. pinFunction |= ((uint32_t)2 << MCU_SEL_S);
  158. ESP_REG(DR_REG_IO_MUX_BASE + esp32_gpioMux[pin].reg) = pinFunction;
  159. GPIO.pin[pin].val = 0;
  160. }
  161. }
  162. static inline __attribute__((always_inline))
  163. void directModeOutput(IO_REG_TYPE pin)
  164. {
  165. if ( digitalPinIsValid(pin) && pin <= 33 ) // pins above 33 can be only inputs
  166. {
  167. uint32_t rtc_reg(rtc_gpio_desc[pin].reg);
  168. if ( rtc_reg ) // RTC pins PULL settings
  169. {
  170. ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_gpio_desc[pin].mux);
  171. ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_gpio_desc[pin].pullup | rtc_gpio_desc[pin].pulldown);
  172. }
  173. if ( pin < 32 )
  174. GPIO.enable_w1ts = ((uint32_t)1 << pin);
  175. else // already validated to pins <= 33
  176. GPIO.enable1_w1ts.val = ((uint32_t)1 << (pin - 32));
  177. uint32_t pinFunction((uint32_t)2 << FUN_DRV_S); // what are the drivers?
  178. pinFunction |= FUN_IE; // input enable but required for output as well?
  179. pinFunction |= ((uint32_t)2 << MCU_SEL_S);
  180. ESP_REG(DR_REG_IO_MUX_BASE + esp32_gpioMux[pin].reg) = pinFunction;
  181. GPIO.pin[pin].val = 0;
  182. }
  183. }
  184. #define DIRECT_READ(base, pin) directRead(pin)
  185. #define DIRECT_WRITE_LOW(base, pin) directWriteLow(pin)
  186. #define DIRECT_WRITE_HIGH(base, pin) directWriteHigh(pin)
  187. #define DIRECT_MODE_INPUT(base, pin) directModeInput(pin)
  188. #define DIRECT_MODE_OUTPUT(base, pin) directModeOutput(pin)
  189. // https://github.com/PaulStoffregen/OneWire/pull/47
  190. // https://github.com/stickbreaker/OneWire/commit/6eb7fc1c11a15b6ac8c60e5671cf36eb6829f82c
  191. #ifdef interrupts
  192. #undef interrupts
  193. #endif
  194. #ifdef noInterrupts
  195. #undef noInterrupts
  196. #endif
  197. #define noInterrupts() {portMUX_TYPE mux = portMUX_INITIALIZER_UNLOCKED;portENTER_CRITICAL(&mux)
  198. #define interrupts() portEXIT_CRITICAL(&mux);}
  199. //#warning "ESP32 OneWire testing"
  200. #elif defined(ARDUINO_ARCH_STM32)
  201. #define PIN_TO_BASEREG(pin) (0)
  202. #define PIN_TO_BITMASK(pin) ((uint32_t)digitalPinToPinName(pin))
  203. #define IO_REG_TYPE uint32_t
  204. #define IO_REG_BASE_ATTR
  205. #define IO_REG_MASK_ATTR
  206. #define DIRECT_READ(base, pin) digitalReadFast((PinName)pin)
  207. #define DIRECT_WRITE_LOW(base, pin) digitalWriteFast((PinName)pin, LOW)
  208. #define DIRECT_WRITE_HIGH(base, pin) digitalWriteFast((PinName)pin, HIGH)
  209. #define DIRECT_MODE_INPUT(base, pin) pin_function((PinName)pin, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, 0))
  210. #define DIRECT_MODE_OUTPUT(base, pin) pin_function((PinName)pin, STM_PIN_DATA(STM_MODE_OUTPUT_PP, GPIO_NOPULL, 0))
  211. #elif defined(__SAMD21G18A__)
  212. #define PIN_TO_BASEREG(pin) portModeRegister(digitalPinToPort(pin))
  213. #define PIN_TO_BITMASK(pin) (digitalPinToBitMask(pin))
  214. #define IO_REG_TYPE uint32_t
  215. #define IO_REG_BASE_ATTR
  216. #define IO_REG_MASK_ATTR
  217. #define DIRECT_READ(base, mask) (((*((base)+8)) & (mask)) ? 1 : 0)
  218. #define DIRECT_MODE_INPUT(base, mask) ((*((base)+1)) = (mask))
  219. #define DIRECT_MODE_OUTPUT(base, mask) ((*((base)+2)) = (mask))
  220. #define DIRECT_WRITE_LOW(base, mask) ((*((base)+5)) = (mask))
  221. #define DIRECT_WRITE_HIGH(base, mask) ((*((base)+6)) = (mask))
  222. #elif defined(RBL_NRF51822)
  223. #define PIN_TO_BASEREG(pin) (0)
  224. #define PIN_TO_BITMASK(pin) (pin)
  225. #define IO_REG_TYPE uint32_t
  226. #define IO_REG_BASE_ATTR
  227. #define IO_REG_MASK_ATTR
  228. #define DIRECT_READ(base, pin) nrf_gpio_pin_read(pin)
  229. #define DIRECT_WRITE_LOW(base, pin) nrf_gpio_pin_clear(pin)
  230. #define DIRECT_WRITE_HIGH(base, pin) nrf_gpio_pin_set(pin)
  231. #define DIRECT_MODE_INPUT(base, pin) nrf_gpio_cfg_input(pin, NRF_GPIO_PIN_NOPULL)
  232. #define DIRECT_MODE_OUTPUT(base, pin) nrf_gpio_cfg_output(pin)
  233. #elif defined(__arc__) /* Arduino101/Genuino101 specifics */
  234. #include "scss_registers.h"
  235. #include "portable.h"
  236. #include "avr/pgmspace.h"
  237. #define GPIO_ID(pin) (g_APinDescription[pin].ulGPIOId)
  238. #define GPIO_TYPE(pin) (g_APinDescription[pin].ulGPIOType)
  239. #define GPIO_BASE(pin) (g_APinDescription[pin].ulGPIOBase)
  240. #define DIR_OFFSET_SS 0x01
  241. #define DIR_OFFSET_SOC 0x04
  242. #define EXT_PORT_OFFSET_SS 0x0A
  243. #define EXT_PORT_OFFSET_SOC 0x50
  244. /* GPIO registers base address */
  245. #define PIN_TO_BASEREG(pin) ((volatile uint32_t *)g_APinDescription[pin].ulGPIOBase)
  246. #define PIN_TO_BITMASK(pin) pin
  247. #define IO_REG_TYPE uint32_t
  248. #define IO_REG_BASE_ATTR
  249. #define IO_REG_MASK_ATTR
  250. static inline __attribute__((always_inline))
  251. IO_REG_TYPE directRead(volatile IO_REG_TYPE *base, IO_REG_TYPE pin)
  252. {
  253. IO_REG_TYPE ret;
  254. if (SS_GPIO == GPIO_TYPE(pin)) {
  255. ret = READ_ARC_REG(((IO_REG_TYPE)base + EXT_PORT_OFFSET_SS));
  256. } else {
  257. ret = MMIO_REG_VAL_FROM_BASE((IO_REG_TYPE)base, EXT_PORT_OFFSET_SOC);
  258. }
  259. return ((ret >> GPIO_ID(pin)) & 0x01);
  260. }
  261. static inline __attribute__((always_inline))
  262. void directModeInput(volatile IO_REG_TYPE *base, IO_REG_TYPE pin)
  263. {
  264. if (SS_GPIO == GPIO_TYPE(pin)) {
  265. WRITE_ARC_REG(READ_ARC_REG((((IO_REG_TYPE)base) + DIR_OFFSET_SS)) & ~(0x01 << GPIO_ID(pin)),
  266. ((IO_REG_TYPE)(base) + DIR_OFFSET_SS));
  267. } else {
  268. MMIO_REG_VAL_FROM_BASE((IO_REG_TYPE)base, DIR_OFFSET_SOC) &= ~(0x01 << GPIO_ID(pin));
  269. }
  270. }
  271. static inline __attribute__((always_inline))
  272. void directModeOutput(volatile IO_REG_TYPE *base, IO_REG_TYPE pin)
  273. {
  274. if (SS_GPIO == GPIO_TYPE(pin)) {
  275. WRITE_ARC_REG(READ_ARC_REG(((IO_REG_TYPE)(base) + DIR_OFFSET_SS)) | (0x01 << GPIO_ID(pin)),
  276. ((IO_REG_TYPE)(base) + DIR_OFFSET_SS));
  277. } else {
  278. MMIO_REG_VAL_FROM_BASE((IO_REG_TYPE)base, DIR_OFFSET_SOC) |= (0x01 << GPIO_ID(pin));
  279. }
  280. }
  281. static inline __attribute__((always_inline))
  282. void directWriteLow(volatile IO_REG_TYPE *base, IO_REG_TYPE pin)
  283. {
  284. if (SS_GPIO == GPIO_TYPE(pin)) {
  285. WRITE_ARC_REG(READ_ARC_REG(base) & ~(0x01 << GPIO_ID(pin)), base);
  286. } else {
  287. MMIO_REG_VAL(base) &= ~(0x01 << GPIO_ID(pin));
  288. }
  289. }
  290. static inline __attribute__((always_inline))
  291. void directWriteHigh(volatile IO_REG_TYPE *base, IO_REG_TYPE pin)
  292. {
  293. if (SS_GPIO == GPIO_TYPE(pin)) {
  294. WRITE_ARC_REG(READ_ARC_REG(base) | (0x01 << GPIO_ID(pin)), base);
  295. } else {
  296. MMIO_REG_VAL(base) |= (0x01 << GPIO_ID(pin));
  297. }
  298. }
  299. #define DIRECT_READ(base, pin) directRead(base, pin)
  300. #define DIRECT_MODE_INPUT(base, pin) directModeInput(base, pin)
  301. #define DIRECT_MODE_OUTPUT(base, pin) directModeOutput(base, pin)
  302. #define DIRECT_WRITE_LOW(base, pin) directWriteLow(base, pin)
  303. #define DIRECT_WRITE_HIGH(base, pin) directWriteHigh(base, pin)
  304. #elif defined(__riscv)
  305. /*
  306. * Tested on highfive1
  307. *
  308. * Stable results are achieved operating in the
  309. * two high speed modes of the highfive1. It
  310. * seems to be less reliable in slow mode.
  311. */
  312. #define PIN_TO_BASEREG(pin) (0)
  313. #define PIN_TO_BITMASK(pin) digitalPinToBitMask(pin)
  314. #define IO_REG_TYPE uint32_t
  315. #define IO_REG_BASE_ATTR
  316. #define IO_REG_MASK_ATTR
  317. static inline __attribute__((always_inline))
  318. IO_REG_TYPE directRead(IO_REG_TYPE mask)
  319. {
  320. return ((GPIO_REG(GPIO_INPUT_VAL) & mask) != 0) ? 1 : 0;
  321. }
  322. static inline __attribute__((always_inline))
  323. void directModeInput(IO_REG_TYPE mask)
  324. {
  325. GPIO_REG(GPIO_OUTPUT_XOR) &= ~mask;
  326. GPIO_REG(GPIO_IOF_EN) &= ~mask;
  327. GPIO_REG(GPIO_INPUT_EN) |= mask;
  328. GPIO_REG(GPIO_OUTPUT_EN) &= ~mask;
  329. }
  330. static inline __attribute__((always_inline))
  331. void directModeOutput(IO_REG_TYPE mask)
  332. {
  333. GPIO_REG(GPIO_OUTPUT_XOR) &= ~mask;
  334. GPIO_REG(GPIO_IOF_EN) &= ~mask;
  335. GPIO_REG(GPIO_INPUT_EN) &= ~mask;
  336. GPIO_REG(GPIO_OUTPUT_EN) |= mask;
  337. }
  338. static inline __attribute__((always_inline))
  339. void directWriteLow(IO_REG_TYPE mask)
  340. {
  341. GPIO_REG(GPIO_OUTPUT_VAL) &= ~mask;
  342. }
  343. static inline __attribute__((always_inline))
  344. void directWriteHigh(IO_REG_TYPE mask)
  345. {
  346. GPIO_REG(GPIO_OUTPUT_VAL) |= mask;
  347. }
  348. #define DIRECT_READ(base, mask) directRead(mask)
  349. #define DIRECT_WRITE_LOW(base, mask) directWriteLow(mask)
  350. #define DIRECT_WRITE_HIGH(base, mask) directWriteHigh(mask)
  351. #define DIRECT_MODE_INPUT(base, mask) directModeInput(mask)
  352. #define DIRECT_MODE_OUTPUT(base, mask) directModeOutput(mask)
  353. #else
  354. #define PIN_TO_BASEREG(pin) (0)
  355. #define PIN_TO_BITMASK(pin) (pin)
  356. #define IO_REG_TYPE unsigned int
  357. #define IO_REG_BASE_ATTR
  358. #define IO_REG_MASK_ATTR
  359. #define DIRECT_READ(base, pin) digitalRead(pin)
  360. #define DIRECT_WRITE_LOW(base, pin) digitalWrite(pin, LOW)
  361. #define DIRECT_WRITE_HIGH(base, pin) digitalWrite(pin, HIGH)
  362. #define DIRECT_MODE_INPUT(base, pin) pinMode(pin,INPUT)
  363. #define DIRECT_MODE_OUTPUT(base, pin) pinMode(pin,OUTPUT)
  364. #warning "OneWire. Fallback mode. Using API calls for pinMode,digitalRead and digitalWrite. Operation of this library is not guaranteed on this architecture."
  365. #endif
  366. #endif