Modification of mbed-src library only for STM32F030F4, very cheap microcontroller in 20-Pin TSSOP package, with 16Kbytes of Flash and 4Kbytes of Ram. **Target for online compilator must be Nucleo 32F030R8.**
Dependents: STM32F031_blink_LED_2
DigitalInOut Class Reference
A digital input/output, used for setting or reading a bi-directional pin. More...
#include <DigitalInOut.h>
Public Member Functions | |
DigitalInOut (PinName pin) | |
Create a DigitalInOut connected to the specified pin. | |
DigitalInOut (PinName pin, PinDirection direction, PinMode mode, int value) | |
Create a DigitalInOut connected to the specified pin. | |
void | write (int value) |
Set the output, specified as 0 or 1 (int) | |
int | read () |
Return the output setting, represented as 0 or 1 (int) | |
void | output () |
Set as an output. | |
void | input () |
Set as an input. | |
void | mode (PinMode pull) |
Set the input pin mode. | |
DigitalInOut & | operator= (int value) |
A shorthand for write() | |
operator int () | |
A shorthand for read() |
Detailed Description
A digital input/output, used for setting or reading a bi-directional pin.
Definition at line 27 of file DigitalInOut.h.
Constructor & Destructor Documentation
DigitalInOut | ( | PinName | pin ) |
Create a DigitalInOut connected to the specified pin.
- Parameters:
-
pin DigitalInOut pin to connect to
Definition at line 34 of file DigitalInOut.h.
DigitalInOut | ( | PinName | pin, |
PinDirection | direction, | ||
PinMode | mode, | ||
int | value | ||
) |
Create a DigitalInOut connected to the specified pin.
- Parameters:
-
pin DigitalInOut pin to connect to direction the initial direction of the pin mode the initial mode of the pin value the initial value of the pin if is an output
Definition at line 45 of file DigitalInOut.h.
Member Function Documentation
void input | ( | ) |
Set as an input.
Definition at line 76 of file DigitalInOut.h.
void mode | ( | PinMode | pull ) |
Set the input pin mode.
- Parameters:
-
mode PullUp, PullDown, PullNone, OpenDrain
Definition at line 84 of file DigitalInOut.h.
operator int | ( | ) |
A shorthand for read()
Definition at line 103 of file DigitalInOut.h.
DigitalInOut& operator= | ( | int | value ) |
A shorthand for write()
Definition at line 91 of file DigitalInOut.h.
void output | ( | ) |
Set as an output.
Definition at line 70 of file DigitalInOut.h.
int read | ( | ) |
Return the output setting, represented as 0 or 1 (int)
- Returns:
- an integer representing the output setting of the pin if it is an output, or read the input if set as an input
Definition at line 64 of file DigitalInOut.h.
void write | ( | int | value ) |
Set the output, specified as 0 or 1 (int)
- Parameters:
-
value An integer specifying the pin output value, 0 for logical 0, 1 (or any other non-zero value) for logical 1
Definition at line 54 of file DigitalInOut.h.
Generated on Tue Jul 12 2022 16:41:57 by 1.7.2