My Marlin configs for Fabrikator Mini and CTC i3 Pro B
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.

fastio_STM32F7.h 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
  7. * Copyright (C) 2017 Victor Perez
  8. *
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation, either version 3 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. *
  22. */
  23. /**
  24. * Fast I/O interfaces for STM32F7
  25. * These use GPIO functions instead of Direct Port Manipulation, as on AVR.
  26. */
  27. #ifndef _FASTIO_STM32F7_H
  28. #define _FASTIO_STM32F7_H
  29. #define _BV(b) (1UL << (b))
  30. #define READ(IO) digitalRead(IO)
  31. #define WRITE(IO, v) digitalWrite(IO,v)
  32. #define TOGGLE(IO) do{ _SET_OUTPUT(IO); digitalWrite(IO,!digitalRead(IO)); }while(0)
  33. #define WRITE_VAR(IO, v) digitalWrite(IO,v)
  34. #define _GET_MODE(IO)
  35. #define _SET_MODE(IO,M) pinMode(IO, M)
  36. #define _SET_OUTPUT(IO) pinMode(IO, OUTPUT) /*!< Output Push Pull Mode & GPIO_NOPULL */
  37. #define SET_INPUT(IO) _SET_MODE(IO, INPUT) /*!< Input Floating Mode */
  38. #define SET_INPUT_PULLUP(IO) _SET_MODE(IO, INPUT_PULLUP) /*!< Input with Pull-up activation */
  39. #define SET_INPUT_PULLDOW(IO) _SET_MODE(IO, INPUT_PULLDOWN) /*!< Input with Pull-down activation */
  40. #define SET_OUTPUT(IO) do{ _SET_OUTPUT(IO); WRITE(IO, LOW); }while(0)
  41. #define GET_INPUT(IO)
  42. #define GET_OUTPUT(IO)
  43. #define GET_TIMER(IO)
  44. #define OUT_WRITE(IO, v) { _SET_OUTPUT(IO); WRITE(IO, v); }
  45. #endif // _FASTIO_STM32F7_H