Skip to content

Instantly share code, notes, and snippets.

View itrobotics's full-sized avatar

Joseph itrobotics

View GitHub Profile
@itrobotics
itrobotics / Systimer.c
Last active February 7, 2022 15:43
Systimer
void My_Main(void)
{
GPIO_GPFSEL4 |= (0x1 << 21);
GPIO_GPFSEL4 &= ~(0x6 << 21);
// set bit 21~23 to 0b001, so GPIO 47 is an output pin
GPIO_GPCLR1 |= (0x1 << 15); // set GPIO 47 output low (LED off)
INT_DISIRQ1 = 0xFFFFFFFF;
INT_DISIRQ2 = 0xFFFFFFFF;
INT_DISBIRQ = 0xFF;
void SendByte( uint8 byte_value )
{
uint16 i;
uint8 cycle_cnt;
cycle_cnt = 8;
for( i= 0; i < cycle_cnt; i++ )
{
if ( (byte_value & IO_MASK) == 0x80 ){
SI = 1;
}
#include <stdio.h>
#include <stdlib.h>
#define MAX 1000
void find_peak(int *a,int size);
int main(void)
{
FILE *fp;
int i=0,v;
int data[MAX];
#include <stdio.h>
#define MAX_TITLE 32
#define MAX_SUBMENUS 16
typedef struct _menu menu;
struct _menu {
char title[MAX_TITLE];
void (*command)(int data);
@itrobotics
itrobotics / python_resources.md
Last active August 29, 2015 14:26 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

@itrobotics
itrobotics / 0_reuse_code.js
Last active August 29, 2015 14:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@itrobotics
itrobotics / platform_driver_spi.c
Created May 14, 2015 01:41
a linux driver example code to demo platform_driver of Raspberry Pi which simple show the SPI-FLASH ID
// Simple Character Device Driver Module for Raspberry Pi.
#include <linux/module.h>
#include <linux/string.h>
#include <linux/fs.h>
#include <asm/uaccess.h>
#include <linux/init.h>
#include <linux/cdev.h>
#include <linux/device.h>
@itrobotics
itrobotics / platform_device_spi.c
Created May 14, 2015 01:39
a linux driver example code to demo platform_device for Raspberry Pi SPI
/*
* onionys@IT-Robotics-Lab, Feb 4, 2015
* blog:
* email: [email protected]
*
* */
#include <linux/module.h>
#include <linux/string.h>
#include <linux/fs.h>
@itrobotics
itrobotics / dummy_platform_device.c
Created May 14, 2015 01:26
a linux driver example code to demo platform_device
// Simple Platform Device Module for Raspberry Pi.
#include <linux/module.h>
#include <linux/string.h>
#include <linux/fs.h>
#include <asm/uaccess.h>
#include <linux/init.h>
#include <linux/cdev.h>
#include <linux/device.h>
@itrobotics
itrobotics / dummy_platform_driver.c
Created May 14, 2015 01:25
a linux driver example code to demo platofrm_driver
// Simple Platform Device Driver Module for Raspberry Pi.
#include <linux/module.h>
#include <linux/string.h>
#include <linux/fs.h>
#include <asm/uaccess.h>
#include <linux/init.h>
#include <linux/cdev.h>
#include <linux/device.h>