ARMmbed / mbed-hal

mbed low-level HAL API
Other
15 stars 28 forks source link

mbed HAL

This module defines the API for the mbed low-level Hardware Abstraction Layer, which is implemented by target-specific modules.

mbed hal API is considered an internal interface. It is not recommended to depend on this module in an application. We are planning to improve mbed-hal in the future, which might require changes in API.

Installation

yotta install --save ARMmbed/mbed-hal

API

The mbed HAL defines API for the following peripherals/functionality:

Porting

mbed-hal requires a number of sub-modules when a port is created.

For instance, mbed-hal hierarchy might be:

               +----------+
               | mbed-hal |
               +----+-----+
                    | TD
           +--------+----------+
           | mbed-hal-<vendor> |
           +--------+----------+
                    | TD
   +----------------+----------------+   D   +--------------------------------+
   | mbed-hal-<vendor>-<chip family> +-------+ mbed-hal-<vendor>-<vendor hal> |
   +----------------+----------------+       +--------------------------------+
                    | TD
       +------------+-------------+
       | mbed-hal-<vendor>-<chip> |
       +--------------------------+
                    | TD
       +------------+---------------+
       | mbed-hal-<vendor>-<target> |
       +----------------------------+

In the diagram above, six hal repositories are defined to support a single target. Each of these repositories should contain specific parts of the mbed hal.

mbed-hal-\<vendor>

This repository contains redirections based on target only. mbed-hal- should contain a single file: a module.json.

Contains: No source/header files required

Dependencies: None

Target Dependencies: mbed-hal-\<vendor>-\<chip family>

mbed-hal-\<vendor>-\<chip family>

This repo should contain the files which implement the api defined in mbed-hal, e.g. spi_api.c, uart_api.c, us_ticker.c, etc.

Contains:

Dependencies: mbed-hal-\<vendor>-\<vendor hal>

Target Dependencies: mbed-hal-\<vendor>-\<chip>

mbed-hal-\<vendor>-\<vendor hal>

Contains a vendor-specific hal if necessary. This repository is optional. No dependencies are mandated, but most implementations of this repository will include a dependency on mbed-hal-\<vendor>-\<chip family>

Contains: Vendor-specific HAL

Dependencies: None required

Target Dependencies: None required

mbed-hal-\<vendor>-\<chip>

The chip-specific definitions expected by the vendor HAL and/or mbed-hal-\<vendor>-\<chip family>

Contains: chip-specific definitions and code

Dependencies: None required

Target Dependencies: None required

This module should define chip pin names. More information about pin names in mbed OS here.

mbed-hal-\<vendor>-\<target>

The target-specific definitions expected by the vendor HAL and/or mbed-hal-\<vendor>-\<chip family>

Contains:

Dependencies: None required

Target Dependencies: None required