opto_ac5.h
1 // Copyright 2005-2008, various authors 2 // 3 // This program is free software; you can redistribute it and/or modify 4 // it under the terms of the GNU General Public License as published by 5 // the Free Software Foundation; either version 2 of the License, or 6 // (at your option) any later version. 7 // 8 // This program is distributed in the hope that it will be useful, 9 // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 // GNU General Public License for more details. 12 // 13 // You should have received a copy of the GNU General Public License 14 // along with this program; if not, write to the Free Software 15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 16 /************************************************************************* 17 18 Header for opto22 pci AC5 board driver 19 20 Copyright (C) 2008 Chris Morley 21 22 *************************************************************************/ 23 24 #include "hal.h" 25 26 /* code assumes that PINS_PER_PORT is <= 24 */ 27 //there are 2 ports on a opto22 pci AC5 card 28 //number of i/o per board = 48 + 4 LEDS 29 #define OPTO_NUM_DIGITAL 52 30 31 /************************************************************************* 32 Data Structures 33 *************************************************************************/ 34 typedef struct DigitalPinsParams { 35 // Pins. 36 hal_bit_t *pValue; 37 hal_bit_t *pValueNot; 38 // Parameters. 39 hal_bit_t invert; 40 } DigitalPinsParams; 41 42 43 44 typedef struct port_t { 45 __u32 mask; 46 struct DigitalPinsParams io[OPTO_NUM_DIGITAL/2]; 47 } port_t; 48 49 50 51 52 /* master board structure */ 53 typedef struct board_data_t { 54 struct pci_dev *pci_dev; /* PCI bus info */ 55 int slot; /* PCI slot number */ 56 int num; /* HAL board number */ 57 void __iomem *base; /* base address */ 58 int len; /* length of address space*/ 59 struct port_t port[2]; 60 61 62 } board_data_t; 63 64 /************************************************************************* 65 Globals 66 *************************************************************************/ 67 68 //extern int comp_id; /* HAL component ID */ 69 70 71 /************************************************************************* 72 Functions 73 *************************************************************************/ 74 75 76