Skip to content

Instantly share code, notes, and snippets.

View xueliu's full-sized avatar
🏠
Working from home

Xue Liu xueliu

🏠
Working from home
View GitHub Profile
@xueliu
xueliu / stm32f746_uboot_flash.sh
Last active September 26, 2020 22:04
stm32f746 uboot openocd
#!/bin/bash
openocd -f interface/stlink-v2-1.cfg -f board/stm32f7discovery.cfg \
-c "init" \
-c "reset init" \
-c "flash probe 0" \
-c "flash info 0" \
-c "flash write_image erase $UBOOT_PATH/spl/u-boot-spl.bin 0x08000000" \
-c "flash write_image erase $UBOOT_PATH/u-boot.bin 0x08008000" \
-c "reset run" \
cmake_minimum_required(VERSION 3.1)
include(CMakeParseArguments)
macro(open_eebus_project)
#message(DEBUG "---- processing open_eebus_project")
set(options DEBUG)
set(oneValueArgs
#include <iostream>
#include <string>
#include <array>
#include <functional>
using namespace std;
class NodeManager {
private:
#include <cstdint>
// normal device class e.g., i2c, spi
class Device {
public:
Device() {}
bool write8(uint8_t page, uint8_t addr, uint8_t v)
{
return true;
}
1. digital last
1.1 switch-off/max-off/min-off
{signal:
[
{name: 'Switch Off Req', wave: '010.....'},
{name: 'ELA', wave: '01....0.'},
{name: 'Active', wave: '1.0....1'},
{name: 'Max Off Timer', wave: '0.1...0.'},
{name: 'Min Off Timer', wave: '0.1.0...'},
{name: 'Switch On Block', wave: '0.1.0...'},
#include <iostream>
#include <memory>
#include <mutex>
#include <unordered_map>
using namespace std;
class Stock
{
public:
#!/bin/bash
g++ -std=c++14 main.cpp publisher.cpp -o app -lavahi-core -lavahi-common -lavahi-client
#include <iostream>
#include <thread>
#include <mutex>
class Comm
{
private:
Comm() {}
#!/bin/sh
qemu-system-arm \
-M vexpress-a9 -smp 1 \
-m 256 \
-kernel output/images/zImage \
-dtb output/images/vexpress-v2p-ca9.dtb \
-drive file=output/images/rootfs.ext2,if=sd,format=raw \
-append "console=ttyAMA0,115200 root=/dev/mmcblk0" \
-net nic,model=lan9118 \
#!/bin/bash
echo "21" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio21/direction
echo "1" > /sys/class/gpio/gpio21/value
sleep 5
echo "0" > /sys/class/gpio/gpio21/value
sleep 1
echo "0" > /sys/class/gpio/gpio21/value