Skip to content

Instantly share code, notes, and snippets.

View alexanderhiam's full-sized avatar
🐈

Alex Hiam alexanderhiam

🐈
View GitHub Profile
@alexanderhiam
alexanderhiam / beaglebone-4.4-pru-rproc.sh
Last active December 20, 2017 23:40
Using pru_rproc on the BeagleBone with Linux 4.4
# Good info on the current PRU remoteproc drivers here:
# http://processors.wiki.ti.com/index.php/PRU-ICSS_Remoteproc_and_RPMsg
# I mostly just followed this guide:
# https://groups.google.com/d/msg/beagleboard/od6h9yTKUD4/jzGE6KaxAQAJ
# On the BeagleBone with a 4.4 kernel:
# root@beaglebone:~# uname -r
# 4.4.11+
@alexanderhiam
alexanderhiam / beaglebone-kernel-dev.sh
Last active June 20, 2016 18:00
BeagleBone kernel dev
$ git clone https://github.com/beagleboard/linux.git
$ cd linux
$ git checkout 4.4
$ git checkout -b new-stuff
# make changes...
# build:
$ fakeroot make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bb.org_defconfig

Keybase proof

I hereby claim:

  • I am alexanderhiam on github.
  • I am graycat (https://keybase.io/graycat) on keybase.
  • I have a public key whose fingerprint is D01F 6B39 58C6 6360 CCBE BBE6 BDF4 4E9A 807D EF3E

To claim this, I am signing this object:

@alexanderhiam
alexanderhiam / weather_station.py
Created April 17, 2015 18:19
Using PyBBIO to post weather data to ThingSpeak.com
import requests
from bbio import *
from bbio.libraries.BMP183 import BMP183
from bbio.libraries.HTU21D import HTU21D
bmp = BMP183(SPI0)
htu = HTU21D(I2C2)
API_KEY = "0000000000000000" # Put your API key here
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
while (1) {
digitalWrite(x, 1);
delayus(1);
digitalWrite(x, 0);
delayus(2);
}
@alexanderhiam
alexanderhiam / pru_rpc_concept.c
Last active June 14, 2016 19:51
BeagleBone PRU remote procedure call concept
#include "pru_rpc.h"
/* This is a function that supports remote calling from the kernel or userspace.
*/
PRU_RPC_return_code RPC_digitalWrite(PRU_RPC_args *args) {
uint8_t pin, state;
if (PRU_RPC_ParseArgs(args, "bb", &pin, &state) < 0) {
return PRU_RPC_INVALID_ARGS;
}
if (state) {
@alexanderhiam
alexanderhiam / PRUDriverWrapper.py
Created February 2, 2015 17:38
PRU driver idea
class PRUDriverWrapper(object):
firmware = 'pru_driver.bin'
def __init__(self, pin1, pin2):
self.pru_driver = PRU.load(self.firmware, pin1, pin2)
def doit(self, value):
self.pru_driver.callFunction('doit', value)
def read(self):
@alexanderhiam
alexanderhiam / bbb_thermal_imager.py
Last active August 29, 2015 14:07
First whack at thermal imaging with the BeagleBone Black and AGM88xx 8x8 thermal arrays sensors
"""
bbb_thermal_imager.py
Oct. 2014
First whack at thermal imaging with the BeagleBone Black and AMG88xx 8x8
thermal arrays sensors.
Copyright (c) 2014 Alexander Hiam
Permission is hereby granted, free of charge, to any person obtaining a copy
@alexanderhiam
alexanderhiam / rs485-ioctl.py
Last active April 23, 2020 20:48
Demonstrating the BeagleBone Black's Kernel driver working in RS485 mode with Michael Musset's gpio RTS patch
import serial, fcntl, struct, time
ser = serial.Serial(
port='/dev/ttyO4',
baudrate=9600,
timeout=1,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS
)