Skip to content

Commit ca62a4e

Browse files
committed
Address the review comments.
1 parent 359178b commit ca62a4e

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

docs/porting/target/static_pinmap.md

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,13 @@ Supported peripherals:
1818
 - `QSPI`
1919
 - `CAN`
2020

21-
### Requirements and assumptions
22-
23-
1. Provide types which will hold static pinmaps for peripherals(`PWM`, `AnalogIn`, `AnalogOut`, `SPI`, `I2C`, `UART`, `QSPI`, `CAN`).
24-
2. Provide `xxx_init_direct(xxx_t *obj, static_pinmap_t *)` functions to HAL API (these functions will not use pinmap tables).
25-
3. Provide additional constructors in drivers layer which will use the `xxx_init_direct(xxx_t *obj, static_pinmap_t*)` HAL functions.
26-
4. Provide default weak implementations of `xxx_init_direct(static_pinmap_t *)` functions. These functions will call standard `xxx_init(xxx_t *obj, PinName, ...)` function (backward compatibility for targets which do not support static pinmap mechanism).
27-
5. Provide `constexpr` utility functions to lookup for pin mapping in compile time (requires C++14).
28-
6. Provide `constexpr` pin-map tables in the header file.
29-
7. Provide macros for the pin-map tables.
30-
8. Provide `STATIC_PINMAP_READY` macro in `PinNames.h`.
31-
3221
### Implementing static pin-map extension
3322

34-
Most of the above points are already implemented. If you want to make static pinmap available on your platform please perform the following steps:  
23+
If you want to make static pinmap available on your platform please perform the following steps:  
3524

36-
- Provide implementation of `xxx_init_direct(xxx_t *obj, static_pinmap_t *)` function (which does not use pinmap tables).
37-
  - `xxx_init()` will use pinmap tables to determine associated peripheral/function with the given pins, populate the pin-map structure and call void `xxx_init_direct()`.
38-
  - `xxx_init_direct()` will perform peripheral initialization using given static pinmap structure.
25+
- Provide implementation of `xxx_init_direct(xxx_t *obj, static_pinmap_t *)` function and update implementation of `xxx_init()`.
26+
  - `xxx_init()` usees pinmap tables to determine associated peripheral/function with the given pins, populates the pin-map structure and calls void `xxx_init_direct()`.
27+
  - `xxx_init_direct()` performs peripheral initialization using given static pinmap structure.
3928

4029
Example implementation below:
4130

@@ -68,7 +57,7 @@ Move pinmap tables from `PeripheralPins.c` to `PeripheralPinMaps.h` (create new
6857
The tables are required in the header file, so can be included and used by constant expression utility functions to find and return mapping without pulling the pin-map table into the image.
6958

7059
**Note:**
71-
Please include `<mstd_cstddef>` module and use `MSTD_CONSTEXPR_OBJ_11` macro instead `constexpr` specifier. This must be done for backward compatibility with `ARM 5` compiler which does not support constant expressions. When `ARM 5` compiler is in use `MSTD_CONSTEXPR_OBJ_11` will be translated to `const`.  
60+
Please include `<mstd_cstddef>` module and use `MSTD_CONSTEXPR_OBJ_11` macro instead `constexpr` specifier. When `PeripheralPinMaps.h` is included from the Mbed OS C++ code, we need to see it as `constexpr`, but if the target code includes it from C, it has to have it as `const`.
7261

7362
Example pin-map table below:
7463

@@ -180,4 +169,3 @@ Run FPGA tests to check if your implementation is valid:
180169

181170
**Note:**
182171
Your target must be ready to run FPGA-Test-Shield tests.
183-
Currently the following peripherals can be tested: `Analogin`, `SPI`, `I2C`, `PWM`, `UART`.

0 commit comments

Comments
 (0)