The integration with Zephyr is fairly clean but as MicroPython Hardware API
requires pin ID to be a single value, but Zephyr operates GPIO in terms of
ports and pins, not just pins, a "hierarchical" ID is required, using tuple
of (port, pin). Port is a string, effectively a device name of a GPIO port,
per Zephyr conventions these are "GPIO_0", "GPIO_1", etc.; pin is integer
number of pin with the port (supposed to be in range 0-31).
Example of pin initialization:
pin = Pin(("GPIO_1", 21), Pin.OUT)
(an LED on FRDM-K64F's Port B, Pin 21).
There is support for in/out pins and pull up/pull down but currently
there is no interrupt support.
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
This provides time and sleep together with the usual ticks_us/_ms/_diff
and sleep_us/ms family.
We also provide access to Zephyr's high precision timer as ticks_cpu().
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
The boot issue text mentions a help() function and encourages
the user to run it. It is very disconcerting to find that the
function does not exist...
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
The outputexpors target, which exports Zephyr environment variables, was
recently added to Zephyr. By exploiting this feature we can hugely simplify
the build system, improving robustness at the same time.
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
The two variables, GENERIC_TARGETS and CONFIG_TARGETS come, respectively,
from the the lists shown during "make help" and "make kconfig-help".
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Currently to compile for anything that except ARCH=x86 we have to
provide ARCH via the environment or make arguments. We can do better
than that!
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>