pihwm
A lightweight C library for Raspberry Pi hardware modules.
 All Data Structures Files Functions Groups Pages
pihwm.h File Reference

Header for general library functionality. More...

#include <stdio.h>
#include <unistd.h>

Go to the source code of this file.

Data Structures

struct  board_t
 

Macros

#define MODEL_A   100
 
#define MODEL_B   200
 
#define REV_1   10
 
#define REV_2   20
 
#define MEM_256   1
 
#define MEM_512   2
 
#define debug(...)   ;
 
#define delay(d)   usleep(d*1000);
 
#define delayMicroseconds(d)   usleep(d);
 
#define delaySeconds(d)   sleep(d);
 
#define a(...)   (unsigned char[])__VA_ARGS__
 
#define size(a)   (sizeof(a) / sizeof((a)[0]))
 

Functions

board_t board_info ()
 Return board information (Model, PCB revision and Memory)
 
int board_model ()
 Return board model.
 
int board_rev ()
 Return board revision.
 
int board_mem ()
 Return the amount of system memory.
 
int check_kernel_module (char *modulename)
 Check if the kernel module specified is loaded.
 

Detailed Description

Header for general library functionality.

Author
Omer Kilic omerk.nosp@m.ilic.nosp@m.@gmai.nosp@m.l.co.nosp@m.m - Erlang Solutions
Jeremy Bennett jerem.nosp@m.y.be.nosp@m.nnett.nosp@m.@emb.nosp@m.ecosm.nosp@m..com - Embecosm Limited

LICENSE

Copyright (C) 2013 Omer Kilic omerk.nosp@m.ilic.nosp@m.@gmai.nosp@m.l.co.nosp@m.m - Erlang Solutions Copyright (C) 2013 Jeremy Bennett jerem.nosp@m.y.be.nosp@m.nnett.nosp@m.@emb.nosp@m.ecosm.nosp@m..com - Embecosm Limited

This file is part of pihwm http://omerk.github.io/pihwm

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file pihwm.h.