Skip to content

Commit 852749c

Browse files
ithinuelc1728p9
authored andcommitted
update according to @bulislaw 's review
1 parent 860e536 commit 852749c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

docs/design-documents/hal/0002-pinmap-extension.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
## Description
1414

15-
This update aims at increasing tests thoroughness by enabling them to check driver's reliability for each pin declared as supporting a peripheral.
15+
Adds board introspection capabilities and tools.
16+
These tools will help designing better tests for the HAL.
1617

1718
## Motivation
1819

@@ -24,7 +25,7 @@ At the time being, drivers are only tested on a single "default" peripheral. How
2425
2. We want to list all functions a pin can provide.
2526
3. We want to list all pins for a form-factor regardless of the function they can provide.
2627
4. We want a printable name for each pin and a method to get that name.
27-
5. We want a list the reserved pins that cannot be tested.
28+
5. We want a list of the reserved pins that cannot be tested.
2829
6. We want to select a duplicate-free set a pin from a set of PinMap.
2930

3031
Any of the list mentioned above may be empty if none match the criteria.
@@ -44,7 +45,7 @@ It is proposed to introduce the following elements :
4445
PINMAP_FORM_FACTOR_MTB,
4546
} pinmap_form_factor_t;
4647

47-
/// returns a static NC terminated array of pins.
48+
/// returns a static NC terminated array of pins (or NULL if unsupported).
4849
const PinName *pinmap_form_factor_pins(pinmap_form_factor_t form_factor);
4950
/// returns a static NC terminated array of pins.
5051
const PinName *pinmap_restricted_pins();
@@ -60,7 +61,7 @@ It is proposed to introduce the following elements :
6061
/// Typically, whitelist will be the form factor list of pins.
6162
/// The blacklist may be a list of pins already visited and/or tied to another peripheral.
6263
PinName pinmap_find_peripheral_pin(const PinMap *map, const PinName *whitelist,
63-
const PinName *blacklist, int per);
64+
const PinName *blacklist, int per);
6465
6566
/// Verifies that `pin` is in `list`.
6667
bool pinlist_has_pin(const PinName *list, PinName pin);
@@ -84,8 +85,8 @@ It is proposed to introduce the following elements :
8485
For example the SPI api may be extended with :
8586
```c
8687
#ifdef DEVICE_SPI_PIN_EXTENDED_SUPPORT
87-
PinMap *spi_get_mosi_pins(bool as_slave);
88-
PinMap *spi_get_miso_pins(bool as_slave);
88+
PinMap *spi_get_mosi_pins(bool as_slave, bool is_half_duplex);
89+
PinMap *spi_get_miso_pins(bool as_slave, bool is_half_duplex);
8990
PinMap *spi_get_clk_pins();
9091
PinMap *spi_get_cs_pins();
9192
#endif

0 commit comments

Comments
 (0)