summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-05-04 14:28:11 +0100
committerDamien George <damien.p.george@gmail.com>2014-05-04 14:28:11 +0100
commit5fc400ccdb17a7208fbf2d3ea93985d922b1a35d (patch)
treea4377d19c743c182d235711864bd14f631faf548
parentcda363a036f550707ed48d94e1be3ad54dda90b6 (diff)
downloadmicropython-5fc400ccdb17a7208fbf2d3ea93985d922b1a35d.tar.gz
micropython-5fc400ccdb17a7208fbf2d3ea93985d922b1a35d.zip
stmhal: Document physical pins for SPI, I2C, UART busses.
-rw-r--r--stmhal/i2c.c5
-rw-r--r--stmhal/spi.c8
-rw-r--r--stmhal/uart.c8
3 files changed, 21 insertions, 0 deletions
diff --git a/stmhal/i2c.c b/stmhal/i2c.c
index d3aca36d30..00501a57da 100644
--- a/stmhal/i2c.c
+++ b/stmhal/i2c.c
@@ -258,6 +258,11 @@ STATIC mp_obj_t pyb_i2c_init_helper(const pyb_i2c_obj_t *self, uint n_args, cons
/// initialised (it has the settings from the last initialisation of
/// the bus, if any). If extra arguments are given, the bus is initialised.
/// See `init` for parameters of initialisation.
+///
+/// The physical pins of the I2C busses are:
+///
+/// - `I2C(1)` is on the X position: `(SCL, SDA) = (X9, X10) = (PB6, PB7)`
+/// - `I2C(2)` is on the Y position: `(SCL, SDA) = (Y9, Y10) = (PB10, PB11)`
STATIC mp_obj_t pyb_i2c_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) {
// check arguments
mp_arg_check_num(n_args, n_kw, 1, MP_OBJ_FUN_ARGS_MAX, true);
diff --git a/stmhal/spi.c b/stmhal/spi.c
index 8da4e3d87d..10ecf7ec8e 100644
--- a/stmhal/spi.c
+++ b/stmhal/spi.c
@@ -301,6 +301,14 @@ STATIC mp_obj_t pyb_spi_init_helper(const pyb_spi_obj_t *self, uint n_args, cons
/// initialised (it has the settings from the last initialisation of
/// the bus, if any). If extra arguments are given, the bus is initialised.
/// See `init` for parameters of initialisation.
+///
+/// The physical pins of the SPI busses are:
+///
+/// - `SPI(1)` is on the X position: `(NSS, SCK, MISO, MOSI) = (X5, X6, X7, X8) = (PA4, PA5, PA6, PA7)`
+/// - `SPI(2)` is on the Y position: `(NSS, SCK, MISO, MOSI) = (Y5, Y6, Y7, Y8) = (PB12, PB13, PB14, PB15)`
+///
+/// At the moment, the NSS pin is not used by the SPI driver and is free
+/// for other use.
STATIC mp_obj_t pyb_spi_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) {
// check arguments
mp_arg_check_num(n_args, n_kw, 1, MP_OBJ_FUN_ARGS_MAX, true);
diff --git a/stmhal/uart.c b/stmhal/uart.c
index 8f263dbd81..5bbd9f299e 100644
--- a/stmhal/uart.c
+++ b/stmhal/uart.c
@@ -311,6 +311,14 @@ STATIC mp_obj_t pyb_uart_init_helper(pyb_uart_obj_t *self, uint n_args, const mp
/// initialised (it has the settings from the last initialisation of
/// the bus, if any). If extra arguments are given, the bus is initialised.
/// See `init` for parameters of initialisation.
+///
+/// The physical pins of the UART busses are:
+///
+/// - `UART(4)` is on `XA`: `(TX, RX) = (X1, X2) = (PA0, PA1)`
+/// - `UART(1)` is on `XB`: `(TX, RX) = (X9, X10) = (PB6, PB7)`
+/// - `UART(6)` is on `YA`: `(TX, RX) = (Y1, Y2) = (PC6, PC7)`
+/// - `UART(3)` is on `YB`: `(TX, RX) = (Y9, Y10) = (PB10, PB11)`
+/// - `UART(2)` is on: `(TX, RX) = (X3, X4) = (PA2, PA3)`
STATIC mp_obj_t pyb_uart_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) {
// check arguments
mp_arg_check_num(n_args, n_kw, 1, MP_OBJ_FUN_ARGS_MAX, true);