17#ifndef MBED_DIGITALIN_H
18#define MBED_DIGITALIN_H
20#include "platform/platform.h"
22#include "interfaces/InterfaceDigitalIn.h"
23#include "hal/gpio_api.h"
57#ifdef FEATURE_EXPERIMENTAL_API
135#if !defined(DOXYGEN_ONLY)
A digital input, used for reading the state of a pin.
void mode(PinMode pull)
Set the input pin mode.
~DigitalIn()
Class destructor, deinitialize the pin.
DigitalIn(PinName pin)
Create a DigitalIn connected to the specified pin.
DigitalIn(PinName pin, PinMode mode)
Create a DigitalIn connected to the specified pin.
int read()
Read the input, represented as 0 or 1 (int)
int is_connected()
Return the output setting, represented as 0 or 1 (int)
void gpio_free(gpio_t *obj)
Releases the GPIO pin.
void gpio_init_in(gpio_t *gpio, PinName pin)
Init the input pin and set mode to PullDefault.
int gpio_is_connected(const gpio_t *obj)
Checks if gpio object is connected (pin was not initialized with NC)
int gpio_read(gpio_t *obj)
Read the input value.
void gpio_init_in_ex(gpio_t *gpio, PinName pin, PinMode mode)
Init the input pin and set the mode.