Skip to content

Instantly share code, notes, and snippets.

@PL125
PL125 / VagMicronasDecoder.sh
Last active August 20, 2025 16:03
VAG Micronas Cluster Eeprom Parser
#!/usr/bin/env bash
function printUsage() {
echo "Usage: $0 <OPTIONS>"
echo " OPTIONS:"
echo " -e <= EEprom file location"
echo " -f <= Flash file location"
echo " -? -h --? --help <= Help info"
echo ""
}
@PL125
PL125 / Opel_Astra_H_IPC_Utility.ino
Created July 4, 2025 18:10
Arduino-based tool to read and parse the M35080 EEPROM found in some Opel instrument clusters
#include <SPI.h>
class M35080 {
private:
// M35080 Properties
static constexpr uint8_t PAGE_SIZE = {0x20u}; // 32 bytes
static constexpr uint16_t MEMORY_SIZE = {0x400u}; // 1024 bytes => 8 Kbits
static constexpr uint8_t PAGE_COUNT = {MEMORY_SIZE / PAGE_SIZE};
static constexpr uint8_t WRITE_CYCLE_TIMEOUT_MS = {0x0Au}; // 10 Milliseconds
@PL125
PL125 / VagEdc16Decoder.sh
Last active August 20, 2025 14:27
Vag EDC16 Eeprom Parser
#!/usr/bin/env bash
function printUsage() {
echo "Usage: $0 <OPTIONS>"
echo " OPTIONS:"
echo " -f <= EEprom file location"
echo " -? -h --? --help <= Help info"
echo "E.g., bash VagEdc16Decoder.sh -f EEpromfile.bin"
echo ""
}
@PL125
PL125 / encoder.ino
Last active April 22, 2025 22:01
Rotary encoder software debouncing, sample code
#include "pins_arduino.h"
#if !defined(USE_INTERNAL_PULL_UP_RESISTORS)
#define USE_INTERNAL_PULL_UP_RESISTORS // Comment if encoder have inbuilt pull-up resistors
#endif
// Pins connected to the encoder
#if defined(ESP8266)
@PL125
PL125 / debloat.sh
Created August 31, 2024 14:48
Huawei Debloat Script
#!/bin/bash
function debloat() {
local bloatware=(
"com.huawei.tips"
"com.huawei.hwid"
"com.huawei.gamebox"
"com.huawei.browser"
"com.huawei.scanner"
"com.huawei.hwsearch"
@PL125
PL125 / CH32V305FBP6.cpp
Created July 20, 2024 13:40
First tests using CanBus, Timer and Serial on a RISC-V CH32V305FBP6
#include "../Peripheral/inc/ch32v30x_gpio.h"
#include "../Peripheral/inc/ch32v30x_usart.h"
#include "../Peripheral/inc/ch32v30x_tim.h"
#include "../Peripheral/inc/ch32v30x_can.h"
//#include "stdbool.h"
#include "string.h"
#include "stdarg.h"
//#define CAN_DEBUG Uncomment to use CAN LoopBack Mode
// The C167CR enters BSL mode if pin P0L.4 is sampled low at the end of a hardware reset.
constexpr const uint8_t BSL_PIN_0 = 9;
constexpr const uint8_t bootstrapCode[32] = {
//0xE6, 0x0B, 0x40, 0xFA, // MOV STKUN, #0FA40h ; Set Stack Underflow Pointer register
//0xE6, 0x0A, 0x20, 0xFA, // MOV STKOV, #0FA20h ; Set Stack Overflow Pointer register
0xE6, 0x08, 0xE0, 0xFF, // MOV CP, #0FFE0h ; Set Context Pointer register
0xE6, 0xF0, 0x00, 0x00, // MOV R0, #00000h ; Move IROM(Internal ROM) start address to R0
// WaitTransmOver:
@PL125
PL125 / GD32VF103CBT6.ino
Created February 14, 2024 19:25
First tests using Serial and CanBus (CAN0 and CAN1) on a RISC-V GD32VF103CBT6 (LILYGO T-Display)
#ifdef __cplusplus
extern "C" {
#endif
#include "gd32vf103.h"
#include "gd32vf103_rcu.h"
#include "gd32vf103_gpio.h"
#include "gd32vf103_usart.h"
#include "gd32vf103_eclic.h"
#include "gd32vf103_can.h"
#ifdef __cplusplus
@PL125
PL125 / GD32VF103CBT6.ino
Created December 25, 2023 14:14
First tests on a RISC-V GD32VF103CBT6 (LILYGO T-Display)
#ifdef __cplusplus
extern "C" {
#endif
#include "gd32vf103_rcu.h"
#include "gd32vf103_gpio.h"
#include "gd32vf103_usart.h"
#ifdef __cplusplus
}
#endif
@PL125
PL125 / ch32v203f6p6.cpp
Created December 7, 2023 12:30
First tests using CanBus and Serial on a RISC-V CH32V203F6P6
#include "debug.h"
#include "ch32v20x_can.h"
//#include "stdbool.h"
#include "string.h"
#include "stdarg.h"
constexpr uint32_t SERIAL_SPEED = 115200;
constexpr uint16_t LedPin = uint16_t(1) << 0; // PA0
constexpr uint16_t UartTxPin = uint16_t(1) << 2; // PA2