Skip to content

Commit 7d7243f

Browse files
committed
docs/machine.*: Use proper class case in method headers.
Class designator will be used as is in indexes, so must match actual class name.
1 parent 93968bd commit 7d7243f

File tree

8 files changed

+58
-58
lines changed

8 files changed

+58
-58
lines changed

docs/library/machine.ADC.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Constructors
3232
Methods
3333
-------
3434

35-
.. method:: adc.channel(id, \*, pin)
35+
.. method:: ADC.channel(id, \*, pin)
3636

3737
Create an analog pin. If only channel ID is given, the correct pin will
3838
be selected. Alternatively, only the pin can be passed and the correct
@@ -43,11 +43,11 @@ Methods
4343
apin = adc.channel(pin='GP3')
4444
apin = adc.channel(id=1, pin='GP3')
4545

46-
.. method:: adc.init()
46+
.. method:: ADC.init()
4747

4848
Enable the ADC block.
4949

50-
.. method:: adc.deinit()
50+
.. method:: ADC.deinit()
5151

5252
Disable the ADC block.
5353

docs/library/machine.I2C.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ General Methods
6262

6363
.. only:: port_wipy
6464

65-
.. method:: i2c.init(mode, \*, baudrate=100000, pins=(SDA, SCL))
65+
.. method:: I2C.init(mode, \*, baudrate=100000, pins=(SDA, SCL))
6666

6767
Initialise the I2C bus with the given parameters:
6868

@@ -72,21 +72,21 @@ General Methods
7272

7373
.. only:: port_esp8266
7474

75-
.. method:: i2c.init(scl, sda, \*, freq=400000)
75+
.. method:: I2C.init(scl, sda, \*, freq=400000)
7676

7777
Initialise the I2C bus with the given arguments:
7878

7979
- `scl` is a pin object for the SCL line
8080
- `sda` is a pin object for the SDA line
8181
- `freq` is the SCL clock rate
8282

83-
.. method:: i2c.deinit()
83+
.. method:: I2C.deinit()
8484

8585
Turn off the I2C bus.
8686

8787
Availability: WiPy.
8888

89-
.. method:: i2c.scan()
89+
.. method:: I2C.scan()
9090

9191
Scan all I2C addresses between 0x08 and 0x77 inclusive and return a list of
9292
those that respond. A device responds if it pulls the SDA line low after
@@ -101,19 +101,19 @@ The following methods implement the primitive I2C master bus operations and can
101101
be combined to make any I2C transaction. They are provided if you need more
102102
control over the bus, otherwise the standard methods (see below) can be used.
103103

104-
.. method:: i2c.start()
104+
.. method:: I2C.start()
105105

106106
Send a start bit on the bus (SDA transitions to low while SCL is high).
107107

108108
Availability: ESP8266.
109109

110-
.. method:: i2c.stop()
110+
.. method:: I2C.stop()
111111

112112
Send a stop bit on the bus (SDA transitions to high while SCL is high).
113113

114114
Availability: ESP8266.
115115

116-
.. method:: i2c.readinto(buf)
116+
.. method:: I2C.readinto(buf)
117117

118118
Reads bytes from the bus and stores them into `buf`. The number of bytes
119119
read is the length of `buf`. An ACK will be sent on the bus after
@@ -122,7 +122,7 @@ control over the bus, otherwise the standard methods (see below) can be used.
122122

123123
Availability: ESP8266.
124124

125-
.. method:: i2c.write(buf)
125+
.. method:: I2C.write(buf)
126126

127127
Write all the bytes from `buf` to the bus. Checks that an ACK is received
128128
after each byte and raises an OSError if not.
@@ -135,20 +135,20 @@ Standard bus operations
135135
The following methods implement the standard I2C master read and write
136136
operations that target a given slave device.
137137

138-
.. method:: i2c.readfrom(addr, nbytes)
138+
.. method:: I2C.readfrom(addr, nbytes)
139139

140140
Read `nbytes` from the slave specified by `addr`.
141141
Returns a `bytes` object with the data read.
142142

143-
.. method:: i2c.readfrom_into(addr, buf)
143+
.. method:: I2C.readfrom_into(addr, buf)
144144

145145
Read into `buf` from the slave specified by `addr`.
146146
The number of bytes read will be the length of `buf`.
147147

148148
On WiPy the return value is the number of bytes read. Otherwise the
149149
return value is `None`.
150150

151-
.. method:: i2c.writeto(addr, buf, \*, stop=True)
151+
.. method:: I2C.writeto(addr, buf, \*, stop=True)
152152

153153
Write the bytes from `buf` to the slave specified by `addr`.
154154

@@ -167,15 +167,15 @@ from and written to. In this case there are two addresses associated with an
167167
I2C transaction: the slave address and the memory address. The following
168168
methods are convenience functions to communicate with such devices.
169169

170-
.. method:: i2c.readfrom_mem(addr, memaddr, nbytes, \*, addrsize=8)
170+
.. method:: I2C.readfrom_mem(addr, memaddr, nbytes, \*, addrsize=8)
171171

172172
Read `nbytes` from the slave specified by `addr` starting from the memory
173173
address specified by `memaddr`.
174174
The argument `addrsize` specifies the address size in bits (on ESP8266
175175
this argument is not recognised and the address size is always 8 bits).
176176
Returns a `bytes` object with the data read.
177177

178-
.. method:: i2c.readfrom_mem_into(addr, memaddr, buf, \*, addrsize=8)
178+
.. method:: I2C.readfrom_mem_into(addr, memaddr, buf, \*, addrsize=8)
179179

180180
Read into `buf` from the slave specified by `addr` starting from the
181181
memory address specified by `memaddr`. The number of bytes read is the
@@ -186,7 +186,7 @@ methods are convenience functions to communicate with such devices.
186186
On WiPy the return value is the number of bytes read. Otherwise the
187187
return value is `None`.
188188

189-
.. method:: i2c.writeto_mem(addr, memaddr, buf, \*, addrsize=8)
189+
.. method:: I2C.writeto_mem(addr, memaddr, buf, \*, addrsize=8)
190190

191191
Write `buf` to the slave specified by `addr` starting from the
192192
memory address specified by `memaddr`.

docs/library/machine.Pin.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ Constructors
6161
.. class:: machine.Pin(id, ...)
6262

6363
Create a new Pin object associated with the id. If additional arguments are given,
64-
they are used to initialise the pin. See :meth:`pin.init`.
64+
they are used to initialise the pin. See :meth:`Pin.init`.
6565

6666
Methods
6767
-------
6868

6969
.. only:: port_wipy
7070

71-
.. method:: pin.init(mode, pull, \*, drive, alt)
71+
.. method:: Pin.init(mode, pull, \*, drive, alt)
7272

7373
Initialise the pin:
7474

@@ -98,13 +98,13 @@ Methods
9898

9999
Returns: ``None``.
100100

101-
.. method:: pin.id()
101+
.. method:: Pin.id()
102102

103103
Get the pin id.
104104

105105
.. only:: port_esp8266
106106

107-
.. method:: pin.init(mode, pull=None, \*, value)
107+
.. method:: Pin.init(mode, pull=None, \*, value)
108108

109109
Initialise the pin:
110110

@@ -121,7 +121,7 @@ Methods
121121
- if `value` is given then it is the output value to set the pin
122122
if it is in output mode.
123123

124-
.. method:: pin.value([value])
124+
.. method:: Pin.value([value])
125125

126126
Get or set the digital logic level of the pin:
127127

@@ -133,9 +133,9 @@ Methods
133133
.. method:: pin([value])
134134

135135
Pin objects are callable. The call method provides a (fast) shortcut to set and get the value of the pin.
136-
See :func:`pin.value` for more details.
136+
See :func:`Pin.value` for more details.
137137

138-
.. method:: pin.alt_list()
138+
.. method:: Pin.alt_list()
139139

140140
Returns a list of the alternate functions supported by the pin. List items are
141141
a tuple of the form: ``('ALT_FUN_NAME', ALT_FUN_INDEX)``
@@ -144,23 +144,23 @@ Methods
144144

145145
.. only:: port_wipy
146146

147-
.. method:: pin.toggle()
147+
.. method:: Pin.toggle()
148148

149149
Toggle the value of the pin.
150150

151-
.. method:: pin.mode([mode])
151+
.. method:: Pin.mode([mode])
152152

153153
Get or set the pin mode.
154154

155-
.. method:: pin.pull([pull])
155+
.. method:: Pin.pull([pull])
156156

157157
Get or set the pin pull.
158158

159-
.. method:: pin.drive([drive])
159+
.. method:: Pin.drive([drive])
160160

161161
Get or set the pin drive strength.
162162

163-
.. method:: pin.irq(\*, trigger, priority=1, handler=None, wake=None)
163+
.. method:: Pin.irq(\*, trigger, priority=1, handler=None, wake=None)
164164

165165
Create a callback to be triggered when the input level at the pin changes.
166166

@@ -194,7 +194,7 @@ Methods
194194

195195
.. only:: port_esp8266
196196

197-
.. method:: pin.irq(\*, trigger, handler=None)
197+
.. method:: Pin.irq(\*, trigger, handler=None)
198198

199199
Create a callback to be triggered when the input level at the pin changes.
200200

docs/library/machine.RTC.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,35 +24,35 @@ Constructors
2424
Methods
2525
-------
2626

27-
.. method:: rtc.init(datetime)
27+
.. method:: RTC.init(datetime)
2828

2929
Initialise the RTC. Datetime is a tuple of the form:
3030

3131
``(year, month, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]])``
3232

33-
.. method:: rtc.now()
33+
.. method:: RTC.now()
3434

3535
Get get the current datetime tuple.
3636

37-
.. method:: rtc.deinit()
37+
.. method:: RTC.deinit()
3838

3939
Resets the RTC to the time of January 1, 2015 and starts running it again.
4040

41-
.. method:: rtc.alarm(id, time, /*, repeat=False)
41+
.. method:: RTC.alarm(id, time, /*, repeat=False)
4242

4343
Set the RTC alarm. Time might be either a milllisecond value to program the alarm to
4444
current time + time_in_ms in the future, or a datetimetuple. If the time passed is in
4545
milliseconds, repeat can be set to ``True`` to make the alarm periodic.
4646

47-
.. method:: rtc.alarm_left(alarm_id=0)
47+
.. method:: RTC.alarm_left(alarm_id=0)
4848

4949
Get the number of milliseconds left before the alarm expires.
5050

51-
.. method:: rtc.cancel(alarm_id=0)
51+
.. method:: RTC.cancel(alarm_id=0)
5252

5353
Cancel a running alarm.
5454

55-
.. method:: rtc.irq(\*, trigger, handler=None, wake=machine.IDLE)
55+
.. method:: RTC.irq(\*, trigger, handler=None, wake=machine.IDLE)
5656

5757
Create an irq object triggered by a real time clock alarm.
5858

docs/library/machine.SD.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ Constructors
3232
Methods
3333
-------
3434

35-
.. method:: sd.init(id=0, pins=('GP10', 'GP11', 'GP15'))
35+
.. method:: SD.init(id=0, pins=('GP10', 'GP11', 'GP15'))
3636

3737
Enable the SD card. In order to initalize the card, give it a 3-tuple:
3838
``(clk_pin, cmd_pin, dat0_pin)``.
3939

40-
.. method:: sd.deinit()
40+
.. method:: SD.deinit()
4141

4242
Disable the SD card.

docs/library/machine.SPI.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Constructors
3535
Methods
3636
-------
3737

38-
.. method:: spi.init(mode, baudrate=1000000, \*, polarity=0, phase=0, bits=8, firstbit=SPI.MSB, pins=(CLK, MOSI, MISO))
38+
.. method:: SPI.init(mode, baudrate=1000000, \*, polarity=0, phase=0, bits=8, firstbit=SPI.MSB, pins=(CLK, MOSI, MISO))
3939

4040
Initialise the SPI bus with the given parameters:
4141

@@ -48,27 +48,27 @@ Methods
4848
- ``firstbit`` can be ``SPI.MSB`` only.
4949
- ``pins`` is an optional tupple with the pins to assign to the SPI bus.
5050

51-
.. method:: spi.deinit()
51+
.. method:: SPI.deinit()
5252

5353
Turn off the SPI bus.
5454

55-
.. method:: spi.write(buf)
55+
.. method:: SPI.write(buf)
5656

5757
Write the data contained in ``buf``.
5858
Returns the number of bytes written.
5959

60-
.. method:: spi.read(nbytes, *, write=0x00)
60+
.. method:: SPI.read(nbytes, *, write=0x00)
6161

6262
Read the ``nbytes`` while writing the data specified by ``write``.
6363
Return the number of bytes read.
6464

65-
.. method:: spi.readinto(buf, *, write=0x00)
65+
.. method:: SPI.readinto(buf, *, write=0x00)
6666

6767
Read into the buffer specified by ``buf`` while writing the data specified by
6868
``write``.
6969
Return the number of bytes read.
7070

71-
.. method:: spi.write_readinto(write_buf, read_buf)
71+
.. method:: SPI.write_readinto(write_buf, read_buf)
7272

7373
Write from ``write_buf`` and read into ``read_buf``. Both buffers must have the
7474
same length.

docs/library/machine.Timer.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Methods
7272

7373
.. only:: port_wipy
7474

75-
.. method:: timer.init(mode, \*, width=16)
75+
.. method:: Timer.init(mode, \*, width=16)
7676

7777
Initialise the timer. Example::
7878

@@ -93,14 +93,14 @@ Methods
9393
(or large periods), 32-bit timers should be used. 32-bit mode is only available
9494
for ``ONE_SHOT`` AND ``PERIODIC`` modes.
9595

96-
.. method:: timer.deinit()
96+
.. method:: Timer.deinit()
9797

9898
Deinitialises the timer. Disables all channels and associated IRQs.
9999
Stops the timer, and disables the timer peripheral.
100100

101101
.. only:: port_wipy
102102

103-
.. method:: timer.channel(channel, \**, freq, period, polarity=Timer.POSITIVE, duty_cycle=0)
103+
.. method:: Timer.channel(channel, \**, freq, period, polarity=Timer.POSITIVE, duty_cycle=0)
104104

105105
If only a channel identifier passed, then a previously initialized channel
106106
object is returned (or ``None`` if there is no previous channel).

0 commit comments

Comments
 (0)