mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-10-02 06:49:16 +02:00
add docusaurus, convert notes/tips, ids
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
# GPIO Control :id=gpio-control
|
||||
# GPIO Control {#gpio-control}
|
||||
|
||||
QMK has a GPIO control abstraction layer which is microcontroller agnostic. This is done to allow easy access to pin control across different platforms.
|
||||
|
||||
## Functions :id=functions
|
||||
## Functions {#functions}
|
||||
|
||||
The following functions provide basic control of GPIOs and are found in `platforms/<platform>/gpio.h`.
|
||||
|
||||
@@ -20,7 +20,7 @@ The following functions provide basic control of GPIOs and are found in `platfor
|
||||
| `readPin(pin)` | Returns the level of the pin | `_SFR_IO8(pin >> 4) & _BV(pin & 0xF)` | `palReadLine(pin)` |
|
||||
| `togglePin(pin)` | Invert pin level, assuming it is an output | `PORTB ^= (1<<2)` | `palToggleLine(pin)` |
|
||||
|
||||
## Advanced Settings :id=advanced-settings
|
||||
## Advanced Settings {#advanced-settings}
|
||||
|
||||
Each microcontroller can have multiple advanced settings regarding its GPIO. This abstraction layer does not limit the use of architecture-specific functions. Advanced users should consult the datasheet of their desired device and include any needed libraries. For AVR, the standard avr/io.h library is used; for STM32, the ChibiOS [PAL library](https://chibios.sourceforge.net/docs3/hal/group___p_a_l.html) is used.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user