|
| 1 | +# LPC55s6x HAL |
| 2 | + |
| 3 | +Hardware Abstraction Layer (HAL) for [NXP LPC55S6x][nxp-lpc55s6x] [Cortex-M33][cortex-m33] microcontrollers, |
| 4 | +written in Rust. |
| 5 | + |
| 6 | +LPC55S6x HAL provides a high-level interface to the features of these LPC55S6x MCUs, which is safe, |
| 7 | +convenient and efficient. It leverages Rust's type system to prevent common mistakes, such as attempting |
| 8 | +to use an uninitialized peripheral; these will be caught by compile-time errors. |
| 9 | + |
| 10 | +This library implements the [embedded-hal][embedded-hal], a collection of traits intended to abstract |
| 11 | +over platform-dependencies, allowing firmware and drivers to be quite portable. |
| 12 | + |
| 13 | +Moreover, this library is compatible with the Cortex-M implementation of [RTFM][cortex-m-rtfm], |
| 14 | +a concurrency framework supporting preemptive multitasking with minimal footprint, which it does by |
| 15 | +delegating the scheduling to hardware. |
| 16 | + |
| 17 | +[![crates.io][crates-image]][crates-link] |
| 18 | +[![Documentation][docs-image]][docs-link] |
| 19 | +![LICENSE][license-image] |
| 20 | +[![Build Status][build-image]][build-link] |
| 21 | + |
| 22 | +## Status |
| 23 | + |
| 24 | +Very much work-in-progress! |
| 25 | + |
| 26 | +See also the low-level companion library [LPC55S6x PAC][lpc55s6x-pac]. |
| 27 | + |
| 28 | +Until `cortex-m-rtfm` v0.5 is released, it needs to be manually enabled in the `dev-dependencies`, |
| 29 | +and the `rtfm_led` example unhidden. |
| 30 | + |
| 31 | +## Documentation |
| 32 | + |
| 33 | +The API documentation is located at <https://docs.rs/lpc55s6x-hal>. |
| 34 | + |
| 35 | +In addition, `make fetch-docs` downloads various vendor-supplied documentation: |
| 36 | + |
| 37 | +- [LPC55S6x Data Sheet][datasheet] |
| 38 | +- [LPC55S6x User Manual][usermanual] |
| 39 | +- [LPC55S6x Errata][errata] |
| 40 | +- [Cortex-M33 Generic User Guide][genericuserguide] |
| 41 | +- [LPCXpresso55S69 Development Board User Manual][um11158] (requires an NXP account) |
| 42 | + |
| 43 | +## Examples |
| 44 | + |
| 45 | +The intention of the [`examples/`][examples] is to showcase the functionality of this library. |
| 46 | + |
| 47 | +They run on the [LPCXpresso55S69][lpcxpresso55s69] development board. |
| 48 | + |
| 49 | +After flashing [J-Link firmware][jlink-fw] on the on-board LPCXpresso V2 debugger: |
| 50 | + |
| 51 | +```bash |
| 52 | +# in one terminal |
| 53 | +make jlink |
| 54 | + |
| 55 | +# in another terminal |
| 56 | +make run-example EXAMPLE=rtfm_led # or any other example |
| 57 | +``` |
| 58 | + |
| 59 | +## License |
| 60 | + |
| 61 | +[Apache-2.0][apache2-link] or [MIT][mit-link]. |
| 62 | + |
| 63 | +Parts of the code are directly lifted from the [LPC8xx HALs][lpc8xx-hal]. |
| 64 | + |
| 65 | +[//]: # (links) |
| 66 | + |
| 67 | +[nxp-lpc55s6x]: https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc5500-cortex-m33:LPC5500_SERIES |
| 68 | +[cortex-m33]: https://developer.arm.com/ip-products/processors/cortex-m/cortex-m33 |
| 69 | +[embedded-hal]: https://lib.rs/embedded-hal |
| 70 | +[cortex-m-rtfm]: https://lib.rs/cortex-m-rtfm |
| 71 | +[lpc55s6x-pac]: https://lib.rs/lpc55s6x-pac |
| 72 | +[lpc8xx-hal]: https://github.com/lpc-rs/lpc8xx-hal |
| 73 | +[examples]: https://github.com/nickray/lpc55s6x-hal/tree/master/examples |
| 74 | +[lpcxpresso55s69]: https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc5500-cortex-m33/lpcxpresso55s69-development-board:LPC55S69-EVK |
| 75 | +[jlink-fw]: https://www.segger.com/products/debug-probes/j-link/models/other-j-links/lpcxpresso-on-board/ |
| 76 | + |
| 77 | +[crates-image]: https://img.shields.io/crates/v/lpc55s6x-hal.svg?style=flat-square |
| 78 | +[crates-link]: https://crates.io/crates/lpc55s6x-hal |
| 79 | +[build-image]: https://img.shields.io/circleci/build/github/nickray/lpc55s6x-hal/master.svg?style=flat-square |
| 80 | +[build-link]: https://circleci.com/gh/nickray/lpc55s6x-hal/tree/master |
| 81 | +[docs-image]: https://docs.rs/lpc55s6x-hal/badge.svg?style=flat-square |
| 82 | +[docs-link]: https://docs.rs/lpc55s6x-hal |
| 83 | + |
| 84 | +[license-image]: https://img.shields.io/badge/license-Apache2.0%2FMIT-blue.svg??style=flat-square |
| 85 | +[apache2-link]: https://spdx.org/licenses/Apache-2.0.html |
| 86 | +[mit-link]: https://spdx.org/licenses/MIT.html |
| 87 | + |
| 88 | +[datasheet]: https://www.nxp.com/docs/en/data-sheet/LPC55S6x.pdf |
| 89 | +[usermanual]: https://www.nxp.com/docs/en/user-guide/UM11126.pdf |
| 90 | +[errata]: https://www.nxp.com/docs/en/errata/ES_LPC55S6x.pdf |
| 91 | +[genericuserguide]: https://static.docs.arm.com/100235/0004/arm_cortex_m33_dgug_100235_0004_00_en.pdf |
| 92 | +[um11158]: https://www.nxp.com/webapp/Download?colCode=UM11158 |
0 commit comments