STM32 core 3.2.0-dev
Arduino core for STM32 based boards: API reference
← STM32duino documentation
Loading...
Searching...
No Matches
wiring_digital.c File Reference

Digital I/O functions: pinMode(), digitalWrite(), digitalRead() and digitalToggle(). More...

#include "Arduino.h"
#include "PinConfigured.h"

Functions

void pinMode (pin_size_t pinNumber, PinMode pinMode)
 Set the mode of a pin.
void digitalWrite (pin_size_t pinNumber, PinStatus status)
 Write a HIGH or LOW value to a digital pin.
PinStatus digitalRead (pin_size_t pinNumber)
 Read the value of a digital pin.
void digitalToggle (pin_size_t pinNumber)
 Toggle the value from a specified digital pin.

Variables

pin_size_t g_anOutputPinConfigured [MAX_NB_PORT]

Detailed Description

Digital I/O functions: pinMode(), digitalWrite(), digitalRead() and digitalToggle().

Function Documentation

◆ digitalRead()

PinStatus digitalRead ( pin_size_t pinNumber)

Read the value of a digital pin.

Parameters
pinNumberPin number, Dx or x.
Returns
HIGH or LOW. LOW if the pin is invalid.

◆ digitalToggle()

void digitalToggle ( pin_size_t pinNumber)

Toggle the value from a specified digital pin.

Parameters
pinNumberThe number of the digital pin you want to toggle.

◆ digitalWrite()

void digitalWrite ( pin_size_t pinNumber,
PinStatus status )

Write a HIGH or LOW value to a digital pin.

Parameters
pinNumberPin number, Dx or x.
statusHIGH or LOW.

◆ pinMode()

void pinMode ( pin_size_t pinNumber,
PinMode pinMode )

Set the mode of a pin.

If the pin was used for PWM or DAC output (analogWrite()), the output is stopped first. Any unsupported mode calls Error_Handler().

Parameters
pinNumberPin number, Dx or x.
pinModeINPUT, INPUT_PULLUP, INPUT_PULLDOWN, INPUT_ANALOG, OUTPUT or OUTPUT_OPEN_DRAIN.