Skip to content

Instantly share code, notes, and snippets.

View sjfricke's full-sized avatar

Spencer Fricke sjfricke

View GitHub Profile
@sjfricke
sjfricke / i2c.c
Created January 3, 2018 23:12
Dragonboard 410c I2C ioctl wrapper
#include "i2c.h"
// File handlers if all I2C
#define I2C_MAX_BUS_COUNT 4
// initalize every counter to zero
static int I2C_FH[I2C_MAX_BUS_COUNT];
// Keeps a refernce counter of all used FH
static int I2C_FH_RC[I2C_MAX_BUS_COUNT] = { 0 };
int I2cOpen(int bus) {
@sjfricke
sjfricke / gpio.c
Last active January 18, 2018 13:33
Dragonboard 410c sysfs GPIO wrapper
#include "gpio.h"
uint16_t GpioDB410cMapping(uint16_t pin) {
// only pin 23-34
if (pin < 23 || pin > 34) {
printf("ERROR: Pin %d does not have a GPIO pin mapped\n", pin);
return 0;
}
switch(pin) {
@sjfricke
sjfricke / PocketSphinx-Dragonboard.md
Created November 17, 2017 06:53
How to get PocketSphinx to work on the Dragonboard

How to install PocketSphinx on Dragonboard Linaro

Tested on Linaro 4.9.39

Update board

  • sudo apt-get update
  • sudo apt-get upgrade
  • sudo apt-get install autoconf libtool automake bison python-dev swig libasound2-dev
@sjfricke
sjfricke / android.go
Last active September 5, 2017 14:31
adb shell setprop in Go
package main
import (
"fmt"
"os/exec"
"strings"
)
func run(args ...string) {
cmd := exec.Command("adb", args...)