bindings-parport (empty) → 0.0.1
raw patch · 4 files changed
+190/−0 lines, 4 filesdep +basedep +bindings-DSLsetup-changed
Dependencies added: base, bindings-DSL
Files
- LICENSE +29/−0
- Setup.hs +6/−0
- bindings-parport.cabal +25/−0
- src/Bindings/Parport.hsc +130/−0
+ LICENSE view
@@ -0,0 +1,29 @@+Copyright (c) <2009>, <Maurício C. Antunes>+All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are+met:++ * Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer.++ * Redistributions in binary form must reproduce the above copyright+ notice, this list of conditions and the following disclaimer in the+ documentation and/or other materials provided with the distribution.++ * Neither the name of the author nor the names of contributors+ may be used to endorse or promote products derived from this+ software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED+TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ Setup.hs view
@@ -0,0 +1,6 @@+#!/usr/bin/env runhaskell++module Main (main) where+import Distribution.Simple++main = defaultMain
+ bindings-parport.cabal view
@@ -0,0 +1,25 @@+Name: bindings-parport+Version: 0.0.1+Cabal-version: >= 1.2.3+Synopsis: parport bindings+License: BSD3+License-file: LICENSE+Maintainer: sivaramreddy@hotmail.com+Author: Sivaram Gowkanapalli+Build-type: Simple+Category: FFI++Library+ HS-Source-Dirs: src+ GHC-Options: -Wall+ Extensions: ForeignFunctionInterface+ FunctionalDependencies,+ MultiParamTypeClasses,+ DeriveDataTypeable,+ StandaloneDeriving,+ TypeSynonymInstances+ Build-Depends: base >= 3 && < 5,+ bindings-DSL >= 1.0+ Exposed-Modules: Bindings.Parport+ Build-tools: hsc2hs+
+ src/Bindings/Parport.hsc view
@@ -0,0 +1,130 @@++{-# OPTIONS_GHC -Wall #-}+{-# LANGUAGE DeriveDataTypeable , ForeignFunctionInterface #-}++#include <bindings.dsl.h>+#include <linux/parport.h>++module Bindings.Parport where+#strict_import++{- Start off with user-visible constants -}++{- Maximum of 16 ports per machine -}+#num PARPORT_MAX+++{- Magic numbers -}+#num PARPORT_IRQ_NONE++#num PARPORT_DMA_NONE++#num PARPORT_IRQ_AUTO++#num PARPORT_DMA_AUTO++#num PARPORT_DMA_NOFIFO++#num PARPORT_DISABLE++#num PARPORT_IRQ_PROBEONLY++#num PARPORT_IOHI_AUTO+++#num PARPORT_CONTROL_STROBE++#num PARPORT_CONTROL_AUTOFD++#num PARPORT_CONTROL_INIT++#num PARPORT_CONTROL_SELECT+++#num PARPORT_STATUS_ERROR++#num PARPORT_STATUS_SELECT++#num PARPORT_STATUS_PAPEROUT++#num PARPORT_STATUS_ACK++#num PARPORT_STATUS_BUSY+++{- Type classes for Plug-and-Play probe. -}+-- typedef enum {+#num PARPORT_CLASS_LEGACY+#num PARPORT_CLASS_PRINTER+#num PARPORT_CLASS_MODEM+#num PARPORT_CLASS_NET+#num PARPORT_CLASS_HDC+#num PARPORT_CLASS_PCMCIA+#num PARPORT_CLASS_MEDIA+#num PARPORT_CLASS_FDC+#num PARPORT_CLASS_PORTS+#num PARPORT_CLASS_SCANNER+#num PARPORT_CLASS_DIGCAM+#num PARPORT_CLASS_OTHER+#num PARPORT_CLASS_UNSPEC+#num PARPORT_CLASS_SCSIADAPTER+-- } parport_device_class;++{- The "modes" entry in parport is a bit field representing the+ capabilities of the hardware. -}+#num PARPORT_MODE_PCSPP++#num PARPORT_MODE_TRISTATE++#num PARPORT_MODE_EPP++#num PARPORT_MODE_ECP++#num PARPORT_MODE_COMPAT++#num PARPORT_MODE_DMA++#num PARPORT_MODE_SAFEININT+++{- IEEE1284 modes:+ Nibble mode, byte mode, ECP, ECPRLE and EPP are their own+ 'extensibility request' values. Others are special.+ 'Real' ECP modes must have the IEEE1284_MODE_ECP bit set. -}+#num IEEE1284_MODE_NIBBLE++#num IEEE1284_MODE_BYTE++#num IEEE1284_MODE_COMPAT++#num IEEE1284_MODE_BECP++#num IEEE1284_MODE_ECP++#num IEEE1284_MODE_ECPRLE++#num IEEE1284_MODE_ECPSWE++#num IEEE1284_MODE_EPP++#num IEEE1284_MODE_EPPSL++#num IEEE1284_MODE_EPPSWE++#num IEEE1284_DEVICEID++#num IEEE1284_EXT_LINK++{- For the benefit of parport_read/write, you can use these with+ * parport_negotiate to use address operations. They have no effect+ * other than to make parport_read/write use address transfers. -}+#num IEEE1284_ADDR++#num IEEE1284_DATA+++{- Flags for block transfer operations. -}+#num PARPORT_EPP_FAST++#num PARPORT_W91284PIC+