https://github.com/djordjemandic/uirbcorelib
The UIRBcore Library is an Arduino library designed for managing the Universal Infrared Blaster (UIRB) board.
https://github.com/djordjemandic/uirbcorelib
arduino blaster infrared ir library platformio uirb uirbcore universal
Last synced: about 1 month ago
JSON representation
The UIRBcore Library is an Arduino library designed for managing the Universal Infrared Blaster (UIRB) board.
- Host: GitHub
- URL: https://github.com/djordjemandic/uirbcorelib
- Owner: DjordjeMandic
- License: mit
- Created: 2024-11-16T16:59:28.000Z (over 1 year ago)
- Default Branch: dev
- Last Pushed: 2025-01-05T10:35:52.000Z (over 1 year ago)
- Last Synced: 2025-04-12T06:58:32.623Z (about 1 year ago)
- Topics: arduino, blaster, infrared, ir, library, platformio, uirb, uirbcore, universal
- Language: C++
- Homepage: https://linktr.ee/djordjemandic
- Size: 215 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# UIRBcore Library
UIRBcore is an Arduino library tailored for managing the Universal Infrared Blaster (UIRB) board. This library provides core functionalities like power management and system initialization, while relying on external IR libraries for signal transmission and reception.
**Note:** This library is a proof of concept and is not optimized for performance or low-power applications. It is intended as an example and should be avoided in performance-critical scenarios.
This library is designed with PlatformIO in mind and requires the **uirb-v02-atmega328p** custom board definition or the `-DUIRB_BOARD_V02` flag supplied during compilation.
---
## Features
- **Power Management**: Built-in support for monitoring battery voltage and charging states.
- **Fixed Pin Assignments**: Predefined pin assignments managed directly within the library.
- **EEPROM Management**: Efficient storage and retrieval of configuration data.
- **PlatformIO Support**: Optimized for PlatformIO projects, ensuring robust build and dependency management.
---
## Prerequisites
To use UIRBcore, ensure you have the following:
1. [PlatformIO](https://platformio.org/) installed.
2. The custom board definition for **uirb-v02-atmega328p** installed. You will need to provide a path to the definition during project setup. Visit the [UIRB PlatformIO Example Project Repository](https://github.com/DjordjeMandic/UIRBpio) for more information.
---
## Installation
### Using PlatformIO Library Manager
Add UIRBcore to your `platformio.ini` file using one of the following approaches:
> **Tip:** Learn more about semantic versioning at [devhints.io/semver](https://devhints.io/semver) and [semver.org](https://semver.org/).
```ini
lib_deps =
djordjemandic/UIRBcorelib @ ^1.2.3 ; Depend on the latest 1.x stable version
```
> **Tip:** Discover more about specifying packages in PlatformIO by visiting the [official documentation on package specifications](https://docs.platformio.org/en/latest/core/userguide/pkg/cmd_install.html#package-specifications).
```ini
lib_deps =
https://github.com/DjordjeMandic/UIRBcorelib.git#release ; Depend on the release Git branch
```
```ini
lib_deps =
https://github.com/DjordjeMandic/UIRBcorelib.git#v1.2.3 ; Depend on the v1.2.3 Git tag
```
### Manually
1. Download the latest release from the [UIRBcore GitHub repository](https://github.com/DjordjeMandic/UIRBcorelib).
2. Place the library folder in your project’s `lib` directory.
---
## Usage
Here’s a quick example of how to initialize the UIRBcore library:
> **Important:** The ATMEGA328P EEPROM must store a valid hardware version for the UIRB constructor to initialize correctly. If the EEPROM does not contain valid data, the constructor will cause the system to hang and reboot.
> **Note:** For IR signal transmission and reception, use compatible external libraries.
```cpp
#include
#include
using namespace uirbcore;
UIRB& uirb = UIRB::getInstance();
void setup()
{
Serial.begin(1000000);
if (!uirb.begin())
{
Serial.println(F("UIRBcore Initialization Failed!"));
// Ensure uirb.begin() returns `uirbcore::CoreResult::SUCCESS` before proceeding to avoid hardware damage.
while (1);
}
Serial.println("UIRBcore initialized successfully.");
// Additional setup code here
}
void loop()
{
// Main application logic
}
```
---
## Examples
Explore the provided example sketches:
- [`Basic`](./examples/Basic): A basic implementation of the UIRBcore library.
- [`Calibration`](./examples/Calibration): Demonstrates how to calibrate and configure the system.
- [`BypassEEPROM`](./examples/BypassEEPROM): Shows how to bypass EEPROM validation using `#define UIRB_EEPROM_BYPASS_DEBUG`.
These examples are located within the [`examples`](./examples) folder of the library.
---
## Configuration
> **Limitation:** Simulation using simavr in PlatformIO is not supported because there is currently no method to pre-load EEPROM data before the simulation. However, this limitation can be mitigated using `#define UIRB_EEPROM_BYPASS_DEBUG` and `#define UIRB_EEPROM_RPROG_DEBUG`.
The library uses fixed pin assignments predefined for the UIRB V0.2 board. Refer to the source code for exact pin mappings.
---
## Doxygen Documentation and Scripts
> **Note:** All scripts should be executed from the root of the repository.
### Version Management
Update version information in [`UIRBcore_Version.h`](./include/UIRBcore_Version.h) using the script [`update_version.py`](./scripts/update_version.py):
```bash
python ./scripts/update_version.py
```
### Documentation
This project uses Doxygen for documentation. Use the script [`doxygen_generate.ps1`](./scripts/doxygen_generate.ps1) to generate the documentation:
> **Details:**
> - **UpdateVersion**: Updates the `UIRBcore_Version.h` file using `update_version.py`.
> - **OpenHTML**: Opens the `index.html` file in the `docs/html` directory after successful generation.
> - Ensure the script and its dependencies (`git_info.ps1`, `update_version.py`) are properly configured and placed in the `scripts` directory.
> - Requires Git, Python, and Doxygen installed and accessible via the command line.
```powershell
pwsh ./scripts/doxygen_generate.ps1 Doxyfile -OpenHTML
```
```powershell
pwsh ./scripts/doxygen_generate.ps1 Doxyfile -UpdateVersion -OpenHTML
```
---
## Contribution
Contributions are welcome! If you have ideas for improvements or encounter issues, please open an issue or submit a pull request on the [GitHub repository](https://github.com/DjordjeMandic/UIRBcorelib).
---
## License
This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.
---
## Acknowledgments
- **Author**: Djordje Mandic ([linktr.ee/djordjemandic](https://linktr.ee/djordjemandic))
- **Supported Hardware**: UIRB V0.2 board.
---
_For more information about the custom board definition, visit the [UIRBpio GitHub repository](https://github.com/DjordjeMandic/UIRBpio)._