Contents Up Previous Next

HiPi::RaspberryPi

This module provides several useful functions that provide information about your Raspberry Pi


HiPi::RaspberryPi::get_cpuinfo()
    Returns a hash reference containing the
    key => value pairs extracted from /proc/cpuinfo
    with an additional key 'GPIO Revision' that
    contains the value 1 or 2 depending on your
    board revision number.

    Example Returned Hash Key Value Pairs

    'GPIO Revision'     => '2'
    'Processor'         => 'ARMv6-compatible processor rev 7 (v6l)'
    'BogoMIPS'          => '697.95'
    'Features'          => 'swp half thumb fastmult vfp edsp java tls'
    'CPU implementer'   => '0x41'
    'CPU architecture'  => '7'
    'CPU variant'       => '0x0'
    'CPU part'          => '0xb76'
    'CPU revision'      => '7'
    'Hardware'          => 'BCM2708'
    'Revision'          => '000f'
    'Serial'            => '00000000ec4805c2'

    A Model A Raspberry Pi will have 2 for the
    'GPIO Revision' value.
HiPi::RaspberryPi::get_piboard_info()
    Returns a hash reference containing information about
    your Raspberry Pi derived from the /proc/cpuinfo
    Revision value.

    the keys are: model, release, revision, memory, manufacturer

    The release value is 1 or 2 and describes the different 
    GPIO connections between the two Model B revisions.
    Model A Raspberries always hav 2 in the revision field.

    Example for a Pi with a Revision '000f'
    
    model        => 'Raspberry Pi Model B Revision 2.0'
    release      => 'Q4 2012'
    revision     => '2' 
    memory       => '512' 
    manufacturer => 'Qisda'
HiPi::RaspberryPi::get_piboard_rev()
    returns 1 or 2 - value from 'GPIO Revision' 
    member of HiPi::RaspberryPi::get_cpuinfo();
HiPi::RaspberryPi::get_validpins()
    Returns an array of GPIO pin numbers valid
    for this Raspberry Pi. (valid == connected
    to the Raspberry Pi GPIO pads.)
    For example, the first two array members
    for a Model B Revision 1 board are 0 and 1.
    The first two array members returned for
    a Module B Revision 2 or Model A board are 2 and 3




Contents Up Previous Next


HiPi Modules Copyright © 2013 Mark Dootson