drivers/device/MicoGPIO.c

Fri, 13 Aug 2010 10:41:29 +0100

author
Philip Pemberton <philpem@philpem.me.uk>
date
Fri, 13 Aug 2010 10:41:29 +0100
changeset 0
267b5a25932f
permissions
-rw-r--r--

Initial commit, GPIO v3.1

     1 /****************************************************************************
     2 **
     3 **  Name: MicoGPIO.c
     4 **
     5 **  Description:
     6 **     Implements GPIO functions:
     7 **
     8 **        MicoGPIOInit : GPIO initialization funciton called by LatticeDDInit
     9 **                 (user-callable)
    10 **        
    11 **
    12 **  $Revision: $
    13 **
    14 ** Disclaimer:
    15 **
    16 **   This source code is intended as a design reference which
    17 **   illustrates how these types of functions can be implemented.  It
    18 **   is the user's responsibility to verify their design for
    19 **   consistency and functionality through the use of formal
    20 **   verification methods.  Lattice Semiconductor provides no warranty
    21 **   regarding the use or functionality of this code.
    22 **
    23 ** --------------------------------------------------------------------
    24 **
    25 **                     Lattice Semiconductor Corporation
    26 **                     5555 NE Moore Court
    27 **                     Hillsboro, OR 97214
    28 **                     U.S.A
    29 **
    30 **                     TEL: 1-800-Lattice (USA and Canada)
    31 **                          (503)268-8001 (other locations)
    32 **
    33 **                     web:   http://www.latticesemi.com
    34 **                     email: techsupport@latticesemi.com
    35 **
    36 ** --------------------------------------------------------------------------
    37 **
    38 **  Change History (Latest changes on top)
    39 **
    40 **  Ver    Date        Description
    41 ** --------------------------------------------------------------------------
    42 **
    43 **  3.0   Mar-25-2008  Added Header
    44 **
    45 **---------------------------------------------------------------------------
    46 *****************************************************************************/
    48 #include "MicoGPIO.h"
    49 #include "MicoGPIOService.h"
    50 #include "MicoMacros.h"
    51 #include "LookupServices.h"
    54 /******************************************************************************
    55  * Initializes a gpio                                                         *
    56  ******************************************************************************/
    57 void MicoGPIOInit( MicoGPIOCtx_t *ctx )
    58 {
    59     ctx->lookupReg.name = ctx->name;
    60     ctx->lookupReg.deviceType = "GPIODevice";
    61     ctx->lookupReg.priv = ctx;
    63     MicoRegisterDevice( &(ctx->lookupReg) );
    64     /* all done */
    65     return;
    66 }