Skip to content

Instantly share code, notes, and snippets.

View andresv's full-sized avatar

Andres Vahter andresv

View GitHub Profile
### INSTALLATION NOTES ###
# 1. Install Homebrew (https://github.com/mxcl/homebrew)
# 2. brew install zsh
# 3. Install OhMyZsh (https://github.com/robbyrussell/oh-my-zsh)
# 4. brew install reattach-to-user-namespace --wrap-pbcopy-pbpaste && brew link reattach-to-user-namespace
# 5. Install iTerm2
# 6. In iTerm2 preferences for your profile set:
# Character Encoding: Unicode (UTF-8)
# Report Terminal Type: xterm-256color
# 7. Put itunesartist and itunestrack into PATH
#!/usr/bin/env python
"""
Scale kicad_mod format footprint.
$ scale_kicad_mod.py 0.3 < old.kicad_mod > new.kicad_mod
The MIT License
Copyright (c) 2013 David Siroky (siroky@dasir.cz)
@andresv
andresv / gist:2252378
Created March 30, 2012 15:47
Matrix memmove
#include <stdio.h>
#include <string.h>
#include <stdint.h> //uint8_t and friends
#define ROWS 3
#define COLS 4
int main(void){
uint8_t m[ROWS][COLS] = {{1,2,3,4}, {5,6,7,8}, {9,10,11,12}};
@andresv
andresv / BridgeStation.h
Created July 31, 2012 12:21
ccbee uart test application
/*
* Copyright (c) 2012 Andres Vahter.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
@andresv
andresv / leddisplay.py
Created August 8, 2012 08:37
LED display test
import serial
import struct
import time
s = serial.Serial('/dev/tty.KeySerial1', 9600, stopbits=serial.STOPBITS_TWO, timeout=1.)
class Display(object):
def __init__(self, serial, receiver='00'):
self.s = serial
@andresv
andresv / sys_bios_i2c_example.c
Created February 4, 2013 14:30
Demonstrates how to use I2C with SYS/BIOS. It is actually little bit buggy.
EDMA3_DRV_Handle* hi2cEdma;
GIO_Handle i2c_outHandle;
GIO_Handle i2c_inHandle;
I2c_Params i2cParams;
//----------------------------------------------------------------
// Setup I2C
//----------------------------------------------------------------
void I2C_init(EDMA3_DRV_Handle* hEdma) {
I2c_ChanParams chanParams;
@andresv
andresv / vpif-conf-for-raw-capture-mode.c
Last active December 12, 2015 07:48
Demonstrates how to configure SYS/BIOS VPIF driver for RAW capture mode on C6748LCDK
#include "vpiftransfer.h"
// this must be defined here otherwise there will be Uint32 etc redefine errors
#define _TI_STD_TYPES
#include <cslr/soc_C6748.h>
#include <cslr/cslr_syscfg0_C6748.h>
#include <vpif/include/Fvid.h>
#include <vpif/include/Vpif.h>
@andresv
andresv / Configuration.h
Last active December 15, 2015 08:29
My reprap Marlin firmware configuration.
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
// This configurtion file contains the basic settings.
// Advanced settings can be found in Configuration_adv.h
// BASIC SETTINGS: select your board type, temperature sensor type, axis scaling, and endstop configuration
//User specified version info of this build to display in [Pronterface, etc] terminal window during startup.
//Implementation of an idea by Prof Braino to inform user that any changes made
//to this build by the user have been successfully uploaded into firmware.
@andresv
andresv / keybase.md
Created October 12, 2016 06:16
keybase

Keybase proof

I hereby claim:

  • I am andresv on github.
  • I am andresv (https://keybase.io/andresv) on keybase.
  • I have a public key whose fingerprint is 63CE D109 DA53 0973 CD04 5180 30A6 572C 6CA8 65C9

To claim this, I am signing this object:

@andresv
andresv / adc.rs
Created September 18, 2020 12:55
stm32g0 adc using dma
use cortex_m::asm;
use hal::stm32;
use hal::prelude::*;
use hal::analog::adc::{Precision, SampleTime};
use hal::timer::Timer;
use hal::time::Hertz;
pub type AdcBuf = [u16; 4];
pub fn init(adc_dma_buf: &AdcBuf) {