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

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