#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <inttypes.h>
#include <time.h>
#include <sys/timeb.h>
Go to the source code of this file.
| #define _POSIX_C_SOURCE 199309L |
| #define BCM2708_PERI_BASE 0x20000000 |
| #define BLOCK_SIZE (4*1024) |
| #define GET_GPIO |
( |
|
g | ) |
(*(gpio+13)&(1<<g)) |
| #define GPIO 0x00200000 /* GPIO controller */ |
| #define GPIO_CLR *(gpio+10) |
| #define GPIO_PULL *(gpio+37) |
| #define GPIO_PULLCLK0 *(gpio+38) |
| #define GPIO_SET *(gpio+7) |
| #define INP_GPIO |
( |
|
g | ) |
*(gpio+((g)/10)) &= ~(7<<(((g)%10)*3)) |
| #define ONE_MHZ_COUNTER 0x00000004 |
| #define OUT_GPIO |
( |
|
g | ) |
*(gpio+((g)/10)) |= (1<<(((g)%10)*3)) |
| #define PAGE_SIZE (4*1024) |
| #define SET_GPIO_ALT |
( |
|
g, |
|
|
|
a |
|
) |
| *(gpio+(((g)/10))) |= (((a)<=3?(a)+4:(a)==4?3:2)<<(((g)%10)*3)) |
| #define TIMER_CONTROL 0x00003000 |