Skip to content

Commit a58713a

Browse files
committed
docs: Cleanup and update some docs.
1 parent c7da783 commit a58713a

28 files changed

+202
-139
lines changed

docs/library/cmath.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
:mod:`cmath` --- mathematical functions for complex numbers
2-
===========================================================
1+
:mod:`cmath` -- mathematical functions for complex numbers
2+
==========================================================
33

44
.. module:: cmath
55
:synopsis: mathematical functions for complex numbers
66

77
The ``cmath`` module provides some basic mathematical funtions for
88
working with complex numbers.
99

10-
1110
Functions
1211
---------
1312

@@ -47,7 +46,6 @@ Functions
4746

4847
Return the square-root of ``z``.
4948

50-
5149
Constants
5250
---------
5351

docs/library/gc.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
:mod:`gc` --- control the garbage collector
2-
===========================================
1+
:mod:`gc` -- control the garbage collector
2+
==========================================
33

44
.. module:: gc
55
:synopsis: control the garbage collector

docs/library/math.rst

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,64 @@
1-
:mod:`math` --- mathematical functions
2-
======================================
1+
:mod:`math` -- mathematical functions
2+
=====================================
33

44
.. module:: math
55
:synopsis: mathematical functions
66

77
The ``math`` module provides some basic mathematical funtions for
88
working with floating-point numbers.
99

10+
*Note:* On the pyboard, floating-point numbers have 32-bit precision.
1011

1112
Functions
1213
---------
1314

1415
.. function:: acos(x)
1516

17+
Return the inverse cosine of ``x``.
1618

1719
.. function:: acosh(x)
1820

21+
Return the inverse hyperbolic cosine of ``x``.
1922

2023
.. function:: asin(x)
2124

25+
Return the inverse sine of ``x``.
2226

2327
.. function:: asinh(x)
2428

29+
Return the inverse hyperbolic sine of ``x``.
2530

2631
.. function:: atan(x)
2732

33+
Return the inverse tangent of ``x``.
2834

2935
.. function:: atan2(y, x)
3036

37+
Return the principal value of the inverse tangent of ``y/x``.
3138

3239
.. function:: atanh(x)
3340

41+
Return the inverse hyperbolic tangent of ``x``.
3442

3543
.. function:: ceil(x)
3644

45+
Return an integer, being ``x`` rounded towards positive infinity.
3746

3847
.. function:: copysign(x, y)
3948

49+
Return ``x`` with the sign of ``y``.
4050

4151
.. function:: cos(x)
4252

53+
Return the cosine of ``x``.
4354

4455
.. function:: cosh(x)
4556

57+
Return the hyperbolic cosine of ``x``.
4658

4759
.. function:: degrees(x)
4860

61+
Return radians ``x`` converted to degrees.
4962

5063
.. function:: erf(x)
5164

@@ -57,18 +70,23 @@ Functions
5770

5871
.. function:: exp(x)
5972

73+
Return the exponential of ``x``.
6074

6175
.. function:: expm1(x)
6276

77+
Return ``exp(x) - 1``.
6378

6479
.. function:: fabs(x)
6580

81+
Return the absolute value of ``x``.
6682

6783
.. function:: floor(x)
6884

85+
Return an integer, being ``x`` rounded towards negative infinity.
6986

7087
.. function:: fmod(x, y)
7188

89+
Return the remainder of ``x/y``.
7290

7391
.. function:: frexp(x)
7492

@@ -80,58 +98,72 @@ Functions
8098

8199
.. function:: isfinite(x)
82100

101+
Return ``True`` if ``x`` is finite.
83102

84103
.. function:: isinf(x)
85104

105+
Return ``True`` if ``x`` is infinite.
86106

87107
.. function:: isnan(x)
88108

109+
Return ``True`` if ``x`` is not-a-number
89110

90111
.. function:: ldexp(x, exp)
91112

113+
Return ``x * (2**exp)``.
92114

93115
.. function:: lgamma(x)
94116

95-
return the natural logarithm of the gamma function of ``x``.
117+
Return the natural logarithm of the gamma function of ``x``.
96118

97119
.. function:: log(x)
98120

121+
Return the natural logarithm of ``x``.
99122

100123
.. function:: log10(x)
101124

125+
Return the base-10 logarithm of ``x``.
102126

103127
.. function:: log2(x)
104128

129+
Return the base-2 logarithm of ``x``.
105130

106131
.. function:: modf(x)
107132

133+
Return a tuple of two floats, being the fractional and integral parts of
134+
``x``. Both return values have the same sign as ``x``.
108135

109136
.. function:: pow(x, y)
110137

111138
Returns ``x`` to the power of ``y``.
112139

113140
.. function:: radians(x)
114141

142+
Return degrees ``x`` converted to radians.
115143

116144
.. function:: sin(x)
117145

146+
Return the sine of ``x``.
118147

119148
.. function:: sinh(x)
120149

150+
Return the hyperbolic sine of ``x``.
121151

122152
.. function:: sqrt(x)
123153

124-
Returns the square root of ``x``.
154+
Return the square root of ``x``.
125155

126156
.. function:: tan(x)
127157

158+
Return the tangent of ``x``.
128159

129160
.. function:: tanh(x)
130161

162+
Return the hyperbolic tangent of ``x``.
131163

132164
.. function:: trunc(x)
133165

134-
166+
Return an integer, being ``x`` rounded towards 0.
135167

136168
Constants
137169
---------

docs/library/os.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
:mod:`os` --- basic "operating system" services
2-
===============================================
1+
:mod:`os` -- basic "operating system" services
2+
==============================================
33

44
.. module:: os
55
:synopsis: basic "operating system" services
66

77
The ``os`` module contains functions for filesystem access and ``urandom``.
88

9-
The filesystem has ``/`` as the root directory, and the available physical
10-
drives are accessible from here. They are currently:
9+
Pyboard specifics
10+
-----------------
1111

12-
/flash -- the internal flash filesystem
13-
/sd -- the SD card (if it exists)
12+
The filesystem on the pyboard has ``/`` as the root directory and the
13+
available physical drives are accessible from here. They are currently:
14+
15+
``/flash`` -- the internal flash filesystem
16+
17+
``/sd`` -- the SD card (if it exists)
1418

1519
On boot up, the current directory is ``/flash`` if no SD card is inserted,
1620
otherwise it is ``/sd``.
1721

18-
1922
Functions
2023
---------
2124

@@ -56,7 +59,6 @@ Functions
5659
Return a bytes object with n random bytes, generated by the hardware
5760
random number generator.
5861

59-
6062
Constants
6163
---------
6264

docs/library/pyb.ADC.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
class ADC =-- analog to digital conversion: read analog values on a pin
2-
=======================================================================
1+
class ADC -- analog to digital conversion: read analog values on a pin
2+
======================================================================
33

44
Usage::
55

docs/library/pyb.Accel.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
class Accel --- accelerometer control
2-
=====================================
1+
class Accel -- accelerometer control
2+
====================================
33

44
Accel is an object that controls the accelerometer. Example usage::
55

docs/library/pyb.CAN.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
class CAN --- controller area network communication bus
2-
=======================================================
1+
class CAN -- controller area network communication bus
2+
======================================================
33

44
CAN implements the standard CAN communications protocol. At
55
the physical level it consists of 2 lines: RX and TX. Note that

docs/library/pyb.DAC.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
class DAC --- digital to analog conversion
2-
==========================================
1+
class DAC -- digital to analog conversion
2+
=========================================
33

44
The DAC is used to output analog values (a specific voltage) on pin X5 or pin X6.
55
The voltage will be between 0 and 3.3V.

docs/library/pyb.ExtInt.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
class ExtInt --- configure I/O pins to interrupt on external events
2-
===================================================================
1+
class ExtInt -- configure I/O pins to interrupt on external events
2+
==================================================================
33

44
There are a total of 22 interrupt lines. 16 of these can come from GPIO pins
55
and the remaining 6 are from internal sources.

docs/library/pyb.I2C.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
class I2C --- a two-wire serial protocol
2-
========================================
1+
class I2C -- a two-wire serial protocol
2+
=======================================
33

44
I2C is a two-wire protocol for communicating between devices. At the physical
55
level it consists of 2 wires: SCL and SDA, the clock and data lines respectively.

0 commit comments

Comments
 (0)