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