GPIO Pin Class. More...
Public Types | |
| enum | pin_fn_t { PIN_FN_IN = 0, PIN_FN_OUT, PIN_FN_A, PIN_FN_B, PIN_FN_C, PIN_FN_D } |
Public Member Functions | |
| PinIO () | |
| Construct an empty PinIO. Exists for bootstrap compatibility; not intended for general use. | |
| constexpr | PinIO (uint32_t port, uint32_t pin) |
| Construct a PinIO for a specific cpu pin. More... | |
| constexpr | PinIO (const PinIO &rhs) |
| Construct a copy of another PinIO. More... | |
| void | setFn (pin_fn_t fn) const |
| Set the pin function for the managed pin(s). More... | |
| void | function (pin_fn_t fn) const |
| Set the pin function for the managed pin(s). More... | |
| void | hiz () const |
| Configure the pin(s) to Input. | |
| void | drive () const |
| Configure the pin(s) to Output, without modifying the driven value. | |
| void | set () const |
| Drive the pin(s) High. | |
| void | clr () const |
| Drive the pin(s) Low. | |
| bool | tgl () const |
| Toggle the driven value for the pin(s). More... | |
| bool | toggle () const |
| Toggle the driven value for the pin(s). More... | |
| bool | readBack () const |
| Read the state of the pin(s) line state without changing the pin function or direction. More... | |
| bool | read () const |
| Configure the pin as an input then return the line state. More... | |
| bool | operator= (bool val) |
| Assign a driven value to the pin(s). More... | |
| PinIO & | operator= (const PinIO &rhs) |
| Assign a driven value to the pin(s) based on the line state of another pin(s). More... | |
| operator bool () const | |
| Read the line state of the pin(s). More... | |
| bool | operator! () const |
| Return the oposite of the driven value of the pin(s). More... | |
| void | multidrv (bool enable) const |
| Configure the multidrive/open-drain driver for the pin(s). More... | |
| void | setHighStrength (bool bHighDrive) |
| Configure the drive strength of the output driver for the pin(s). More... | |
| void | PullUp (bool enable) const |
| Configure the pad Pull Up resistor for the pin(s). More... | |
| void | PullDown (bool enable) const |
| Configure the pad Pull Down resistor for the pin(s). More... | |
| uint16_t | analogRead () const |
| Read an analog voltage on the given Pin. Only available for pins connected to the ADC. | |
Public Attributes | |
| volatile Pio & | pio |
| uint32_t | mask |
GPIO Pin Class.
| enum PinIO::pin_fn_t |
|
inline |
|
inline |
|
inline |
Set the pin function for the managed pin(s).
| fn | The pin function to be assigned to the managed pin(s). |
|
inline |
Configure the multidrive/open-drain driver for the pin(s).
| enable | True: configure the output driver as Open Drain. False: configure the output driver as Push-Pull. |
|
inline |
Read the line state of the pin(s).
|
inline |
Return the oposite of the driven value of the pin(s).
|
inline |
Assign a driven value to the pin(s).
| val | The value to be driven on the pin(s): true = High, false = Low |
Assign a driven value to the pin(s) based on the line state of another pin(s).
| rhs | The pin(s) who's line state will be assigned to this pin. |
|
inline |
Configure the pad Pull Down resistor for the pin(s).
| enable | True: enable the pad Pull Down. False: disable the pad Pull Down. |
|
inline |
Configure the pad Pull Up resistor for the pin(s).
| enable | True: enable the pad Pull Up. False: disable the pad Pull Up. |
|
inline |
Configure the pin as an input then return the line state.
|
inline |
Read the state of the pin(s) line state without changing the pin function or direction.
|
inline |
Set the pin function for the managed pin(s).
| fn | The pin function to be assigned to the managed pin(s). |
|
inline |
Configure the drive strength of the output driver for the pin(s).
| bHighDrive | True: configure the output driver for High Drive strength. False: configure the output driver for Low Drive strength. |
|
inline |
Toggle the driven value for the pin(s).
|
inline |
Toggle the driven value for the pin(s).