#include "../HAL/shared/Marduino.h"
#include <avr/io.h>
#include <util/atomic.h>
Go to the source code of this file.
◆ FORCE_INLINE
Marlin 3D Printer Firmware Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
Based on Sprinter and grbl. Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
◆ nop
#define nop __asm__ volatile ("nop") |
◆ badPinNumber()
void badPinNumber |
( |
| ) |
const |
generate bad pin number error
◆ badPinCheck()
Check for valid pin number
- Parameters
-
[in] | pin | Number of pin to be checked. |
◆ fastBitWriteSafe()
Fast write helper
- Parameters
-
[in] | address | I/O register address |
[in] | bit | bit number to write |
[in] | level | value for bit |
◆ fastDigitalRead()
Read pin value
- Parameters
-
[in] | pin | Arduino pin number |
- Returns
- value read
509 return (*pinMap[pin].pin >> pinMap[pin].
bit) & 1;
◆ fastDigitalToggle()
Toggle a pin
- Parameters
-
[in] | pin | Arduino pin number |
If the pin is in output mode toggle the pin level. If the pin is in input mode toggle the state of the 20K pullup.
521 if (pinMap[pin].pin > (
uint8_t*)0x5F)
522 *pinMap[pin].pin =
_BV(pinMap[pin].
bit);
524 SBI(*pinMap[pin].pin, pinMap[pin].
bit);
◆ fastDigitalWrite()
Set pin value
- Parameters
-
[in] | pin | Arduino pin number |
[in] | level | value to write |
◆ fastPinMode()
Set pin mode
- Parameters
-
[in] | pin | Arduino pin number |
[in] | mode | if true set output mode else input mode |
fastPinMode does not enable or disable the 20K pullup for input mode.
◆ fastPinConfig()
Set pin configuration
- Parameters
-
[in] | pin | Arduino pin number |
[in] | mode | If true set output mode else input mode |
[in] | level | If mode is output, set level high/low. If mode is input, enable or disable the pin's 20K pullup. |
◆ digitalPinCount
◆ MISO_MODE
const bool MISO_MODE = false |
◆ MISO_LEVEL
const bool MISO_LEVEL = false |
◆ MOSI_MODE
const bool MOSI_MODE = true |
◆ SCK_MODE
const bool SCK_MODE = true |