forked from Elron_dev/elbear_arduino_bsp
- добавлена поддержка платы ELBEAR ACE-NANO; - добавлена поддержка плат ELSOMIK OEM и SE; - добавлена возможность работы в режиме отладки для всех плат, входящих в состав пакета. Доступно для версии ArduinoIDE 2 и выше; - добавлена поддержка библиотеки FreeRTOS; - добавлена поддержка библиотеки IRremote; - добавлена поддержка библиотеки OneWire; - добавлена поддержка аппаратного I2C0 для плат START-MIK32 и ELSOMIK. Для работы с ним доступен экземпляр класса Wire1; - добавлена поддержка аппаратного SPI0 для всех плат, входящих в пакет. Для работы с ним доступен экземпляр класса SPI1; - увеличено быстродействие функций digitalWrite, digitalRead; - исправлены известные ошибки. Co-authored-by: KlassenTS <klassen@elron.tech> Co-committed-by: KlassenTS <klassen@elron.tech>
75 lines
2.2 KiB
C
75 lines
2.2 KiB
C
/*
|
|
Copyright (c) 2011 Arduino. All right reserved.
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU Lesser General Public
|
|
License as published by the Free Software Foundation; either
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
This library 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 Lesser General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
License along with this library; if not, write to the Free Software
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
*/
|
|
|
|
#ifndef _WIRING_DIGITAL_
|
|
#define _WIRING_DIGITAL_
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* \brief Configures the specified pin to behave either as an input or an output.
|
|
*
|
|
* \param PinNumber The number of the pin whose mode you wish to set
|
|
* \param PinMode Either INPUT, INPUT_PULLUP or OUTPUT
|
|
*/
|
|
void pinMode(uint32_t PinNumber, uint32_t PinMode);
|
|
|
|
/**
|
|
* \brief Configures the specified pin to behave either as an input or an output
|
|
* using quick macros and without calling checks
|
|
*
|
|
* \param PinNumber The number of the pin whose mode you wish to set
|
|
* \param PinMode Either INPUT, INPUT_PULLUP or OUTPUT
|
|
*/
|
|
void fastPinMode(uint32_t PinNumber, uint32_t PinMode);
|
|
|
|
/**
|
|
* \brief Write a HIGH or a LOW value to a digital pin.
|
|
*
|
|
* If the pin has been configured as an OUTPUT with pinMode(), its voltage will be set to the
|
|
* corresponding value: 3.3V for HIGH, 0V (ground) for LOW.
|
|
*
|
|
* \param PinNumber the pin number
|
|
* \param PinMode HIGH or LOW
|
|
*/
|
|
void digitalWrite(uint32_t PinNumber, uint32_t Val);
|
|
|
|
/**
|
|
* \brief Reads the value from a specified digital pin, either HIGH or LOW.
|
|
*
|
|
* \param PinNumber The number of the digital pin you want to read (int)
|
|
*
|
|
* \return HIGH or LOW
|
|
*/
|
|
int digitalRead(uint32_t PinNumber);
|
|
|
|
/**
|
|
* \brief Toggle the value from a specified digital pin.
|
|
*
|
|
* \param PinNumber The number of the digital pin you want to toggle (int)
|
|
*/
|
|
void digitalToggle(uint32_t PinNumber);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* _WIRING_DIGITAL_ */
|