|
1 |
| -# LibMcuLL |
2 |
| -This repository contains the microcontroller lowlevel library, called libMcuLL. It is a inspired by many microcontroller vendor libraries like LPCopen, STM32 LL drivers and many many more. The biggest problem is that they are locked behind various tools and instead of installing many graphical tools that download various zip files I just want to get at the register definitions. Next to that, these libraries are sometimes bloated and a bit inefficient, so lets reinvent the wheel ;-). |
| 1 | +# LibMcu |
| 2 | +This repository contains a set of libraries for usage on various microcontrollers. It is inspired by many microcontroller vendor libraries like LPCopen, STM32 LL drivers and many many more. The biggest problem is that they are locked behind various tools and instead of installing graphical tools that download various zip files I just want to get at the register definitions. Next to that, these libraries are can be big and inefficient, so lets reinvent the wheel ;-). |
| 3 | +All of these libraries are written in C++20. |
| 4 | +This library encompasses three separate libraries: |
| 5 | +* LibMcuLL: Contains low level routines that expose as much as the microcontroller functionality with a specific API |
| 6 | +* LibMcuHal: Contains low level routines that expose some of the microcontroller functionality but with a common interface that should be the same across all supported microcontrollers |
| 7 | +* LibMcuDriver: Contains drivers using the LibMcuHal classes so are usable across all microcontroller families. |
3 | 8 | # Usage
|
4 | 9 | To use this project add the inc directory of this repository to your project and to access the register definitions define the microcontroller with a preprocessor define in the shape of ```MCU_DEVICECODE```. See the appropriate header for supported controller. Word of warning, that it is defined there does not mean the support is by any means complete. I tend to add register definitions/features when I need them at that moment, yes this is annoying but feel free to contribute if you are missing something.
|
5 |
| -## Minimal usage example in C |
| 10 | +## Uusage example in C++ |
| 11 | +Just include the microcontroller specific library with the proper postfix notation for HAL or LL library. For example including the RP2040 LL library: |
6 | 12 | ```
|
7 |
| -// TODO add your configuration options here |
8 |
| -#include <mcu_ll.h> |
| 13 | +// Before inclusion add your clocking configuration in #defines, this will change in the future by using a proper configuration structure |
| 14 | +#include <libmcuRP2040ll.hpp> |
9 | 15 | ```
|
10 |
| -## Minimal usage example in C++ |
| 16 | +If you want to use the HAL library: |
11 | 17 | ```
|
12 |
| -// TODO add your configuration options here |
13 |
| -#include <mcu_ll.hpp> |
| 18 | +// Before inclusion add your clocking configuration in #defines, this will change in the future by using a proper configuration structure |
| 19 | +#include <libmcuRP2040hal.hpp> |
14 | 20 | ```
|
| 21 | +The drivers are located in the ```drivers``` |
15 | 22 | ## Design documents
|
16 | 23 | * How to add a microcontroller (TODO)
|
17 | 24 | * Hardware in the loop tests (TODO)
|
18 | 25 | * [include architecture](doc/includes.md)
|
19 |
| -* [C Coding guidelines](doc/C_coding_guidelines.md) |
20 | 26 | * [C++ Coding guidelines](doc/CPP_coding_guidelines.md)
|
21 |
| -* [C++ namespacing](doc/CPP_namespaces.md) |
22 |
| -* C++ anatomy of a peripheral hardware definition (TODO) |
23 |
| -* C++ anatomy of a peripheral software definition (TODO) |
| 27 | +* [namespacing](doc/CPP_namespaces.md) |
| 28 | +* design of a low level peripheral hardware definition (TODO) |
| 29 | +* design of a low level peripheral software definition (TODO) |
| 30 | +* design of a HAL peripheral definition (TODO) |
| 31 | +* design of a driver (TODO) |
24 | 32 | # Goals
|
25 |
| -For version 0.1 I intend to support the all the LPC812 peripherals with some functionality to make some applications. Not all features will be supported on all peripherals. |
| 33 | +Support is based on the microcontrollers I use the most, support is spotty as this library is still in development. Peripheral support is based on a first use basis. |
| 34 | +* NXP LPC8 series like the LPC81X, LPC82X, LPC80X, LPC84X, LPC11XX |
| 35 | +* STM32F0 STM32G0 STM32C0 STM32F4 STM32F7 |
| 36 | +* RP2040 |
| 37 | +I add support for peripherals on a project by project need basis. I use this library mostly as a learning vehicle for using modern C++. If you have a need, feel free to submit a pullrequest. |
0 commit comments