aboutsummaryrefslogtreecommitdiff
path: root/lib/pbdrv/drv/arduino
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-06-22 13:01:42 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-06-22 13:01:42 +0200
commitbb63040692c94ffa662b0af7eb14f3c5951aa6e6 (patch)
tree73cc719db8db857ccc012ff2002655bdad400be6 /lib/pbdrv/drv/arduino
parentbad32f876ab99fe0820fd310a4826378d0b11fe7 (diff)
even more doxygen documentation
Diffstat (limited to 'lib/pbdrv/drv/arduino')
-rw-r--r--lib/pbdrv/drv/arduino/index.dox19
-rw-r--r--lib/pbdrv/drv/arduino/mod.cpp20
2 files changed, 30 insertions, 9 deletions
diff --git a/lib/pbdrv/drv/arduino/index.dox b/lib/pbdrv/drv/arduino/index.dox
new file mode 100644
index 0000000..4c74222
--- /dev/null
+++ b/lib/pbdrv/drv/arduino/index.dox
@@ -0,0 +1,19 @@
+// vim:ft=doxygen
+/**
+\ingroup pb_drv
+\defgroup pb_drv_arduino Arduino
+\brief Arduino (Arduino-CMake-Toolchain) driver
+
+This driver is automatically enabled if the variable \c ARDUINO is defined in
+your CMakeLists.txt (it is by default when using Arduino-CMake-Toolchain).
+
+\note This driver automatically includes the
+\ref pb_ext_freertos "FreeRTOS extension" for deferring calls to \c
+pb_i2c_recv() from the I2C ISR.
+
+This driver is known to work with the following MCUs:
+- ATmega328P (Arduino Uno)
+- ATmega2560 (Arduino Mega)
+
+*/
+
diff --git a/lib/pbdrv/drv/arduino/mod.cpp b/lib/pbdrv/drv/arduino/mod.cpp
index 9130334..2eef8d5 100644
--- a/lib/pbdrv/drv/arduino/mod.cpp
+++ b/lib/pbdrv/drv/arduino/mod.cpp
@@ -42,6 +42,7 @@ static void pb_setup() {
Wire.onReceive(recv_event);
}
+/// \ingroup pb_drv_arduino
__weak void pb_i2c_send(i2c_addr_t addr, const uint8_t * buf, size_t sz) {
Wire.beginTransmission((int) addr);
Wire.write(buf, sz);
@@ -64,7 +65,16 @@ void loop_task() {
}
}
-//! Application entrypoint
+/**
+ * \ingroup pb_drv_arduino
+ * \brief Application entrypoint
+ *
+ * \note I should really be able to use Arduino's initVariant function for
+ * this, but I can't seem to get it to link properly using the CMake setup in
+ * this repository. Overriding the main() function seems to work, and the
+ * USBCON thing in the default Arduino main() function isn't needed because
+ * puzzle modules are likely not using USB.
+ */
int main(void) {
init(); // call arduino internal setup
setup(); // call regular arduino setup
@@ -74,11 +84,3 @@ int main(void) {
return 0;
}
-/**
- * \note I should really be able to use Arduino's initVariant function for
- * this, but I can't seem to get it to link properly using the CMake setup in
- * this repository. Overriding the main() function seems to work, and the
- * USBCON thing in the default Arduino main() function isn't needed because
- * puzzle modules are likely not using USB.
- */
-