From c157c19b81fbd8b516de0eb5e854d278669cff1a Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 13 Oct 2023 17:25:32 +1100 Subject: Dedupe I2C, SPI, UART driver inclusions (#22253) --- docs/i2c_driver.md | 12 ++++++++++++ docs/spi_driver.md | 12 ++++++++++++ docs/uart_driver.md | 12 ++++++++++++ 3 files changed, 36 insertions(+) (limited to 'docs') 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: -- cgit v1.2.3