├── .gitignore ├── LICENSE.md ├── .gitmodules └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Ali Mirghasemi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Stream"] 2 | path = Stream 3 | url = https://github.com/Ali-Mirghasemi/Stream 4 | 5 | [submodule "Codec"] 6 | path = Codec 7 | url = https://github.com/Ali-Mirghasemi/Codec 8 | 9 | [submodule "CmdManager"] 10 | path = CmdManager 11 | url = https://github.com/Ali-Mirghasemi/CmdManager 12 | 13 | [submodule "Key"] 14 | path = Key 15 | url = https://github.com/Ali-Mirghasemi/Key 16 | 17 | [submodule "Str"] 18 | path = Str 19 | url = https://github.com/Ali-Mirghasemi/Str 20 | 21 | [submodule "Benchmark"] 22 | path = Benchmark 23 | url = https://github.com/Ali-Mirghasemi/Benchmark 24 | branch = origin/master 25 | [submodule "Param"] 26 | path = Param 27 | url = https://github.com/Ali-Mirghasemi/Param 28 | [submodule "Printer"] 29 | path = Printer 30 | url = https://github.com/Ali-Mirghasemi/Printer 31 | [submodule "StatusLed"] 32 | path = StatusLed 33 | url = https://github.com/Ali-Mirghasemi/StatusLed 34 | [submodule "KeyPad"] 35 | path = KeyPad 36 | url = https://github.com/Ali-Mirghasemi/KeyPad 37 | [submodule "Signal"] 38 | path = Signal 39 | url = https://github.com/Ali-Mirghasemi/Signal 40 | [submodule "Reflex"] 41 | path = Reflex 42 | url = https://github.com/Ali-Mirghasemi/Reflex 43 | branch = master 44 | [submodule "Queue"] 45 | path = Queue 46 | url = https://github.com/Ali-Mirghasemi/Queue 47 | [submodule "UARTStream"] 48 | path = UARTStream 49 | url = https://github.com/Ali-Mirghasemi/UARTStream.git 50 | [submodule "Macro"] 51 | path = Macro 52 | url = https://github.com/Ali-Mirghasemi/Macro.git 53 | [submodule "Assert"] 54 | path = Assert 55 | url = https://github.com/Ali-Mirghasemi/Assert.git 56 | [submodule "Log"] 57 | path = Log 58 | url = https://github.com/Ali-Mirghasemi/Log 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Embedded Libs 2 | This repository contains of multiple useful and most used library in embedded systems such as Microcontroller 3 | 4 | ## Clone the repository 5 | For clone repository with all submodules you have two choices: 6 | 7 | #### 1. Clone the repository with submodules 8 | ``` 9 | git clone --recursive https://github.com/Ali-Mirghasemi/Embedded-Libs # Version 1.65+ 10 | git clone --recursive -j8 https://github.com/Ali-Mirghasemi/Embedded-Libs # Version 1.9+ 11 | git clone --recurse-submodules -j8 https://github.com/Ali-Mirghasemi/Embedded-Libs # Version 2.13+ 12 | ``` 13 | #### 2. Already cloned the repository 14 | ``` 15 | git submodule update --init --recursive 16 | ``` 17 | 18 | #### 3. Pull all submodules 19 | ``` 20 | git pull --recurse-submodules 21 | ``` 22 | 23 | ## Stream 24 | `Stream` Library help you to serialize and deserialize binary data over any communication protocol, such as UART, Ethernet, ... 25 | 26 | #### Features 27 | - Support Big-endian and Little-Endian 28 | - Support serialize and deserialize all standard data types 29 | - Memory safe for reading unaligned data 30 | - `InputStream` and `OutputStream` can work over a HAL (Hardware Abstract Layer) 31 | - User access to customize configuration base on hardware need 32 | - Any bytes buffer can turn into `StreamBuffer` without zero copy 33 | 34 | for more details see [Stream ReadMe](https://github.com/Ali-Mirghasemi/Stream/blob/master/README.md) 35 | 36 | ## Str 37 | `Str` Library provide most used functions for work with strings in `C` language 38 | 39 | #### Features 40 | - Can work with or without `string.h` library 41 | - Full set of function for convert data types into strings 42 | - Full set of function for convert strings into data types 43 | - Split functions 44 | - Sort and Searching functions 45 | - Finding functions 46 | - Param parser 47 | 48 | for more details see [Str ReadMe](https://github.com/Ali-Mirghasemi/Str/blob/master/README.md) 49 | 50 | ## Key 51 | `Key` Library provide a key manager, such as Buttons and DipSwitch 52 | 53 | #### Features 54 | - Support multiple key manager 55 | - Support multiple key event (OnClick, OnPress, OnRelease, OnNone) 56 | - Support Fixed array or linked list for key manager 57 | - Each Key has own callbacks for each event 58 | - Support multiple callbacks or single callback for each key 59 | - Support customize key configuration based on hardware 60 | - HAL (Hardware Abstract Layer) support 61 | 62 | for more details see [Key ReadMe](https://github.com/Ali-Mirghasemi/Key/blob/master/README.md) 63 | 64 | ## CmdManager 65 | `CmdManager` Library provide a command manager, such as CLI, Telnet, ... for your embedded system over a HAL (Hardware Abstract Layer) 66 | 67 | #### Features 68 | - Support multiple command manager 69 | - Support multiple command event (Execute, Help, Set, Get, Response) 70 | - Support custom command format 71 | - Auto detect parameter type and convert it into data type 72 | - Support multiple parameter for each command 73 | - Support binary search or linear search 74 | - Automatic sort command by name for more performance in searching 75 | - Support customize command configuration based on hardware 76 | 77 | for more details see [CmdManager ReadMe](https://github.com/Ali-Mirghasemi/CmdManager/blob/master/README.md) 78 | 79 | ## Codec 80 | `Codec` Library help you to create your own layer protocol 81 | 82 | #### Features 83 | - Support multiple codec 84 | - Support Serialize and Deserialize data 85 | - Support customize codec configuration based on hardware 86 | - HAL (Hardware Abstract Layer) support 87 | 88 | for more details see [Codec ReadMe](https://github.com/Ali-Mirghasemi/Codec/blob/master/README.md) 89 | 90 | ## Benchmark 91 | `Benchmark` Library help you to benchmark your functions in embedded system 92 | 93 | #### Features 94 | - Support multiple benchmark 95 | - Support customize benchmark configuration based on hardware 96 | - HAL (Hardware Abstract Layer) support 97 | 98 | for more details see [Benchmark ReadMe](https://github.com/Ali-Mirghasemi/Benchmark/blob/master/README.md) 99 | 100 | ## Printer 101 | `Printer` Library help you to print your data over `Stream` 102 | 103 | for more details see [Printer ReadMe](https://github.com/Ali-Mirghasemi/Printer/blob/master/README.md) 104 | 105 | ## Run Examples 106 | If you want to test examples it is recommended to clone the repository with submodules. 107 | now you can run the examples. 108 | 109 | --------------------------------------------------------------------------------