Skip to content

Instantly share code, notes, and snippets.

View ntavish's full-sized avatar

Tavish Naruka ntavish

View GitHub Profile
@ntavish
ntavish / build-m8c-rg35xx-splush.sh
Created September 8, 2024 15:25 — forked from mnml/build-m8c-rg35xx-splush.sh
Building m8c for RG35XX Plus/H/SP on KNULLI (Scroll down for zip)
#!/bin/bash
#
# build kernel modules
#
wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.9.170.tar.gz
tar xzf linux-4.9.170.tar.gz
cd linux-4.9.170
wget -O .config https://raw.githubusercontent.com/knulli-cfw/distribution/knulli-main/board/batocera/allwinner/h700/rg35xx-plus/linux-sunxi64-legacy.config
{
"framework-arduinoadafruitnrf52": [
{
"sha1": "e6339357703449b588c2d1872241ffb2c810955f",
"system": "*",
"url": "http://dl.platformio.org/packages/framework-arduinoadafruitnrf52-1.1001.190508.tar.gz",
"version": "~1.0.0"
}
]
}
#!/bin/bash
SP_DEST="org.mpris.MediaPlayer2.spotify"
SP_PATH="/org/mpris/MediaPlayer2"
SP_MEMB="org.mpris.MediaPlayer2.Player"
LyricsAPI="http://makeitpersonal.co/lyrics/"
SPOTIFY_METADATA="$(dbus-send \
--print-reply `# We need the reply.` \
import board
import digitalio
import time
import busio
from adafruit_bus_device.spi_device import SPIDevice
EPD_WIDTH = 200
EPD_HEIGHT = 200
PANEL_SETTING = 0x00
@ntavish
ntavish / zephyr_install.txt
Created April 10, 2019 19:25
zephyr install summary
1. Install 'west':
pip3 install --user west
2. Clone zephyr repos with:
west init zephyrproject
3. Install python dependencies:
pip3 install --user -r zephyr/scripts/requirements.txt
4. Install Zephyr SDK:
Parsing build.hex
0x0 (16) (data) 00500020B7000000B1000000B1000000
0x10 (16) (data) B1000000B1000000B1000000B1000000
0x20 (16) (data) B1000000B1000000B1000000B1000000
0x30 (16) (data) B1000000B1000000B1000000B1000000
0x40 (16) (data) 80B483B000AF164B1B6803F1A05303F5
0x50 (16) (data) E0739B001A4601231360124A104B1B68
0x60 (16) (data) 012101FA03F3136000237B6002E07B68
0x70 (16) (data) 01337B607B680C4A9342F8DD0B4A084B
0x80 (16) (data) 1B68012101FA03F3136000233B6002E0
build.elf: file format elf32-littlearm
Disassembly of section .isr_vector:
00000000 <vectors>:
0: 20005000 andcs r5, r0, r0
4: 000000b7 strheq r0, [r0], -r7
8: 000000b1 strheq r0, [r0], -r1
c: 000000b1 strheq r0, [r0], -r1
PREFIX := arm-none-eabi-
CFLAGS += -mcpu=cortex-m4 -mthumb -g3 -o0
LDFLAGS += ${CFLAGS} -nostartfiles -nodefaultlibs -Wl,-Tlinker.ld
all: build.elf build.hex
main.o: main.c
${PREFIX}gcc ${CFLAGS} -c main.c -o main.o
@ntavish
ntavish / main.c
Created September 10, 2018 04:57
#include <stdint.h>
#define GPIO_BASE 0x50000000
#define GPIO_OUTSET (*((uint32_t*) (GPIO_BASE + 0x508)))
#define GPIO_OUTCLR (*((uint32_t*) (GPIO_BASE + 0x50C)))
#define GPIO_PIN_CNF(pin) (*((uint32_t*) (GPIO_BASE + 0x700 + pin * 4)))
unsigned int LED = 17;
int main()
#define STACK_TOP (void *)0x20005000
extern unsigned long _stext;
extern unsigned long _sbss;
extern unsigned long _sdata;
extern unsigned long _etext;
extern unsigned long _ebss;
extern unsigned long _edata;
void c_startup(void);