Add scaffolding to read EEPROM data from ch341

This commit is contained in:
Jonathan Bennett
2025-06-01 13:41:43 -05:00
committed by Tom Fifield
parent b696e083f3
commit c7dd670e61
3 changed files with 254 additions and 0 deletions

View File

@@ -8,6 +8,9 @@
#include <iostream>
#include <libpinedio-usb.h>
#include <unistd.h>
extern "C" {
#include "platform/portduino/ch341a_i2c.h"
}
// include the library for Raspberry GPIO pins
@@ -47,6 +50,9 @@ class Ch341Hal : public RadioLibHal
std::string s = "Could not open SPI: ";
throw(s + std::to_string(ret));
}
// How to read the eeprom
// uint8_t buffer[1024] = {0};
// ch341readEEPROM_param(buffer, 0, 128, 128, 8, 1, 0x50, pinedio.handle);
pinedio_set_option(&pinedio, PINEDIO_OPTION_AUTO_CS, 0);
pinedio_set_pin_mode(&pinedio, 3, true);