Skip to content

Instantly share code, notes, and snippets.

View ciniml's full-sized avatar
🏠
Working from home

Kenta IDA ciniml

🏠
Working from home
View GitHub Profile
@ciniml
ciniml / code.py
Created June 7, 2021 20:32
Measure voltage, current and power with Circuit Python on RPi Pico
from board import *
from busio import I2C
import struct
import time
i2c = I2C(GP21, GP20)
i2c.try_lock()
vm_address = 0x49
cm_address = 0x48
@ciniml
ciniml / M5Paper.ino
Created November 28, 2020 22:06
M5Paper Storage Benchmark
#include <M5EPD.h>
#include <Free_Fonts.h>
#include <WiFi.h>
#include <lwip/sockets.h>
#include <lwip/netdb.h>
#include <cstdio>
#include <cstdlib>
#include <cstdint>
#include <cstring>
@ciniml
ciniml / erpc_debug_passthrough.ino
Created November 17, 2020 02:02
Wio Terminal RTL8720D UART Transport Passthrough
#include <wiring_private.h>
#define PIN_BLE_SERIAL_X_RX (84ul)
#define PIN_BLE_SERIAL_X_TX (85ul)
#define PAD_BLE_SERIAL_X_RX (SERCOM_RX_PAD_2)
#define PAD_BLE_SERIAL_X_TX (UART_TX_PAD_0)
#define SERCOM_BLE_SERIAL_X sercom0
static Uart rtl_uart(&SERCOM_BLE_SERIAL_X, PIN_BLE_SERIAL_X_RX, PIN_BLE_SERIAL_X_TX, PAD_BLE_SERIAL_X_RX, PAD_BLE_SERIAL_X_TX);
@ciniml
ciniml / fpga-load.dts
Created October 21, 2020 11:14
Device Tree Overlay Sample
/dts-v1/;
/ {
fragment@0 {
target-path = "/fpga-full";
__overlay__ {
firmware-name = "fpga.bin";
};
};
};
@ciniml
ciniml / ieee_1800_2017_example_4_initial.sv
Created July 12, 2020 07:55
ieee_1800_2017_example_4_initial
module multiple;
logic a;
initial a = 1;
// The assigned value of the variable is determinate
initial begin
a <= #4 0; // schedules a = 0 at time 4
a <= #4 1; // schedules a = 1 at time 4
end // At time 4, a = 1
endmodule
@ciniml
ciniml / ISRBlink.ino
Last active January 21, 2025 04:42
Wio Terminal TC interrupt sample (separated)
@ciniml
ciniml / ISRBlink.ino
Created June 18, 2020 19:33
WioTerminal TC3 sample
@ciniml
ciniml / grove_left_uart.ino
Last active June 10, 2024 04:15
Wio Terminal Grove UART
#include <wiring_private.h>
static Uart Serial3(&sercom3, PIN_WIRE_SCL, PIN_WIRE_SDA, SERCOM_RX_PAD_1, UART_TX_PAD_0);
void setup() {
Serial.begin(115200);
while(!Serial);
Serial3.begin(115200);
pinPeripheral(PIN_WIRE_SCL, PIO_SERCOM_ALT);
@ciniml
ciniml / flash_accesss.ino
Created May 14, 2020 16:25
Wio Terminal External Flash Test
#include <TFT_eSPI.h>
#include <cstdint>
unsigned char boot_bin[] = {
0x00, 0x00, 0x03, 0x20, 0x09, 0x00, 0x00, 0x04, 0x80, 0xb5, 0x00, 0xaf,
0x88, 0xb0, 0x00, 0xf0, 0x4d, 0xf8, 0x07, 0x90, 0x07, 0x98, 0x01, 0x21,
0xca, 0x03, 0x82, 0x60, 0x03, 0x91, 0x00, 0xf0, 0x4d, 0xf8, 0x06, 0x90,
0x06, 0x98, 0x03, 0x99, 0xca, 0x02, 0x82, 0x60, 0x06, 0x98, 0x82, 0x61,
0xff, 0xe7, 0x07, 0x98, 0x01, 0x21, 0xca, 0x03, 0xc2, 0x61, 0x05, 0x91,
0xff, 0xe7, 0x05, 0x98, 0x15, 0x49, 0x88, 0x42, 0x18, 0xd8, 0xff, 0xe7,
0x06, 0x98, 0x01, 0x21, 0xc9, 0x02, 0xc1, 0x61, 0x00, 0x20, 0x04, 0x90,
@ciniml
ciniml / c_cpp_properties.json
Created May 14, 2020 05:29
VSCode settings for Wio Terminal + arduino-cli
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"${env:HONE}/.arduino15/packages/Seeeduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include",
"${env:HOME}/.arduino15/packages/Seeeduino/tools/CMSIS/**",
"${env:HOME}/.arduino15/packages/Seeeduino/tools/CMSIS-Atmel/**",
"${env:HOME}/.arduino15/packages/Seeeduino/hardware/samd/1.7.5/**",