diff options
author | Ryan <[email protected]> | 2023-10-13 17:25:32 +1100 |
---|---|---|
committer | GitHub <[email protected]> | 2023-10-13 17:25:32 +1100 |
commit | c157c19b81fbd8b516de0eb5e854d278669cff1a (patch) | |
tree | c2670f9b71cbe95154126018683345afe5890b2c /docs | |
parent | f150258e5ab6bf04c2e724389465f7a8ef5759ef (diff) | |
download | qmk_firmware-c157c19b81fbd8b516de0eb5e854d278669cff1a.tar.gz qmk_firmware-c157c19b81fbd8b516de0eb5e854d278669cff1a.zip |
Dedupe I2C, SPI, UART driver inclusions (#22253)
Diffstat (limited to 'docs')
-rw-r--r-- | docs/i2c_driver.md | 12 | ||||
-rw-r--r-- | docs/spi_driver.md | 12 | ||||
-rw-r--r-- | docs/uart_driver.md | 12 |
3 files changed, 36 insertions, 0 deletions
diff --git a/docs/i2c_driver.md b/docs/i2c_driver.md index 92b666b5e3..faff0a1d7b 100644 --- a/docs/i2c_driver.md +++ b/docs/i2c_driver.md @@ -2,6 +2,18 @@ The I2C Master drivers used in QMK have a set of common functions to allow portability between MCUs. +## Usage :id=usage + +In most cases, the I2C Master driver code is automatically included if you are using a feature or driver which requires it, such as [OLED](feature_oled_driver.md). + +However, if you need to use the driver standalone, add the following to your `rules.mk`: + +```make +I2C_DRIVER_REQUIRED = yes +``` + +You can then call the I2C API by including `i2c_master.h` in your code. + ## I2C Addressing :id=note-on-i2c-addresses All of the addresses expected by this driver should be pushed to the upper 7 bits of the address byte. Setting diff --git a/docs/spi_driver.md b/docs/spi_driver.md index 1faa9f0773..569a19f1db 100644 --- a/docs/spi_driver.md +++ b/docs/spi_driver.md @@ -2,6 +2,18 @@ The SPI Master drivers used in QMK have a set of common functions to allow portability between MCUs. +## Usage :id=usage + +In most cases, the SPI Master driver code is automatically included if you are using a feature or driver which requires it, such as [OLED](feature_oled_driver.md). + +However, if you need to use the driver standalone, add the following to your `rules.mk`: + +```make +SPI_DRIVER_REQUIRED = yes +``` + +You can then call the SPI API by including `spi_master.h` in your code. + ## AVR Configuration :id=avr-configuration No special setup is required - just connect the `SS`, `SCK`, `MOSI` and `MISO` pins of your SPI devices to the matching pins on the MCU: diff --git a/docs/uart_driver.md b/docs/uart_driver.md index a44f2c28d9..a88278d543 100644 --- a/docs/uart_driver.md +++ b/docs/uart_driver.md @@ -4,6 +4,18 @@ The UART drivers used in QMK have a set of common functions to allow portability Currently, this driver does not support enabling hardware flow control (the `RTS` and `CTS` pins) if available, but may do so in future. +## Usage :id=usage + +In most cases, the UART driver code is automatically included if you are using a feature or driver which requires it. + +However, if you need to use the driver standalone, add the following to your `rules.mk`: + +```make +UART_DRIVER_REQUIRED = yes +``` + +You can then call the UART API by including `uart.h` in your code. + ## AVR Configuration :id=avr-configuration No special setup is required - just connect the `RX` and `TX` pins of your UART device to the opposite pins on the MCU: |