A metronome using the FRDM K64F board

Committer:
ram54288
Date:
Sun May 14 18:40:18 2017 +0000
Revision:
0:a7a43371b306
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ram54288 0:a7a43371b306 1 ## PAL porting guide
ram54288 0:a7a43371b306 2
ram54288 0:a7a43371b306 3 This document describes the process of PAL porting to different operating systems. During the process, you need to work
ram54288 0:a7a43371b306 4 with the [**Port**](https://github.com/ARMmbed/mbed-client-pal/tree/master/Source/Port) folder that contains two sub-folders: *[Platform-API](https://github.com/ARMmbed/pal/tree/master/Source/Port/Platform-API)* and *[Reference-Impl](https://github.com/ARMmbed/pal/tree/master/Source/Port/Reference-Impl)*.
ram54288 0:a7a43371b306 5
ram54288 0:a7a43371b306 6 ### Platform-API
ram54288 0:a7a43371b306 7
ram54288 0:a7a43371b306 8 The *[Platform-API](https://github.com/ARMmbed/pal/tree/master/Source/Port/Platform-API)* folder contains the header files declaring the interfaces that MUST be implemented by the platform. The APIs are documented in the header files and the Doxygen documentation with the same content is also available.
ram54288 0:a7a43371b306 9 The documentation declares the input/output parameters, return values and the eventual special return values.
ram54288 0:a7a43371b306 10 The header file names are related to the PAL modules they are declaring. For example:
ram54288 0:a7a43371b306 11
ram54288 0:a7a43371b306 12 ```
ram54288 0:a7a43371b306 13 pal_plat_rtos.h --> presents the RealTime OS APIs required by the
ram54288 0:a7a43371b306 14 services and Must be implemented by platform.
ram54288 0:a7a43371b306 15 ```
ram54288 0:a7a43371b306 16
ram54288 0:a7a43371b306 17 <span class="notes">The APIs are called directly from the *Service* implementation layer. Therefore, you MUST NOT change them.</span>
ram54288 0:a7a43371b306 18
ram54288 0:a7a43371b306 19 ### Reference-Impl
ram54288 0:a7a43371b306 20
ram54288 0:a7a43371b306 21 The *[Reference-Impl](https://github.com/ARMmbed/pal/tree/master/Source/Port/Reference-Impl)* folder contains the reference platform implementations in their respective folders.
ram54288 0:a7a43371b306 22 Each OS folder contains a list of folders of the required PAL modules to be implemented by the platform, for example:
ram54288 0:a7a43371b306 23
ram54288 0:a7a43371b306 24 ```
ram54288 0:a7a43371b306 25 Networking --> contains networking related files.
ram54288 0:a7a43371b306 26 ```
ram54288 0:a7a43371b306 27
ram54288 0:a7a43371b306 28 ### Porting to a new platform
ram54288 0:a7a43371b306 29
ram54288 0:a7a43371b306 30 1. Add a new platform folder to the *[Reference-Impl](https://github.com/ARMmbed/pal/tree/master/Source/Port/Reference-Impl)* folder.
ram54288 0:a7a43371b306 31 2. Add the module folders into the new platform folder.
ram54288 0:a7a43371b306 32 3. Read the relevent API/Module documentation.
ram54288 0:a7a43371b306 33 4. Start coding.
ram54288 0:a7a43371b306 34
ram54288 0:a7a43371b306 35 #### Essential header files
ram54288 0:a7a43371b306 36
ram54288 0:a7a43371b306 37 Here is a list of tips that can help in porting:
ram54288 0:a7a43371b306 38
ram54288 0:a7a43371b306 39 * Include the **[pal.h](https://github.com/ARMmbed/pal/blob/master/Source/PAL-Impl/Services-API/pal.h)** file; it includes all the required headers from PAL, such as `pal_errors.h` and `pal_macros.h`.
ram54288 0:a7a43371b306 40 * Read the **[pal_errors.h](https://github.com/ARMmbed/pal/blob/master/Source/PAL-Impl/Services-API/pal_errors.h)** file to find out how to map the platform errors to the PAL errors.
ram54288 0:a7a43371b306 41 * Read the **[pal_macros.h](https://github.com/ARMmbed/pal/blob/master/Source/PAL-Impl/Services-API/pal_macros.h)** to find helpful PAL macros.
ram54288 0:a7a43371b306 42 * Include the **pal_(MODULE).h** file to get the relevant data structures.