You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/porting/target/target.md
+36-20Lines changed: 36 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -36,26 +36,42 @@ Add the target description to `mbed-os\targets\targets.json` using keys that the
36
36
37
37
### HAL porting
38
38
39
-
There are many more APIs to implement. You enable the following APIs by adding a `device_has` attribute to the MCU_NAME target definition in `targets.json` and providing an implementation of the API declared in the API header.
40
-
41
-
device_has | API header
42
-
-----------------|------------------
43
-
ANALOGIN | analog_in.h
44
-
ANALOGOUT | analog_out.h
45
-
CAN | can_api.h
46
-
EMAC | emac_api.h
47
-
INTERRUPTIN | gpio_irq_api.h
48
-
I2C I2CSLAVE | i2c_api.h
49
-
LPTICKER | lp_ticker_api.h
50
-
LPTICKER | lp_ticker_api.h
51
-
MPU | mpu_api.h
52
-
PORT_IN PORT_OUT | port_api.h
53
-
PWMOUT | pwmout_api.h
54
-
RTC | rtc_api.h
55
-
SLEEP | sleep_api.h
56
-
SPI SPISLAVE | spi_api.h
57
-
TRNG | trng_api.h
58
-
FLASH | flash_api.h
39
+
There are many more APIs to implement. You enable the following APIs by adding a `device_has` attribute to the MCU_NAME target definition in `targets.json` and providing an implementation of the API declared in the API header along with supplying a pinmap.
Pinmap information is added by creating a `PinMap` array which consists of a pin name, a peripheral and a function. The end of the pin map array is indicated by the presence of a NC pin. By convention a target's pinmap is defined in target specific file named PeripheralPins.c with a name matching that in the above table. An example of this for a UART TX pinmap is shown below:
64
+
65
+
```C
66
+
const PinMap PinMap_UART_TX[] = {
67
+
{P0_19, UART_0, 1},
68
+
{P1_13, UART_0, 3},
69
+
{P1_27, UART_0, 2},
70
+
{ NC , NC , 0}
71
+
};
72
+
```
73
+
74
+
Targets which don't make use of a pinmap, such as ones with peripherals that can be connected to any pin, must still define a pinmap as this is needed for testing. For these devices the pinmap does not need to be comprehensive. Instead it should list a representative sample of pins and peripherals so they can be tested appropriately.
0 commit comments