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
DigitalOut Class Reference
A digital output, used for setting the state of a pin. More...
#include <DigitalOut.h>
Public Member Functions | |
| DigitalOut (PinName pin) | |
| Create a DigitalOut connected to the specified pin. | |
| DigitalOut (PinName pin, int value) | |
| Create a DigitalOut 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) | |
| DigitalOut & | operator= (int value) |
| A shorthand for write() | |
| operator int () | |
| A shorthand for read() | |
Detailed Description
A digital output, used for setting the state of a pin.
Example:
// Toggle a LED #include "mbed.h" DigitalOut led(LED1); int main() { while(1) { led = !led; wait(0.2); } }
Definition at line 41 of file DigitalOut.h.
Constructor & Destructor Documentation
| DigitalOut | ( | PinName | pin ) |
Create a DigitalOut connected to the specified pin.
- Parameters:
-
pin DigitalOut pin to connect to
Definition at line 48 of file DigitalOut.h.
| DigitalOut | ( | PinName | pin, |
| int | value | ||
| ) |
Create a DigitalOut connected to the specified pin.
- Parameters:
-
pin DigitalOut pin to connect to value the initial pin value
Definition at line 57 of file DigitalOut.h.
Member Function Documentation
| operator int | ( | ) |
A shorthand for read()
Definition at line 95 of file DigitalOut.h.
| DigitalOut& operator= | ( | int | value ) |
A shorthand for write()
Definition at line 83 of file DigitalOut.h.
| int read | ( | ) |
Return the output setting, represented as 0 or 1 (int)
- Returns:
- an integer representing the output setting of the pin, 0 for logical 0, 1 for logical 1
Definition at line 76 of file DigitalOut.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 66 of file DigitalOut.h.
Generated on Tue Jul 12 2022 16:41:57 by
1.7.2