Skip to content

Commit 12edfc0

Browse files
authoredJun 24, 2023
Fix anchor IDs for some API references (qmk#21345)
1 parent 1e05bad commit 12edfc0

5 files changed

+133
-133
lines changed
 

‎docs/feature_hd44780.md

+42-42
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# HD44780 LCD Driver
1+
# HD44780 LCD Driver :id=hd44780-lcd-driver
22

3-
## Supported Hardware
3+
## Supported Hardware :id=supported-hardware
44

55
LCD modules using [HD44780U](https://www.sparkfun.com/datasheets/LCD/HD44780.pdf) IC or equivalent, communicating in 4-bit mode.
66

@@ -11,15 +11,15 @@ LCD modules using [HD44780U](https://www.sparkfun.com/datasheets/LCD/HD44780.pdf
1111

1212
To run these modules at 3.3V, an additional MAX660 voltage converter IC must be soldered on, along with two 10µF capacitors. See [this page](https://www.codrey.com/electronic-circuits/hack-your-16x2-lcd/) for more details.
1313

14-
## Usage
14+
## Usage :id=usage
1515

1616
Add the following to your `rules.mk`:
1717

1818
```make
1919
HD44780_ENABLE = yes
2020
```
2121

22-
## Basic Configuration
22+
## Basic Configuration :id=basic-configuration
2323

2424
Add the following to your `config.h`:
2525

@@ -33,9 +33,9 @@ Add the following to your `config.h`:
3333
|`HD44780_DISPLAY_LINES`|`2` |The number of visible lines on the display |
3434
|`HD44780_WRAP_LINES` |*Not defined* |If defined, input characters will wrap to the next line |
3535

36-
## Examples
36+
## Examples :id=examples
3737

38-
### Hello World
38+
### Hello World :id=example-hello-world
3939

4040
Add the following to your `keymap.c`:
4141

@@ -46,7 +46,7 @@ void keyboard_post_init_user(void) {
4646
}
4747
```
4848
49-
### Custom Character Definition
49+
### Custom Character Definition :id=example-custom-character
5050
5151
Up to eight custom characters can be defined. This data is stored in the Character Generator RAM (CGRAM), and is not persistent across power cycles.
5252
@@ -77,15 +77,15 @@ void keyboard_post_init_user(void) {
7777
}
7878
```
7979

80-
## API
80+
## API :id=api
8181

82-
### `void hd44780_init(bool cursor, bool blink)`
82+
### `void hd44780_init(bool cursor, bool blink)` :id=api-hd44780-init
8383

8484
Initialize the display.
8585

8686
This function should be called only once, before any of the other functions can be called.
8787

88-
#### Arguments
88+
#### Arguments :id=api-hd44780-init-arguments
8989

9090
- `bool cursor`
9191
Whether to show the cursor.
@@ -94,29 +94,29 @@ This function should be called only once, before any of the other functions can
9494

9595
---
9696

97-
### `void hd44780_clear(void)`
97+
### `void hd44780_clear(void)` :id=api-hd44780-clear
9898

9999
Clear the display.
100100

101101
This function is called on init.
102102

103103
---
104104

105-
### `void hd44780_home(void)`
105+
### `void hd44780_home(void)` :id=api-hd44780-home
106106

107107
Move the cursor to the home position.
108108

109109
This function is called on init.
110110

111111
---
112112

113-
### `void hd44780_on(bool cursor, bool blink)`
113+
### `void hd44780_on(bool cursor, bool blink)` :id=api-hd44780-on
114114

115115
Turn the display on, and/or set the cursor properties.
116116

117117
This function is called on init.
118118

119-
#### Arguments
119+
#### Arguments :id=api-hd44780-on-arguments
120120

121121
- `bool cursor`
122122
Whether to show the cursor.
@@ -125,17 +125,17 @@ This function is called on init.
125125

126126
---
127127

128-
### `void hd44780_off(void)`
128+
### `void hd44780_off(void)` :id=api-hd44780-off
129129

130130
Turn the display off.
131131

132132
---
133133

134-
### `void hd44780_set_cursor(uint8_t col, uint8_t line)`
134+
### `void hd44780_set_cursor(uint8_t col, uint8_t line)` :id=api-hd44780-set-cursor
135135

136136
Move the cursor to the specified position on the display.
137137

138-
#### Arguments
138+
#### Arguments :id=api-hd44780-set-cursor-arguments
139139

140140
- `uint8_t col`
141141
The column number to move to, from 0 to 15 on 16x2 displays.
@@ -144,48 +144,48 @@ Move the cursor to the specified position on the display.
144144

145145
---
146146

147-
### `void hd44780_putc(char c)`
147+
### `void hd44780_putc(char c)` :id=api-hd44780-putc
148148

149149
Print a character to the display. The newline character `\n` will move the cursor to the start of the next line.
150150

151151
The exact character shown may depend on the ROM code of your particular display - refer to the datasheet for the full character set.
152152

153-
#### Arguments
153+
#### Arguments :id=api-hd44780-putc-arguments
154154

155155
- `char c`
156156
The character to print.
157157

158158
---
159159

160-
### `void hd44780_puts(const char *s)`
160+
### `void hd44780_puts(const char *s)` :id=api-hd44780-puts
161161

162162
Print a string of characters to the display.
163163

164-
#### Arguments
164+
#### Arguments :id=api-hd44780-puts-arguments
165165

166166
- `const char *s`
167167
The string to print.
168168

169169
---
170170

171-
### `void hd44780_puts_P(const char *s)`
171+
### `void hd44780_puts_P(const char *s)` :id=api-hd44780-puts-p
172172

173173
Print a string of characters from PROGMEM to the display.
174174

175175
On ARM devices, this function is simply an alias of `hd44780_puts()`.
176176

177-
#### Arguments
177+
#### Arguments :id=api-hd44780-puts-p-arguments
178178

179179
- `const char *s`
180180
The PROGMEM string to print (ie. `PSTR("Hello")`).
181181

182182
---
183183

184-
### `void hd44780_define_char(uint8_t index, uint8_t *data)`
184+
### `void hd44780_define_char(uint8_t index, uint8_t *data)` :id=api-hd44780-define-char
185185

186186
Define a custom character.
187187

188-
#### Arguments
188+
#### Arguments :id=api-hd44780-define-char-arguments
189189

190190
- `uint8_t index`
191191
The index of the custom character to define, from 0 to 7.
@@ -194,13 +194,13 @@ Define a custom character.
194194

195195
---
196196

197-
### `void hd44780_define_char_P(uint8_t index, const uint8_t *data)`
197+
### `void hd44780_define_char_P(uint8_t index, const uint8_t *data)` :id=api-hd44780-define-char-p
198198

199199
Define a custom character from PROGMEM.
200200

201201
On ARM devices, this function is simply an alias of `hd44780_define_char()`.
202202

203-
#### Arguments
203+
#### Arguments :id=api-hd44780-define-char-p-arguments
204204

205205
- `uint8_t index`
206206
The index of the custom character to define, from 0 to 7.
@@ -209,21 +209,21 @@ On ARM devices, this function is simply an alias of `hd44780_define_char()`.
209209

210210
---
211211

212-
### `bool hd44780_busy(void)`
212+
### `bool hd44780_busy(void)` :id=api-hd44780-busy
213213

214214
Indicates whether the display is currently processing, and cannot accept instructions.
215215

216-
#### Return Value
216+
#### Return Value :id=api-hd44780-busy-arguments
217217

218218
`true` if the display is busy.
219219

220220
---
221221

222-
### `void hd44780_write(uint8_t data, bool isData)`
222+
### `void hd44780_write(uint8_t data, bool isData)` :id=api-hd44780-write
223223

224224
Write a byte to the display.
225225

226-
#### Arguments
226+
#### Arguments :id=api-hd44780-write-arguments
227227

228228
- `uint8_t data`
229229
The byte to send to the display.
@@ -232,67 +232,67 @@ Write a byte to the display.
232232

233233
---
234234

235-
### `uint8_t hd44780_read(bool isData)`
235+
### `uint8_t hd44780_read(bool isData)` :id=api-hd44780-read
236236

237237
Read a byte from the display.
238238

239-
#### Arguments
239+
#### Arguments :id=api-hd44780-read-arguments
240240

241241
- `bool isData`
242242
Whether to read the current cursor position, or the character at the cursor.
243243

244-
#### Return Value
244+
#### Return Value :id=api-hd44780-read-return
245245

246246
If `isData` is `true`, the returned byte will be the character at the current DDRAM address. Otherwise, it will be the current DDRAM address and the busy flag.
247247

248248
---
249249

250-
### `void hd44780_command(uint8_t command)`
250+
### `void hd44780_command(uint8_t command)` :id=api-hd44780-command
251251

252252
Send a command to the display. Refer to the datasheet and `hd44780.h` for the valid commands and defines.
253253

254254
This function waits for the display to clear the busy flag before sending the command.
255255

256-
#### Arguments
256+
#### Arguments :id=api-hd44780-command-arguments
257257

258258
- `uint8_t command`
259259
The command to send.
260260

261261
---
262262

263-
### `void hd44780_data(uint8_t data)`
263+
### `void hd44780_data(uint8_t data)` :id=api-hd44780-data
264264

265265
Send a byte of data to the display.
266266

267267
This function waits for the display to clear the busy flag before sending the data.
268268

269-
#### Arguments
269+
#### Arguments :id=api-hd44780-data-arguments
270270

271271
- `uint8_t data`
272272
The byte of data to send.
273273

274274
---
275275

276-
### `void hd44780_set_cgram_address(uint8_t address)`
276+
### `void hd44780_set_cgram_address(uint8_t address)` :id=api-hd44780-set-cgram-address
277277

278278
Set the CGRAM address.
279279

280280
This function is used when defining custom characters.
281281

282-
#### Arguments
282+
#### Arguments :id=api-hd44780-set-cgram-address-arguments
283283

284284
- `uint8_t address`
285285
The CGRAM address to move to, from `0x00` to `0x3F`.
286286

287287
---
288288

289-
### `void hd44780_set_ddram_address(uint8_t address)`
289+
### `void hd44780_set_ddram_address(uint8_t address)` :id=api-hd44780-set-ddram-address
290290

291291
Set the DDRAM address.
292292

293293
This function is used when printing characters to the display, and setting the cursor.
294294

295-
#### Arguments
295+
#### Arguments :id=api-hd44780-set-ddram-address-arguments
296296

297297
- `uint8_t address`
298298
The DDRAM address to move to, from `0x00` to `0x7F`.

‎docs/feature_send_string.md

+30-30
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
# Send String
1+
# Send String :id=send-string
22

33
The Send String API is part of QMK's macro system. It allows for sequences of keystrokes to be sent automatically.
44

55
The full ASCII character set is supported, along with all of the keycodes in the Basic Keycode range (as these are the only ones that will actually be sent to the host).
66

77
?> Unicode characters are **not** supported with this API -- see the [Unicode](feature_unicode.md) feature instead.
88

9-
## Usage
9+
## Usage :id=usage
1010

1111
Send String is enabled by default, so there is usually no need for any special setup. However, if it is disabled, add the following to your `rules.mk`:
1212

1313
```make
1414
SEND_STRING_ENABLE = yes
1515
```
1616

17-
## Basic Configuration
17+
## Basic Configuration :id=basic-configuration
1818

1919
Add the following to your `config.h`:
2020

@@ -23,7 +23,7 @@ Add the following to your `config.h`:
2323
|`SENDSTRING_BELL`|*Not defined* |If the [Audio](feature_audio.md) feature is enabled, the `\a` character (ASCII `BEL`) will beep the speaker.|
2424
|`BELL_SOUND` |`TERMINAL_SOUND`|The song to play when the `\a` character is encountered. By default, this is an eighth note of C5. |
2525

26-
## Keycodes
26+
## Keycodes :id=keycodes
2727

2828
The Send String functions accept C string literals, but specific keycodes can be injected with the below macros. All of the keycodes in the [Basic Keycode range](keycodes_basic.md) are supported (as these are the only ones that will actually be sent to the host), but with an `X_` prefix instead of `KC_`.
2929

@@ -44,13 +44,13 @@ The following characters are also mapped to their respective keycodes for conven
4444
|`\t` |`\x1B`|`TAB`|`KC_TAB` |
4545
| |`\x7F`|`DEL`|`KC_DELETE` |
4646

47-
### Language Support
47+
### Language Support :id=language-support
4848

4949
By default, Send String assumes your OS keyboard layout is set to US ANSI. If you are using a different keyboard layout, you can [override the lookup tables used to convert ASCII characters to keystrokes](reference_keymap_extras.md#sendstring-support).
5050

51-
## Examples
51+
## Examples :id=examples
5252

53-
### Hello World
53+
### Hello World :id=example-hello-world
5454

5555
A simple custom keycode which types out "Hello, world!" and the Enter key when pressed.
5656

@@ -70,7 +70,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
7070
}
7171
```
7272
73-
### Keycode Injection
73+
### Keycode Injection :id=example-keycode-injection
7474
7575
This example types out opening and closing curly braces, then taps the left arrow key to move the cursor between the two.
7676
@@ -84,26 +84,26 @@ This example types Ctrl+A, then Ctrl+C, without releasing Ctrl.
8484
SEND_STRING(SS_LCTL("ac"));
8585
```
8686
87-
## API
87+
## API :id=api
8888
89-
### `void send_string(const char *string)`
89+
### `void send_string(const char *string)` :id=api-send-string
9090
9191
Type out a string of ASCII characters.
9292
9393
This function simply calls `send_string_with_delay(string, 0)`.
9494
95-
#### Arguments
95+
#### Arguments :id=api-send-string-arguments
9696
9797
- `const char *string`
9898
The string to type out.
9999
100100
---
101101
102-
### `void send_string_with_delay(const char *string, uint8_t interval)`
102+
### `void send_string_with_delay(const char *string, uint8_t interval)` :id=api-send-string-with-delay
103103
104104
Type out a string of ASCII characters, with a delay between each character.
105105
106-
#### Arguments
106+
#### Arguments :id=api-send-string-with-delay-arguments
107107
108108
- `const char *string`
109109
The string to type out.
@@ -112,26 +112,26 @@ Type out a string of ASCII characters, with a delay between each character.
112112
113113
---
114114
115-
### `void send_string_P(const char *string)`
115+
### `void send_string_P(const char *string)` :id=api-send-string-p
116116
117117
Type out a PROGMEM string of ASCII characters.
118118
119119
On ARM devices, this function is simply an alias for `send_string_with_delay(string, 0)`.
120120
121-
#### Arguments
121+
#### Arguments :id=api-send-string-p-arguments
122122
123123
- `const char *string`
124124
The string to type out.
125125
126126
---
127127
128-
### `void send_string_with_delay_P(const char *string, uint8_t interval)`
128+
### `void send_string_with_delay_P(const char *string, uint8_t interval)` :id=api-send-string-with-delay-p
129129
130130
Type out a PROGMEM string of ASCII characters, with a delay between each character.
131131
132132
On ARM devices, this function is simply an alias for `send_string_with_delay(string, interval)`.
133133
134-
#### Arguments
134+
#### Arguments :id=api-send-string-with-delay-p-arguments
135135
136136
- `const char *string`
137137
The string to type out.
@@ -140,84 +140,84 @@ On ARM devices, this function is simply an alias for `send_string_with_delay(str
140140
141141
---
142142
143-
### `void send_char(char ascii_code)`
143+
### `void send_char(char ascii_code)` :id=api-send-char
144144
145145
Type out an ASCII character.
146146
147-
#### Arguments
147+
#### Arguments :id=api-send-char-arguments
148148
149149
- `char ascii_code`
150150
The character to type.
151151
152152
---
153153
154-
### `void send_dword(uint32_t number)`
154+
### `void send_dword(uint32_t number)` :id=api-send-dword
155155
156156
Type out an eight digit (unsigned 32-bit) hexadecimal value.
157157
158158
The format is `[0-9a-f]{8}`, eg. `00000000` through `ffffffff`.
159159
160-
#### Arguments
160+
#### Arguments :id=api-send-dword-arguments
161161
162162
- `uint32_t number`
163163
The value to type, from 0 to 4,294,967,295.
164164
165165
---
166166
167-
### `void send_word(uint16_t number)`
167+
### `void send_word(uint16_t number)` :id=api-send-word
168168
169169
Type out a four digit (unsigned 16-bit) hexadecimal value.
170170
171171
The format is `[0-9a-f]{4}`, eg. `0000` through `ffff`.
172172
173-
#### Arguments
173+
#### Arguments :id=api-send-word-arguments
174174
175175
- `uint16_t number`
176176
The value to type, from 0 to 65,535.
177177
178178
---
179179
180-
### `void send_byte(uint8_t number)`
180+
### `void send_byte(uint8_t number)` :id=api-send-bytes
181181
182182
Type out a two digit (8-bit) hexadecimal value.
183183
184184
The format is `[0-9a-f]{2}`, eg. `00` through `ff`.
185185
186-
#### Arguments
186+
#### Arguments :id=api-send-byte-arguments
187187
188188
- `uint8_t number`
189189
The value to type, from 0 to 255.
190190
191191
---
192192
193-
### `void send_nibble(uint8_t number)`
193+
### `void send_nibble(uint8_t number)` :id=api-send-nibble
194194
195195
Type out a single hexadecimal digit.
196196
197197
The format is `[0-9a-f]{1}`, eg. `0` through `f`.
198198
199-
#### Arguments
199+
#### Arguments :id=api-send-nibble-arguments
200200
201201
- `uint8_t number`
202202
The value to type, from 0 to 15.
203203
204204
---
205205
206-
### `void tap_random_base64(void)`
206+
### `void tap_random_base64(void)` :id=api-tap-random-base64
207207
208208
Type a pseudorandom character from the set `A-Z`, `a-z`, `0-9`, `+` and `/`.
209209
210210
---
211211
212-
### `SEND_STRING(string)`
212+
### `SEND_STRING(string)` :id=api-send-string-macro
213213
214214
Shortcut macro for `send_string_with_delay_P(PSTR(string), 0)`.
215215
216216
On ARM devices, this define evaluates to `send_string_with_delay(string, 0)`.
217217
218218
---
219219
220-
### `SEND_STRING_DELAY(string, interval)`
220+
### `SEND_STRING_DELAY(string, interval)` :id=api-send-string-delay-macro
221221
222222
Shortcut macro for `send_string_with_delay_P(PSTR(string), interval)`.
223223

‎docs/i2c_driver.md

+25-25
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Configuration-wise, you'll need to set up the peripheral as per your MCU's datas
7272
7373
The following configuration values depend on the specific MCU in use.
7474
75-
### I2Cv1 :id=i2cv1
75+
### I2Cv1 :id=arm-configuration-i2cv1
7676
7777
* STM32F1xx
7878
* STM32F2xx
@@ -88,7 +88,7 @@ See [this page](https://www.playembedded.org/blog/stm32-i2c-chibios/#7_I2Cv1_con
8888
|`I2C1_CLOCK_SPEED` |`100000` |
8989
|`I2C1_DUTY_CYCLE` |`STD_DUTY_CYCLE`|
9090
91-
### I2Cv2 :id=i2cv2
91+
### I2Cv2 :id=arm-configuration-i2cv2
9292
9393
* STM32F0xx
9494
* STM32F3xx
@@ -105,9 +105,9 @@ See [this page](https://www.playembedded.org/blog/stm32-i2c-chibios/#8_I2Cv2_I2C
105105
|`I2C1_TIMINGR_SCLH` |`38U` |
106106
|`I2C1_TIMINGR_SCLL` |`129U` |
107107
108-
## Functions :id=functions
108+
## API :id=api
109109
110-
### `void i2c_init(void)`
110+
### `void i2c_init(void)` :id=api-i2c-init
111111
112112
Initialize the I2C driver. This function must be called only once, before any of the below functions can be called.
113113
@@ -126,28 +126,28 @@ void i2c_init(void) {
126126

127127
---
128128

129-
### `i2c_status_t i2c_start(uint8_t address, uint16_t timeout)`
129+
### `i2c_status_t i2c_start(uint8_t address, uint16_t timeout)` :id=api-i2c-start
130130

131131
Start an I2C transaction.
132132

133-
#### Arguments
133+
#### Arguments :id=api-i2c-start-arguments
134134

135135
- `uint8_t address`
136136
The 7-bit I2C address of the device (ie. without the read/write bit - this will be set automatically).
137137
- `uint16_t timeout`
138138
The time in milliseconds to wait for a response from the target device.
139139

140-
#### Return Value
140+
#### Return Value :id=api-i2c-start-return
141141

142142
`I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`.
143143

144144
---
145145

146-
### `i2c_status_t i2c_transmit(uint8_t address, uint8_t *data, uint16_t length, uint16_t timeout)`
146+
### `i2c_status_t i2c_transmit(uint8_t address, uint8_t *data, uint16_t length, uint16_t timeout)` :id=api-i2c-transmit
147147

148148
Send multiple bytes to the selected I2C device.
149149

150-
#### Arguments
150+
#### Arguments :id=api-i2c-transmit-arguments
151151

152152
- `uint8_t address`
153153
The 7-bit I2C address of the device.
@@ -158,17 +158,17 @@ Send multiple bytes to the selected I2C device.
158158
- `uint16_t timeout`
159159
The time in milliseconds to wait for a response from the target device.
160160

161-
#### Return Value
161+
#### Return Value :id=api-i2c-transmit-return
162162

163163
`I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`.
164164

165165
---
166166

167-
### `i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)`
167+
### `i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)` :id=api-i2c-receive
168168

169169
Receive multiple bytes from the selected I2C device.
170170

171-
#### Arguments
171+
#### Arguments :id=api-i2c-receive-arguments
172172

173173
- `uint8_t address`
174174
The 7-bit I2C address of the device.
@@ -179,17 +179,17 @@ Receive multiple bytes from the selected I2C device.
179179
- `uint16_t timeout`
180180
The time in milliseconds to wait for a response from the target device.
181181

182-
#### Return Value
182+
#### Return Value :id=api-i2c-receive-return
183183

184184
`I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`.
185185

186186
---
187187

188-
### `i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)`
188+
### `i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)` :id=api-i2c-writereg
189189

190190
Writes to a register with an 8-bit address on the I2C device.
191191

192-
#### Arguments
192+
#### Arguments :id=api-i2c-writereg-arguments
193193

194194
- `uint8_t devaddr`
195195
The 7-bit I2C address of the device.
@@ -202,17 +202,17 @@ Writes to a register with an 8-bit address on the I2C device.
202202
- `uint16_t timeout`
203203
The time in milliseconds to wait for a response from the target device.
204204

205-
#### Return Value
205+
#### Return Value :id=api-i2c-writereg-return
206206

207207
`I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`.
208208

209209
---
210210

211-
### `i2c_status_t i2c_writeReg16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)`
211+
### `i2c_status_t i2c_writeReg16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)` :id=api-i2c-writereg16
212212

213213
Writes to a register with a 16-bit address (big endian) on the I2C device.
214214

215-
#### Arguments
215+
#### Arguments :id=api-i2c-writereg16-arguments
216216

217217
- `uint8_t devaddr`
218218
The 7-bit I2C address of the device.
@@ -225,17 +225,17 @@ Writes to a register with a 16-bit address (big endian) on the I2C device.
225225
- `uint16_t timeout`
226226
The time in milliseconds to wait for a response from the target device.
227227

228-
#### Return Value
228+
#### Return Value :id=api-i2c-writereg16-return
229229

230230
`I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`.
231231

232232
---
233233

234-
### `i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)`
234+
### `i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)` :id=api-i2c-readreg
235235

236236
Reads from a register with an 8-bit address on the I2C device.
237237

238-
#### Arguments
238+
#### Arguments :id=api-i2c-readreg-arguments
239239

240240
- `uint8_t devaddr`
241241
The 7-bit I2C address of the device.
@@ -246,7 +246,7 @@ Reads from a register with an 8-bit address on the I2C device.
246246
- `uint16_t timeout`
247247
The time in milliseconds to wait for a response from the target device.
248248

249-
#### Return Value
249+
#### Return Value :id=api-i2c-readreg-return
250250

251251
`I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`.
252252

@@ -256,7 +256,7 @@ Reads from a register with an 8-bit address on the I2C device.
256256

257257
Reads from a register with a 16-bit address (big endian) on the I2C device.
258258

259-
#### Arguments
259+
#### Arguments :id=api-i2c-readreg16-arguments
260260

261261
- `uint8_t devaddr`
262262
The 7-bit I2C address of the device.
@@ -267,12 +267,12 @@ Reads from a register with a 16-bit address (big endian) on the I2C device.
267267
- `uint16_t timeout`
268268
The time in milliseconds to wait for a response from the target device.
269269

270-
#### Return Value
270+
#### Return Value :id=api-i2c-readreg16-return
271271

272272
`I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`.
273273

274274
---
275275

276-
### `i2c_status_t i2c_stop(void)`
276+
### `i2c_status_t i2c_stop(void)` :id=api-i2c-stop
277277

278278
Stop the current I2C transaction.

‎docs/spi_driver.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# SPI Master Driver
1+
# SPI Master Driver :id=spi-master-driver
22

33
The SPI Master drivers used in QMK have a set of common functions to allow portability between MCUs.
44

5-
## AVR Configuration
5+
## AVR Configuration :id=avr-configuration
66

77
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:
88

@@ -16,7 +16,7 @@ No special setup is required - just connect the `SS`, `SCK`, `MOSI` and `MISO` p
1616
You may use more than one slave select pin, not just the `SS` pin. This is useful when you have multiple devices connected and need to communicate with them individually.
1717
`SPI_SS_PIN` can be passed to `spi_start()` to refer to `SS`.
1818

19-
## ChibiOS/ARM Configuration
19+
## ChibiOS/ARM Configuration :id=arm-configuration
2020

2121
You'll need to determine which pins can be used for SPI -- as an example, STM32 parts generally have multiple SPI peripherals, labeled SPI1, SPI2, SPI3 etc.
2222

@@ -49,19 +49,19 @@ Configuration-wise, you'll need to set up the peripheral as per your MCU's datas
4949

5050
As per the AVR configuration, you may choose any other standard GPIO as a slave select pin, which should be supplied to `spi_start()`.
5151

52-
## Functions
52+
## API :id=api
5353

54-
### `void spi_init(void)`
54+
### `void spi_init(void)` :id=api-spi-init
5555

5656
Initialize the SPI driver. This function must be called only once, before any of the below functions can be called.
5757

5858
---
5959

60-
### `bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor)`
60+
### `bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor)` :id=api-spi-start
6161

6262
Start an SPI transaction.
6363

64-
#### Arguments
64+
#### Arguments :id=api-spi-start-arguments
6565

6666
- `pin_t slavePin`
6767
The QMK pin to assert as the slave select pin, eg. `B4`.
@@ -80,71 +80,71 @@ Start an SPI transaction.
8080
- `uint16_t divisor`
8181
The SPI clock divisor, will be rounded up to the nearest power of two. This number can be calculated by dividing the MCU's clock speed by the desired SPI clock speed. For example, an MCU running at 8 MHz wanting to talk to an SPI device at 4 MHz would set the divisor to `2`.
8282

83-
#### Return Value
83+
#### Return Value :id=api-spi-start-return
8484

8585
`false` if the supplied parameters are invalid or the SPI peripheral is already in use, or `true`.
8686

8787
---
8888

89-
### `spi_status_t spi_write(uint8_t data)`
89+
### `spi_status_t spi_write(uint8_t data)` :id=api-spi-write
9090

9191
Write a byte to the selected SPI device.
9292

93-
#### Arguments
93+
#### Arguments :id=api-spi-write-arguments
9494

9595
- `uint8_t data`
9696
The byte to write.
9797

98-
#### Return Value
98+
#### Return Value :id=api-spi-write-return
9999

100100
`SPI_STATUS_TIMEOUT` if the timeout period elapses, or `SPI_STATUS_SUCCESS`.
101101

102102
---
103103

104-
### `spi_status_t spi_read(void)`
104+
### `spi_status_t spi_read(void)` :id=api-spi-read
105105

106106
Read a byte from the selected SPI device.
107107

108-
#### Return Value
108+
#### Return Value :id=api-spi-read-return
109109

110110
`SPI_STATUS_TIMEOUT` if the timeout period elapses, or the byte read from the device.
111111

112112
---
113113

114-
### `spi_status_t spi_transmit(const uint8_t *data, uint16_t length)`
114+
### `spi_status_t spi_transmit(const uint8_t *data, uint16_t length)` :id=api-spi-transmit
115115

116116
Send multiple bytes to the selected SPI device.
117117

118-
#### Arguments
118+
#### Arguments :id=api-spi-transmit-arguments
119119

120120
- `const uint8_t *data`
121121
A pointer to the data to write from.
122122
- `uint16_t length`
123123
The number of bytes to write. Take care not to overrun the length of `data`.
124124

125-
#### Return Value
125+
#### Return Value :id=api-spi-transmit-return
126126

127127
`SPI_STATUS_TIMEOUT` if the timeout period elapses, `SPI_STATUS_ERROR` if some other error occurs, otherwise `SPI_STATUS_SUCCESS`.
128128

129129
---
130130

131-
### `spi_status_t spi_receive(uint8_t *data, uint16_t length)`
131+
### `spi_status_t spi_receive(uint8_t *data, uint16_t length)` :id=api-spi-receive
132132

133133
Receive multiple bytes from the selected SPI device.
134134

135-
#### Arguments
135+
#### Arguments :id=api-spi-receive-arguments
136136

137137
- `uint8_t *data`
138138
A pointer to the buffer to read into.
139139
- `uint16_t length`
140140
The number of bytes to read. Take care not to overrun the length of `data`.
141141

142-
#### Return Value
142+
#### Return Value :id=api-spi-receive-return
143143

144144
`SPI_STATUS_TIMEOUT` if the timeout period elapses, `SPI_STATUS_ERROR` if some other error occurs, otherwise `SPI_STATUS_SUCCESS`.
145145

146146
---
147147

148-
### `void spi_stop(void)`
148+
### `void spi_stop(void)` :id=api-spi-stop
149149

150150
End the current SPI transaction. This will deassert the slave select pin and reset the endianness, mode and divisor configured by `spi_start()`.

‎docs/uart_driver.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# UART Driver
1+
# UART Driver :id=uart-driver
22

33
The UART drivers used in QMK have a set of common functions to allow portability between MCUs.
44

55
Currently, this driver does not support enabling hardware flow control (the `RTS` and `CTS` pins) if available, but may do so in future.
66

7-
## AVR Configuration
7+
## AVR Configuration :id=avr-configuration
88

99
No special setup is required - just connect the `RX` and `TX` pins of your UART device to the opposite pins on the MCU:
1010

@@ -16,7 +16,7 @@ No special setup is required - just connect the `RX` and `TX` pins of your UART
1616
|ATmega32A |`D1`|`D0`|*n/a*|*n/a*|
1717
|ATmega328/P |`D1`|`D0`|*n/a*|*n/a*|
1818

19-
## ChibiOS/ARM Configuration
19+
## ChibiOS/ARM Configuration :id=arm-configuration
2020

2121
You'll need to determine which pins can be used for UART -- as an example, STM32 parts generally have multiple UART peripherals, labeled USART1, USART2, USART3 etc.
2222

@@ -47,45 +47,45 @@ Configuration-wise, you'll need to set up the peripheral as per your MCU's datas
4747
|`#define SD1_RTS_PIN` |The pin to use for RTS |`A12` |
4848
|`#define SD1_RTS_PAL_MODE`|The alternate function mode for RTS |`7` |
4949

50-
## Functions
50+
## API :id=api
5151

52-
### `void uart_init(uint32_t baud)`
52+
### `void uart_init(uint32_t baud)` :id=api-uart-init
5353

5454
Initialize the UART driver. This function must be called only once, before any of the below functions can be called.
5555

56-
#### Arguments
56+
#### Arguments :id=api-uart-init-arguments
5757

5858
- `uint32_t baud`
5959
The baud rate to transmit and receive at. This may depend on the device you are communicating with. Common values are 1200, 2400, 4800, 9600, 19200, 38400, 57600, and 115200.
6060

6161
---
6262

63-
### `void uart_write(uint8_t data)`
63+
### `void uart_write(uint8_t data)` :id=api-uart-write
6464

6565
Transmit a single byte.
6666

67-
#### Arguments
67+
#### Arguments :id=api-uart-write-arguments
6868

6969
- `uint8_t data`
7070
The byte to write.
7171

7272
---
7373

74-
### `uint8_t uart_read(void)`
74+
### `uint8_t uart_read(void)` :id=api-uart-read
7575

7676
Receive a single byte.
7777

78-
#### Return Value
78+
#### Return Value :id=api-uart-read-return
7979

8080
The byte read from the receive buffer. This function will block if the buffer is empty (ie. no data to read).
8181

8282
---
8383

84-
### `void uart_transmit(const uint8_t *data, uint16_t length)`
84+
### `void uart_transmit(const uint8_t *data, uint16_t length)` :id=api-uart-transmit
8585

8686
Transmit multiple bytes.
8787

88-
#### Arguments
88+
#### Arguments :id=api-uart-transmit-arguments
8989

9090
- `const uint8_t *data`
9191
A pointer to the data to write from.
@@ -94,11 +94,11 @@ Transmit multiple bytes.
9494

9595
---
9696

97-
### `void uart_receive(char *data, uint16_t length)`
97+
### `void uart_receive(char *data, uint16_t length)` :id=api-uart-receive
9898

9999
Receive multiple bytes.
100100

101-
#### Arguments
101+
#### Arguments :id=api-uart-receive-arguments
102102

103103
- `uint8_t *data`
104104
A pointer to the buffer to read into.
@@ -107,10 +107,10 @@ Receive multiple bytes.
107107

108108
---
109109

110-
### `bool uart_available(void)`
110+
### `bool uart_available(void)` :id=api-uart-available
111111

112112
Return whether the receive buffer contains data. Call this function to determine if `uart_read()` will return data immediately.
113113

114-
#### Return Value
114+
#### Return Value :id=api-uart-available-return
115115

116116
`true` if the receive buffer length is non-zero.

0 commit comments

Comments
 (0)
Please sign in to comment.