Skip to content

Instantly share code, notes, and snippets.

View nuft's full-sized avatar
🐢

Michael Spieler nuft

🐢
View GitHub Profile
@nuft
nuft / nRF24L01p.c
Last active August 29, 2015 14:06
nRF24L01+ example code
#include <stdint.h>
#include <gpio.h>
#include <spi.h>
#include "nRF24L01p.h"
/*
* nRF24L01p HW interface:
* IRQ: interrupt (out)
* CE: chip enable (in)
* SPI: CSN, SCK, MOSI, MISO
@nuft
nuft / blocking_uart_driver.c
Last active August 29, 2015 14:15
minimal blocking uart driver for ChibiOS
#include <stdint.h>
#include <ch.h>
#include <hal.h>
#include "blocking_uart_driver.h"
// Virtual Methods Table
const struct BaseSequentialStreamVMT blocking_uart_put_vmt = {
blocking_uart_write,
blocking_uart_read,
blocking_uart_put,
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project source="2.13.11" version="1.0">
This file is intended to be loaded by Logisim-evolution (https://github.com/reds-heig/logisim-evolution).
<lib desc="#Wiring" name="0">
<tool name="Splitter">
<a name="facing" val="north"/>
</tool>
<tool name="Pin">
<a name="facing" val="south"/>
</tool>
@nuft
nuft / main.c
Created December 20, 2015 14:24
ARMv7-M Semihosting test
#include "ch.h"
#include "hal.h"
#include <string.h>
static THD_WORKING_AREA(waThread1, 128);
static THD_FUNCTION(Thread1, arg)
{
(void)arg;
chRegSetThreadName("blinker");
while (true) {
@nuft
nuft / process_signaux_et_systemes_polycop
Created June 14, 2017 13:54
Process a scan of double slides per page to single slide per page
#!/usr/bin/env python3
from PyPDF2 import PdfFileWriter, PdfFileReader
import argparse
import copy
parser = argparse.ArgumentParser()
parser.add_argument('original',
help='input PDF.',
metavar='INPUTFILE',)
parser.add_argument('output',
@nuft
nuft / serialport.cpp
Last active October 27, 2023 01:48
Serialport C++ example
/*
MIT License
Copyright (c) 2018, Michael Spieler
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@nuft
nuft / CMakeLists.txt
Created September 19, 2019 11:39
Eigen AutoDiff hessian tests
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(eigen_autodiff)
# Eigen library
find_package(Eigen3 3.3 REQUIRED NO_MODULE)
add_executable(
test