From fb8eb59c11a3aa6ddc9f6574e2a4ae680b796a1c Mon Sep 17 00:00:00 2001 From: Wilfried Chauveau Date: Thu, 15 Nov 2018 12:23:19 +0000 Subject: [PATCH] fix types names. --- .../hal/0002-pinmap-extension.md | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/docs/design-documents/hal/0002-pinmap-extension.md b/docs/design-documents/hal/0002-pinmap-extension.md index eb06dd2284..2dad50443c 100644 --- a/docs/design-documents/hal/0002-pinmap-extension.md +++ b/docs/design-documents/hal/0002-pinmap-extension.md @@ -59,33 +59,43 @@ It is proposed to introduce the following elements : /// Returns a pin from ((whitelist ∩ map) − blacklist). /// Typically, whitelist will be the form factor list of pins. /// The blacklist may be a list of pins already visited and/or tied to another peripheral. - PinName pinmap_find_peripheral_pins(const PinMap *map, const PinList *whitelist, - const PinList *blacklist, int per); + PinName pinmap_find_peripheral_pins(const PinMap *map, const PinName *whitelist, + const PinName *blacklist, int per); /// Verifies that `pin` is in `list`. bool pinlist_has_pin(const PinName *list, PinName pin); /// Applies pinmap_find_peripheral_pins to each map in maps ensuring a pin will not be used twice. - bool pinmap_find_peripheral_bus(const PinMap const **maps, const PinList *whitelist, - const PinList *blacklist, int per, PinName *pins, uint32_t count); + /// @param[in] maps A list of pinmap. + /// @param[in] count Number of elements of maps and pins. + /// @param[in] whitelist An NC terminated list of pins. + /// @param[in] blacklist An NC terminated list of pins. + /// @param[in] per A peripheral name. + /// @param[out] pins An array of PinName where the result is stored. + bool pinmap_find_peripheral_bus(const PinMap const **maps, + uint32_t count, + const PinName *whitelist, + const PinName *blacklist, + uint32_t per, + PinName *pins); ``` - Additionally to these requirements any peripheral API must expose adequate functions to fetch an NC terminated list of pins associated to each of their their functions. These API extensions shall be gated with a `_PIN_EXTENTION` where `` is the name of the considered peripheral (`SPI`, `I2C`, `CAN` etc). For example the SPI api may be extended with : ```c #ifdef DEVICE_SPI_PIN_EXTENDED_SUPPORT - PinName *spi_get_mosi_pins(bool as_slave); - PinName *spi_get_miso_pins(bool as_slave); - PinName *spi_get_clk_pins(); - PinName *spi_get_cs_pins(); + PinMap *spi_get_mosi_pins(bool as_slave); + PinMap *spi_get_miso_pins(bool as_slave); + PinMap *spi_get_clk_pins(); + PinMap *spi_get_cs_pins(); #endif ``` and the I²C api with : ```c #ifdef DEVICE_I2C_PIN_EXTENDED_SUPPORT - PinName *i2c_get_scl_pins(); - PinName *i2c_get_sda_pins(); + PinMap *i2c_get_scl_pins(); + PinMap *i2c_get_sda_pins(); #endif ```