Skip to content

Instantly share code, notes, and snippets.

View andy-shev's full-sized avatar

Andy Shevchenko andy-shev

View GitHub Profile

Keybase proof

I hereby claim:

  • I am andy-shev on github.
  • I am 0andriy (https://keybase.io/0andriy) on keybase.
  • I have a public key whose fingerprint is 8626 4E52 59C2 F682 8DDE 7DC0 993D FFF3 7739 4B2D

To claim this, I am signing this object:

@andy-shev
andy-shev / fdcalc.py
Last active August 29, 2015 14:16
Fractional divider calculator
#!/usr/bin/python -tt
# -*- coding: UTF-8 -*-
# vim: ts=4 sw=4 et ai si
import sys
import os
import operator
import math
import fractions
@andy-shev
andy-shev / fdcalcpwm.py
Last active June 24, 2016 09:51
Fractional divider for LPSS PWM
#!/usr/bin/python -tt
# -*- coding: UTF-8 -*-
# vim: ts=4 sw=4 et ai si
import sys
import os
import operator
import math
import fractions
@andy-shev
andy-shev / pincfg.py
Last active January 17, 2017 20:33
Pack value with scale
#!/usr/bin/python -tt
# -*- coding: UTF-8 -*-
# vim: ts=4 sw=4 et ai si
from __future__ import print_function
import sys
import os
import math
@andy-shev
andy-shev / bst.sh
Created March 19, 2018 15:38 — forked from iestynpryce/bst.sh
An implementation of a Binary Sort Tree in Bash. Object-like behaviour has been faked using eval. Remember that eval in shell scripting can be evil.
#!/bin/sh -efu
#
# Binary search tree is of the form:
# 10
# / \
# / \
# 4 16
# / \ /
# 1 7 12
#
@andy-shev
andy-shev / irq_flags_mismatch.py
Last active August 1, 2018 20:41
IRQ flag mismatch logic in __setup_irq() in Linux kernel for shared interrupts
#!/usr/bin/python -tt
# -*- coding: UTF-8 -*-
# vim: ts=4 sw=4 et ai si
from __future__ import print_function
import sys
import os
import itertools
@andy-shev
andy-shev / prepare-u-boot.sh
Last active February 21, 2019 15:42
Create U-Boot image suitable for xFSTK and DFU for Intel Edison
#!/bin/sh
#
# Required: xz, crc32, xxd, xfst-dldr-solo, dfu-util
#
# Version for stable edison-v2016.11 and edison-v2017.01
#dd if=u-boot.bin of=u-boot-4k.bin bs=4k seek=1 && truncate -s %4096 u-boot-4k.bin
# OSIP header (0x000000)
@andy-shev
andy-shev / fdcalc8250.py
Last active January 14, 2020 17:50
Fractional divider calculator for Synopsys DesignWare UART (8250) v4.00a and newer
#!/usr/bin/python -tt
# -*- coding: UTF-8 -*-
# vim: ts=4 sw=4 et ai si
from __future__ import print_function
import sys
import os
import math
@andy-shev
andy-shev / Test FAT32 Image
Last active January 27, 2020 16:31
mmc-fat-part
Test Fat32 image
@andy-shev
andy-shev / .gitignore
Last active May 11, 2020 20:50
Git version to C file
version.h
module
*.o