Skip to content

Instantly share code, notes, and snippets.

View itrobotics's full-sized avatar

Joseph itrobotics

View GitHub Profile
@itrobotics
itrobotics / hello_tasklet.c
Last active March 21, 2022 09:23
simple example for tasklet in Linux kernel
/*******************************************************************************
* Copyright (c) 2015 Song Yang @ ittraining
*
* All rights reserved.
* This program is free to use, but the ban on selling behavior.
* Modify the program must keep all the original text description.
*
* 保留所有權利。
* 本程式可任意使用,但是禁止販售行為。
* 修改程式時必須保留所有原有文字說明。
@itrobotics
itrobotics / hello_tasklet.c
Last active March 16, 2021 18:07
a simple example of work_queue in Linux kernel
/*******************************************************************************
* Copyright (c) 2015 Song Yang @ ittraining
*
* All rights reserved.
* This program is free to use, but the ban on selling behavior.
* Modify the program must keep all the original text description.
*
* 保留所有權利。
* 本程式可任意使用,但是禁止販售行為。
* 修改程式時必須保留所有原有文字說明。
@itrobotics
itrobotics / arm_proj_main.py
Created April 13, 2015 06:13
arm proj main loop
#!/usr/bin/env python
from multiprocessing import Process, Queue
from time import sleep
import signal, os
from PCA9685 import PCA9685
from Joystick_usb import joystick_usb
from Arm import Arm
from LCM import LCM1602
@itrobotics
itrobotics / hello.c
Created April 13, 2015 06:25
hello world of the linux module
#include <linux/module.h>
#include <linux/init.h>
MODULE_LICENSE("Dual BSD/GPL");
static int hello_init(void)
{
printk("Hello world!\n");
return 0;
}
@itrobotics
itrobotics / hello_ko_makefile
Last active August 29, 2015 14:19
simple makefile example for hello.ko
obj-m += hello.o
KERNEL=/lib/modules/`uname -r`/build
all:
make -C $(KERNEL) M=$(shell pwd) modules V=1 ARCH=arm
clean:
make -C $(KERNEL) M=$(shell pwd) clean
@itrobotics
itrobotics / LCD1602_init.py
Created April 14, 2015 02:43
The initialization of the LCD1602 Module implemented by Python
import RPi.GPIO as GPIO
from time import sleep
def init():
GPIO.setmode(GPIO.BCM)
RS = 20
RW = 21
EN = 26
D4 = 19
D5 = 13
@itrobotics
itrobotics / LCD1602_hello.py
Last active June 7, 2018 16:36
The simple hello world example code of Python for LCD1602 module
#!/usr/bin/env python
#-*-coding:utf8-*-
import RPi.GPIO as GPIO
from time import sleep
RS = 38
RW = 40
EN = 29
D4 = 31
D5 = 33
@itrobotics
itrobotics / my_waitqueue.c
Last active September 11, 2023 07:41
a simple wait queue example for linux kernel
/*******************************************************************************
* Copyright (c) 2015 Song Yang @ ittraining
*
* All rights reserved.
* This program is free to use, but the ban on selling behavior.
* Modify the program must keep all the original text description.
*
* 保留所有權利。
* 本程式可任意使用,但是禁止販售行為。
* 修改程式時必須保留所有原有文字說明。
@itrobotics
itrobotics / my_waitqueue_never_wakeup.c
Last active June 7, 2018 16:36
a simple wait queue example code but it will never wake up.....
/*******************************************************************************
* Copyright (c) 2015 Song Yang @ ittraining
*
* All rights reserved.
* This program is free to use, but the ban on selling behavior.
* Modify the program must keep all the original text description.
*
* 保留所有權利。
* 本程式可任意使用,但是禁止販售行為。
* 修改程式時必須保留所有原有文字說明。
@itrobotics
itrobotics / my_timer.c
Last active February 12, 2023 18:31
a simple timer example of Linux module
/*******************************************************************************
* Copyright (c) 2015 Song Yang @ ittraining
*
* All rights reserved.
* This program is free to use, but the ban on selling behavior.
* Modify the program must keep all the original text description.
*
* 保留所有權利。
* 本程式可任意使用,但是禁止販售行為。
* 修改程式時必須保留所有原有文字說明。