From 1ff6f403e5db44852caacc25004ee3def60fabe0 Mon Sep 17 00:00:00 2001
From: pedromsousalima <32345730+pedromsousalima@users.noreply.github.com>
Date: Thu, 19 Dec 2024 12:08:02 +0100
Subject: [PATCH 1/5] Added Reference for OPAMP

---
 .../opamp-library-reference/giga-usb.md       | 96 +++++++++++++++++++
 1 file changed, 96 insertions(+)
 create mode 100644 content/hardware/02.hero/boards/uno-r4-wifi/tutorials/opamp-library-reference/giga-usb.md

diff --git a/content/hardware/02.hero/boards/uno-r4-wifi/tutorials/opamp-library-reference/giga-usb.md b/content/hardware/02.hero/boards/uno-r4-wifi/tutorials/opamp-library-reference/giga-usb.md
new file mode 100644
index 0000000000..641a76e72e
--- /dev/null
+++ b/content/hardware/02.hero/boards/uno-r4-wifi/tutorials/opamp-library-reference/giga-usb.md
@@ -0,0 +1,96 @@
+---
+title: OPAMP Library API Documentation
+description: 'Learn how to use the on-board OPAMP on the Arduino R4 boards.'
+author: Pedro Sousa Lima
+hardware:
+  - hardware/10.mega/boards/giga-r1-wifi
+software:
+  - ide-v1
+  - ide-v2
+  - web-editor
+tags: [AMPOP, OPAMP]
+---
+
+## Overview
+
+The OPAMP library provides an interface to initialize and manage operational amplifiers (op-amps) on supported Arduino boards. This documentation details the public functions available for user interaction.
+
+## Accessing the Library
+
+The library provides an instance of the `OpampClass`, which represents the operational amplifier controller:
+```cpp
+OpampClass OPAMP;
+```
+This instance is used to call the library's methods.
+
+## Supported Boards
+
+- Arduino UNO R4 WiFi
+- Arduino UNO R4 Minima
+
+## Functions
+
+### `bool begin(OpampSpeedMode)`
+
+Initializes the default op-amp channel. You can specify the speed mode as either high-speed or low-speed. If no speed mode is specified, the op-amp will default to high-speed mode.
+
+#### Parameters
+
+- `speed` (optional): The speed mode of the op-amp. Options are:
+  - `OPAMP_SPEED_LOWSPEED`
+  - `OPAMP_SPEED_HIGHSPEED` (default)
+
+#### Returns
+
+- `true` if initialization was successful.
+- `false` if initialization failed.
+
+### `bool isRunning(uint8_t channel)`
+Checks whether a specific op-amp channel is currently running.
+
+#### Parameters
+- `channel`: The channel number to check (0 to 3).
+
+#### Returns
+- `true` if the channel is active.
+- `false` if the channel is inactive.
+
+### `void end()`
+Deactivates all op-amp channels.
+
+### `void end(uint8_t channel_mask)`
+Deactivates specified op-amp channels.
+
+#### Parameters
+- `channel_mask`: A bitmask specifying which channels to deactivate.
+
+## Example Usage
+Here is an example demonstrating how to initialize and check the status of the op-amp:
+
+```cpp
+#include <OPAMP.h>
+
+void setup() {
+    Serial.begin(9600);
+    delay(2000); // serial monitor delay
+
+    // Activate OPAMP on the default channel (channel 0)
+    // Plus: Analog A1
+    // Minus: Analog A2
+    // Output: Analog A3
+    if (!OPAMP.begin(OPAMP_SPEED_HIGHSPEED)) {
+        Serial.println("Failed to start OPAMP!");
+    }
+
+    bool const isRunning = OPAMP.isRunning(0);
+    if (isRunning) {
+        Serial.println("OPAMP running on channel 0!");
+    } else {
+        Serial.println("OPAMP channel 0 is not running!");
+    }
+}
+
+void loop() {
+    delay(1000); // do nothing
+}
+```
\ No newline at end of file

From 20451ec75e5a6e8cf4e742bf1120421fe63f9dcc Mon Sep 17 00:00:00 2001
From: pedromsousalima <32345730+pedromsousalima@users.noreply.github.com>
Date: Thu, 19 Dec 2024 12:18:39 +0100
Subject: [PATCH 2/5] Added reference to the OPAMP content

---
 .../tutorials/opamp-library-reference/giga-usb.md     | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/content/hardware/02.hero/boards/uno-r4-wifi/tutorials/opamp-library-reference/giga-usb.md b/content/hardware/02.hero/boards/uno-r4-wifi/tutorials/opamp-library-reference/giga-usb.md
index 641a76e72e..a96b00eb34 100644
--- a/content/hardware/02.hero/boards/uno-r4-wifi/tutorials/opamp-library-reference/giga-usb.md
+++ b/content/hardware/02.hero/boards/uno-r4-wifi/tutorials/opamp-library-reference/giga-usb.md
@@ -13,15 +13,8 @@ tags: [AMPOP, OPAMP]
 
 ## Overview
 
-The OPAMP library provides an interface to initialize and manage operational amplifiers (op-amps) on supported Arduino boards. This documentation details the public functions available for user interaction.
-
-## Accessing the Library
-
-The library provides an instance of the `OpampClass`, which represents the operational amplifier controller:
-```cpp
-OpampClass OPAMP;
-```
-This instance is used to call the library's methods.
+The OPAMP library allows control over the on-board OP AMP encontered on Arduino R4 boards.
+More information on implementation can be found [here](https://docs.arduino.cc/tutorials/uno-r4-wifi/opamp/).
 
 ## Supported Boards
 

From 6ea10efc9478ec55305682058241caa9e2d339df Mon Sep 17 00:00:00 2001
From: pedromsousalima <32345730+pedromsousalima@users.noreply.github.com>
Date: Thu, 19 Dec 2024 12:30:00 +0100
Subject: [PATCH 3/5] fixed linter and header

---
 .../tutorials/opamp-library-reference/giga-usb.md         | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/content/hardware/02.hero/boards/uno-r4-wifi/tutorials/opamp-library-reference/giga-usb.md b/content/hardware/02.hero/boards/uno-r4-wifi/tutorials/opamp-library-reference/giga-usb.md
index a96b00eb34..7874182156 100644
--- a/content/hardware/02.hero/boards/uno-r4-wifi/tutorials/opamp-library-reference/giga-usb.md
+++ b/content/hardware/02.hero/boards/uno-r4-wifi/tutorials/opamp-library-reference/giga-usb.md
@@ -2,12 +2,6 @@
 title: OPAMP Library API Documentation
 description: 'Learn how to use the on-board OPAMP on the Arduino R4 boards.'
 author: Pedro Sousa Lima
-hardware:
-  - hardware/10.mega/boards/giga-r1-wifi
-software:
-  - ide-v1
-  - ide-v2
-  - web-editor
 tags: [AMPOP, OPAMP]
 ---
 
@@ -29,7 +23,7 @@ Initializes the default op-amp channel. You can specify the speed mode as either
 
 #### Parameters
 
-- `speed` (optional): The speed mode of the op-amp. Options are:
+  `speed` (optional): The speed mode of the op-amp. Options are:
   - `OPAMP_SPEED_LOWSPEED`
   - `OPAMP_SPEED_HIGHSPEED` (default)
 

From 87e5856be090b494a8c333505d9e19f8dbe8c812 Mon Sep 17 00:00:00 2001
From: pedromsousalima <32345730+pedromsousalima@users.noreply.github.com>
Date: Thu, 19 Dec 2024 13:07:16 +0100
Subject: [PATCH 4/5] Fix Linter

---
 .../tutorials/opamp-library-reference/giga-usb.md           | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/content/hardware/02.hero/boards/uno-r4-wifi/tutorials/opamp-library-reference/giga-usb.md b/content/hardware/02.hero/boards/uno-r4-wifi/tutorials/opamp-library-reference/giga-usb.md
index 7874182156..0b71262d65 100644
--- a/content/hardware/02.hero/boards/uno-r4-wifi/tutorials/opamp-library-reference/giga-usb.md
+++ b/content/hardware/02.hero/boards/uno-r4-wifi/tutorials/opamp-library-reference/giga-usb.md
@@ -21,7 +21,7 @@ More information on implementation can be found [here](https://docs.arduino.cc/t
 
 Initializes the default op-amp channel. You can specify the speed mode as either high-speed or low-speed. If no speed mode is specified, the op-amp will default to high-speed mode.
 
-#### Parameters
+**Parameters**
 
   `speed` (optional): The speed mode of the op-amp. Options are:
   - `OPAMP_SPEED_LOWSPEED`
@@ -35,7 +35,7 @@ Initializes the default op-amp channel. You can specify the speed mode as either
 ### `bool isRunning(uint8_t channel)`
 Checks whether a specific op-amp channel is currently running.
 
-#### Parameters
+**Parameters**
 - `channel`: The channel number to check (0 to 3).
 
 #### Returns
@@ -48,7 +48,7 @@ Deactivates all op-amp channels.
 ### `void end(uint8_t channel_mask)`
 Deactivates specified op-amp channels.
 
-#### Parameters
+**Parameters**
 - `channel_mask`: A bitmask specifying which channels to deactivate.
 
 ## Example Usage

From 2156c291cf6553f902ab22f8fba30f9ba3873e8d Mon Sep 17 00:00:00 2001
From: pedromsousalima <32345730+pedromsousalima@users.noreply.github.com>
Date: Thu, 19 Dec 2024 13:12:56 +0100
Subject: [PATCH 5/5] Linter

---
 .../uno-r4-wifi/tutorials/opamp-library-reference/giga-usb.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/content/hardware/02.hero/boards/uno-r4-wifi/tutorials/opamp-library-reference/giga-usb.md b/content/hardware/02.hero/boards/uno-r4-wifi/tutorials/opamp-library-reference/giga-usb.md
index 0b71262d65..b90192ae64 100644
--- a/content/hardware/02.hero/boards/uno-r4-wifi/tutorials/opamp-library-reference/giga-usb.md
+++ b/content/hardware/02.hero/boards/uno-r4-wifi/tutorials/opamp-library-reference/giga-usb.md
@@ -27,7 +27,7 @@ Initializes the default op-amp channel. You can specify the speed mode as either
   - `OPAMP_SPEED_LOWSPEED`
   - `OPAMP_SPEED_HIGHSPEED` (default)
 
-#### Returns
+**Returns**
 
 - `true` if initialization was successful.
 - `false` if initialization failed.
@@ -38,7 +38,7 @@ Checks whether a specific op-amp channel is currently running.
 **Parameters**
 - `channel`: The channel number to check (0 to 3).
 
-#### Returns
+**Returns**
 - `true` if the channel is active.
 - `false` if the channel is inactive.