From d1a202ed8af7acbf5ca6abec876a2fd0e49f65a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Grome=C5=A1?= Date: Sun, 28 Aug 2022 17:01:27 +0200 Subject: [PATCH] Updated Porting to non Arduino Platforms (markdown) --- Porting-to-non-Arduino-Platforms.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Porting-to-non-Arduino-Platforms.md b/Porting-to-non-Arduino-Platforms.md index 5a4580e..e375156 100644 --- a/Porting-to-non-Arduino-Platforms.md +++ b/Porting-to-non-Arduino-Platforms.md @@ -21,4 +21,19 @@ void wrap_HAL_GPIO_WritePin(uint32_t pin, GPIO_PinState value) { } ``` -This has to be done for all Arduino functions listed on the page [Custom Build Configuration](https://github.com/jgromes/RadioLib/wiki/Custom-Build-Configuration). \ No newline at end of file +This has to be done for all Arduino functions listed on the page [Custom Build Configuration](https://github.com/jgromes/RadioLib/wiki/Custom-Build-Configuration). + +Once done, the last thing left to do is to initialize all callbacks defined in the `noarduino.h` file. The callbacks themselves are generated by RadioLib - the user only has to call the initalizing functions: + +```c++ +SX1278 radio = new Module(1, 2, 3, 4); + +(...) +radio.setCb_digitalRead(::wrap_HAL_GPIO_ReadPin); +radio.setCb_digitalWrite(::wrap_HAL_GPIO_WritePin); +// etc. for all the callbacks +(...) + +// we can go now! +radio.begin(); +``` \ No newline at end of file