STM32 core 3.0.1-dev
Arduino core for STM32 based boards: API reference
← STM32duino documentation
Loading...
Searching...
No Matches
digital_io.h File Reference

Header for digital_io module. More...

#include "wiring.h"
#include "PinNames.h"
#include "pinmap.h"
#include "stm32yyxx_ll_gpio.h"

Functions

static void digital_io_write (GPIO_TypeDef *port, uint32_t pin, uint32_t val)
 Set a value to an IO.
 
static uint32_t digital_io_read (GPIO_TypeDef *port, uint32_t pin)
 Read the value of an IO.
 
static void digital_io_toggle (GPIO_TypeDef *port, uint32_t pin)
 Toggle the value of an IO.
 
static void digitalWriteFast (PinName pn, uint32_t ulVal)
 Set a value to an IO, without any pin configuration or check (fast version of digitalWrite()).
 
static PinStatus digitalReadFast (PinName pn)
 Read the value of an IO, without any pin configuration or check (fast version of digitalRead()).
 
static void digitalToggleFast (PinName pn)
 Toggle the value of an IO, without any pin configuration or check.
 

Detailed Description

Header for digital_io module.

Attention

© COPYRIGHT(c) 2016 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Function Documentation

◆ digital_io_read()

static uint32_t digital_io_read ( GPIO_TypeDef *  port,
uint32_t  pin 
)
inlinestatic

Read the value of an IO.

Parameters
portOne of the GPIO ports.
pinOne of the GPIO pins.
Returns
The pin state (LOW or HIGH).

◆ digital_io_toggle()

static void digital_io_toggle ( GPIO_TypeDef *  port,
uint32_t  pin 
)
inlinestatic

Toggle the value of an IO.

Parameters
portOne of the GPIO ports.
pinOne of the GPIO pins.

◆ digital_io_write()

static void digital_io_write ( GPIO_TypeDef *  port,
uint32_t  pin,
uint32_t  val 
)
inlinestatic

Set a value to an IO.

Parameters
portOne of the GPIO ports.
pinOne of the GPIO pins.
val0 to set to low, any other value to set to high.

◆ digitalReadFast()

static PinStatus digitalReadFast ( PinName  pn)
inlinestatic

Read the value of an IO, without any pin configuration or check (fast version of digitalRead()).

Parameters
pnPin name.
Returns
The pin state (LOW or HIGH).
Note
The pin must have been configured beforehand, e.g. with pinMode().

◆ digitalToggleFast()

static void digitalToggleFast ( PinName  pn)
inlinestatic

Toggle the value of an IO, without any pin configuration or check.

Parameters
pnPin name.
Note
The pin must have been configured as output beforehand, e.g. with pinMode().

◆ digitalWriteFast()

static void digitalWriteFast ( PinName  pn,
uint32_t  ulVal 
)
inlinestatic

Set a value to an IO, without any pin configuration or check (fast version of digitalWrite()).

Parameters
pnPin name.
ulVal0 to set to low, any other value to set to high.
Note
The pin must have been configured as output beforehand, e.g. with pinMode().