1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/drivers/device/MicoGPIO.c Fri Aug 13 10:41:29 2010 +0100 1.3 @@ -0,0 +1,67 @@ 1.4 +/**************************************************************************** 1.5 +** 1.6 +** Name: MicoGPIO.c 1.7 +** 1.8 +** Description: 1.9 +** Implements GPIO functions: 1.10 +** 1.11 +** MicoGPIOInit : GPIO initialization funciton called by LatticeDDInit 1.12 +** (user-callable) 1.13 +** 1.14 +** 1.15 +** $Revision: $ 1.16 +** 1.17 +** Disclaimer: 1.18 +** 1.19 +** This source code is intended as a design reference which 1.20 +** illustrates how these types of functions can be implemented. It 1.21 +** is the user's responsibility to verify their design for 1.22 +** consistency and functionality through the use of formal 1.23 +** verification methods. Lattice Semiconductor provides no warranty 1.24 +** regarding the use or functionality of this code. 1.25 +** 1.26 +** -------------------------------------------------------------------- 1.27 +** 1.28 +** Lattice Semiconductor Corporation 1.29 +** 5555 NE Moore Court 1.30 +** Hillsboro, OR 97214 1.31 +** U.S.A 1.32 +** 1.33 +** TEL: 1-800-Lattice (USA and Canada) 1.34 +** (503)268-8001 (other locations) 1.35 +** 1.36 +** web: http://www.latticesemi.com 1.37 +** email: techsupport@latticesemi.com 1.38 +** 1.39 +** -------------------------------------------------------------------------- 1.40 +** 1.41 +** Change History (Latest changes on top) 1.42 +** 1.43 +** Ver Date Description 1.44 +** -------------------------------------------------------------------------- 1.45 +** 1.46 +** 3.0 Mar-25-2008 Added Header 1.47 +** 1.48 +**--------------------------------------------------------------------------- 1.49 +*****************************************************************************/ 1.50 + 1.51 +#include "MicoGPIO.h" 1.52 +#include "MicoGPIOService.h" 1.53 +#include "MicoMacros.h" 1.54 +#include "LookupServices.h" 1.55 + 1.56 + 1.57 +/****************************************************************************** 1.58 + * Initializes a gpio * 1.59 + ******************************************************************************/ 1.60 +void MicoGPIOInit( MicoGPIOCtx_t *ctx ) 1.61 +{ 1.62 + ctx->lookupReg.name = ctx->name; 1.63 + ctx->lookupReg.deviceType = "GPIODevice"; 1.64 + ctx->lookupReg.priv = ctx; 1.65 + 1.66 + MicoRegisterDevice( &(ctx->lookupReg) ); 1.67 + /* all done */ 1.68 + return; 1.69 +} 1.70 +