pihwm  r1
A lightweight C library for Raspberry Pi hardware modules.
General

General library functions. More...

Functions

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

Detailed Description

General library functions.

Function Documentation

◆ board_info()

board_t board_info ( )

Return board information (Model, PCB revision and Memory)

Returns
board information

Definition at line 111 of file pihwm.c.

◆ board_mem()

int board_mem ( )

Return the amount of system memory.

Returns
MEM_256 or MEM_512

Definition at line 210 of file pihwm.c.

◆ board_model()

int board_model ( )

Return board model.

Returns
MODEL_A or MODEL_B

Definition at line 186 of file pihwm.c.

◆ board_rev()

int board_rev ( )

Return board revision.

Returns
REV_1 or REV_2

Definition at line 198 of file pihwm.c.

◆ check_kernel_module()

int check_kernel_module ( char *  modulename)

Check if the kernel module specified is loaded.

Parameters
nameof the kernel module
Returns
1 for success, -1 for failure

Definition at line 224 of file pihwm.c.