Skip to content

Commit 7c0e1f1

Browse files
committed
docs/machine*: Use markup adhering to the latest docs conventions.
1 parent cfce7d7 commit 7c0e1f1

3 files changed

Lines changed: 50 additions & 50 deletions

File tree

docs/library/machine.I2C.rst

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ Constructors
3737

3838
Construct and return a new I2C object using the following parameters:
3939

40-
- `id` identifies the particular I2C peripheral. The default
40+
- *id* identifies a particular I2C peripheral. The default
4141
value of -1 selects a software implementation of I2C which can
4242
work (in most cases) with arbitrary pins for SCL and SDA.
43-
If `id` is -1 then `scl` and `sda` must be specified. Other
44-
allowed values for `id` depend on the particular port/board,
45-
and specifying `scl` and `sda` may or may not be required or
43+
If *id* is -1 then *scl* and *sda* must be specified. Other
44+
allowed values for *id* depend on the particular port/board,
45+
and specifying *scl* and *sda* may or may not be required or
4646
allowed in this case.
47-
- `scl` should be a pin object specifying the pin to use for SCL.
48-
- `sda` should be a pin object specifying the pin to use for SDA.
49-
- `freq` should be an integer which sets the maximum frequency
47+
- *scl* should be a pin object specifying the pin to use for SCL.
48+
- *sda* should be a pin object specifying the pin to use for SDA.
49+
- *freq* should be an integer which sets the maximum frequency
5050
for SCL.
5151

5252
General Methods
@@ -56,9 +56,9 @@ General Methods
5656

5757
Initialise the I2C bus with the given arguments:
5858

59-
- `scl` is a pin object for the SCL line
60-
- `sda` is a pin object for the SDA line
61-
- `freq` is the SCL clock rate
59+
- *scl* is a pin object for the SCL line
60+
- *sda* is a pin object for the SDA line
61+
- *freq* is the SCL clock rate
6262

6363
.. method:: I2C.deinit()
6464

@@ -93,17 +93,17 @@ control over the bus, otherwise the standard methods (see below) can be used.
9393

9494
.. method:: I2C.readinto(buf, nack=True)
9595

96-
Reads bytes from the bus and stores them into `buf`. The number of bytes
97-
read is the length of `buf`. An ACK will be sent on the bus after
98-
receiving all but the last byte. After the last byte is received, if `nack`
96+
Reads bytes from the bus and stores them into *buf*. The number of bytes
97+
read is the length of *buf*. An ACK will be sent on the bus after
98+
receiving all but the last byte. After the last byte is received, if *nack*
9999
is true then a NACK will be sent, otherwise an ACK will be sent (and in this
100100
case the slave assumes more bytes are going to be read in a later call).
101101

102102
Availability: ESP8266.
103103

104104
.. method:: I2C.write(buf)
105105

106-
Write the bytes from `buf` to the bus. Checks that an ACK is received
106+
Write the bytes from *buf* to the bus. Checks that an ACK is received
107107
after each byte and stops transmitting the remaining bytes if a NACK is
108108
received. The function returns the number of ACKs that were received.
109109

@@ -117,23 +117,23 @@ operations that target a given slave device.
117117

118118
.. method:: I2C.readfrom(addr, nbytes, stop=True)
119119

120-
Read `nbytes` from the slave specified by `addr`.
121-
If `stop` is true then a STOP condition is generated at the end of the transfer.
120+
Read *nbytes* from the slave specified by *addr*.
121+
If *stop* is true then a STOP condition is generated at the end of the transfer.
122122
Returns a `bytes` object with the data read.
123123

124124
.. method:: I2C.readfrom_into(addr, buf, stop=True)
125125

126-
Read into `buf` from the slave specified by `addr`.
127-
The number of bytes read will be the length of `buf`.
128-
If `stop` is true then a STOP condition is generated at the end of the transfer.
126+
Read into *buf* from the slave specified by *addr*.
127+
The number of bytes read will be the length of *buf*.
128+
If *stop* is true then a STOP condition is generated at the end of the transfer.
129129

130-
The method returns `None`.
130+
The method returns ``None``.
131131

132132
.. method:: I2C.writeto(addr, buf, stop=True)
133133

134-
Write the bytes from `buf` to the slave specified by `addr`. If a
135-
NACK is received following the write of a byte from `buf` then the
136-
remaining bytes are not sent. If `stop` is true then a STOP condition is
134+
Write the bytes from *buf* to the slave specified by *addr*. If a
135+
NACK is received following the write of a byte from *buf* then the
136+
remaining bytes are not sent. If *stop* is true then a STOP condition is
137137
generated at the end of the transfer, even if a NACK is received.
138138
The function returns the number of ACKs that were received.
139139

@@ -147,26 +147,26 @@ methods are convenience functions to communicate with such devices.
147147

148148
.. method:: I2C.readfrom_mem(addr, memaddr, nbytes, \*, addrsize=8)
149149

150-
Read `nbytes` from the slave specified by `addr` starting from the memory
151-
address specified by `memaddr`.
152-
The argument `addrsize` specifies the address size in bits.
150+
Read *nbytes* from the slave specified by *addr* starting from the memory
151+
address specified by *memaddr*.
152+
The argument *addrsize* specifies the address size in bits.
153153
Returns a `bytes` object with the data read.
154154

155155
.. method:: I2C.readfrom_mem_into(addr, memaddr, buf, \*, addrsize=8)
156156

157-
Read into `buf` from the slave specified by `addr` starting from the
158-
memory address specified by `memaddr`. The number of bytes read is the
159-
length of `buf`.
160-
The argument `addrsize` specifies the address size in bits (on ESP8266
157+
Read into *buf* from the slave specified by *addr* starting from the
158+
memory address specified by *memaddr*. The number of bytes read is the
159+
length of *buf*.
160+
The argument *addrsize* specifies the address size in bits (on ESP8266
161161
this argument is not recognised and the address size is always 8 bits).
162162

163-
The method returns `None`.
163+
The method returns ``None``.
164164

165165
.. method:: I2C.writeto_mem(addr, memaddr, buf, \*, addrsize=8)
166166

167-
Write `buf` to the slave specified by `addr` starting from the
168-
memory address specified by `memaddr`.
169-
The argument `addrsize` specifies the address size in bits (on ESP8266
167+
Write *buf* to the slave specified by *addr* starting from the
168+
memory address specified by *memaddr*.
169+
The argument *addrsize* specifies the address size in bits (on ESP8266
170170
this argument is not recognised and the address size is always 8 bits).
171171

172-
The method returns `None`.
172+
The method returns ``None``.

docs/library/machine.UART.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ UART objects can be created and initialised using::
1818

1919
Supported parameters differ on a board:
2020

21-
Pyboard: Bits can be 7, 8 or 9. Stop can be 1 or 2. With `parity=None`,
21+
Pyboard: Bits can be 7, 8 or 9. Stop can be 1 or 2. With *parity=None*,
2222
only 8 and 9 bits are supported. With parity enabled, only 7 and 8 bits
2323
are supported.
2424

docs/library/machine.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ damage.
1313

1414
.. _machine_callbacks:
1515

16-
A note of callbacks used by functions and class methods of ``machine`` module:
16+
A note of callbacks used by functions and class methods of :mod:`machine` module:
1717
all these callbacks should be considered as executing in an interrupt context.
1818
This is true for both physical devices with IDs >= 0 and "virtual" devices
1919
with negative IDs like -1 (these "virtual" devices are still thin shims on
@@ -38,14 +38,14 @@ Interrupt related functions
3838

3939
Disable interrupt requests.
4040
Returns the previous IRQ state which should be considered an opaque value.
41-
This return value should be passed to the ``enable_irq`` function to restore
42-
interrupts to their original state, before ``disable_irq`` was called.
41+
This return value should be passed to the `enable_irq()` function to restore
42+
interrupts to their original state, before `disable_irq()` was called.
4343

4444
.. function:: enable_irq(state)
4545

4646
Re-enable interrupt requests.
47-
The ``state`` parameter should be the value that was returned from the most
48-
recent call to the ``disable_irq`` function.
47+
The *state* parameter should be the value that was returned from the most
48+
recent call to the `disable_irq()` function.
4949

5050
Power related functions
5151
-----------------------
@@ -71,8 +71,8 @@ Power related functions
7171

7272
Stops the CPU and all peripherals (including networking interfaces, if any). Execution
7373
is resumed from the main script, just as with a reset. The reset cause can be checked
74-
to know that we are coming from ``machine.DEEPSLEEP``. For wake up to actually happen,
75-
wake sources should be configured first, like ``Pin`` change or ``RTC`` timeout.
74+
to know that we are coming from `machine.DEEPSLEEP`. For wake up to actually happen,
75+
wake sources should be configured first, like `Pin` change or `RTC` timeout.
7676

7777
.. only:: port_wipy
7878

@@ -98,18 +98,18 @@ Miscellaneous functions
9898

9999
.. function:: time_pulse_us(pin, pulse_level, timeout_us=1000000)
100100

101-
Time a pulse on the given `pin`, and return the duration of the pulse in
102-
microseconds. The `pulse_level` argument should be 0 to time a low pulse
101+
Time a pulse on the given *pin*, and return the duration of the pulse in
102+
microseconds. The *pulse_level* argument should be 0 to time a low pulse
103103
or 1 to time a high pulse.
104104

105-
If the current input value of the pin is different to `pulse_level`,
106-
the function first (*) waits until the pin input becomes equal to `pulse_level`,
107-
then (**) times the duration that the pin is equal to `pulse_level`.
108-
If the pin is already equal to `pulse_level` then timing starts straight away.
105+
If the current input value of the pin is different to *pulse_level*,
106+
the function first (*) waits until the pin input becomes equal to *pulse_level*,
107+
then (**) times the duration that the pin is equal to *pulse_level*.
108+
If the pin is already equal to *pulse_level* then timing starts straight away.
109109

110110
The function will return -2 if there was timeout waiting for condition marked
111111
(*) above, and -1 if there was timeout during the main measurement, marked (**)
112-
above. The timeout is the same for both cases and given by `timeout_us` (which
112+
above. The timeout is the same for both cases and given by *timeout_us* (which
113113
is in microseconds).
114114

115115
.. _machine_constants:

0 commit comments

Comments
 (0)