#include <linux/module.h>#include <linux/sched.h>#include <linux/slab.h>#include <linux/errno.h>#include <linux/kernel.h>#include <linux/fs.h>#include <linux/string.h>#include <linux/init.h>#include <linux/autoconf.h>#include <asm/system.h>#include <asm/svinto.h>#include <asm/io.h>#include <asm/irq.h>#include <asm/delay.h>#include <asm/uaccess.h>#include <asm/fpgaconfa.h>#include "fpgaconf.h"#include "fpgaconfi2c.h"Include dependency graph for fpgaconfi2c.c:

Go to the source code of this file.
| Defines | |
| #define | D(x) | 
| #define | XCLOCK_LOW_TIME 8 | 
| #define | XCLOCK_HIGH_TIME 8 | 
| #define | XSTART_CONDITION_HOLD_TIME 8 | 
| #define | XSTOP_CONDITION_HOLD_TIME 8 | 
| #define | XENABLE_OUTPUT 0x01 | 
| #define | XENABLE_INPUT 0x00 | 
| #define | XI2C_CLOCK_HIGH 1 | 
| #define | XI2C_CLOCK_LOW 0 | 
| #define | XI2C_DATA_HIGH 1 | 
| #define | XI2C_DATA_LOW 0 | 
| #define | xi2c_delay(usecs) udelay(usecs) | 
| #define | xi2c_disable *R_PORT_PB_SET=(portb_shadow = 0x0203) | 
| #define | xi2c_dir_out *R_PORT_PB_SET=(portb_shadow = 0x0303) | 
| #define | xi2c_dir_in *R_PORT_PB_SET=(portb_shadow = 0x0203) | 
| #define | xi2c_scl_0 *R_PORT_PB_SET=(portb_shadow &= 0x0301) | 
| #define | xi2c_scl_1 *R_PORT_PB_SET=(portb_shadow |= 0x0002) | 
| #define | xi2c_sda(x) *R_PORT_PB_SET=(portb_shadow = (portb_shadow & 0x0002) | 0x0300 | ((x)? 1:0)); | 
| #define | xi2c_getbit (*R_PORT_PB_READ & 1) | 
| #define | xi2c_getscl ((*R_PORT_PB_READ >>1) & 1) | 
| #define | CY223933_SA 0xd2 | 
| Functions | |
| int | xi2c_diagnose (void) | 
| int | xi2c_start (void) | 
| void | xi2c_stop (void) | 
| int | xi2c_outbyte (unsigned char d) | 
| unsigned char | xi2c_inbyte (void) | 
| void | xi2c_sendack (void) | 
| int | setCYField (int addr, int mask, int value) | 
| void | initPortB (void) | 
| int | fi2c_writeData (unsigned char theSlave, unsigned char *theData, int size) | 
| int | fi2c_readData (unsigned char theSlave, unsigned char *theData, int size) | 
| int | fi2c_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) | 
| int | setClockFreq (int nclock, int freq) | 
| Variables | |
| static unsigned long | portb_shadow = 0x0000fe03 | 
| #define CY223933_SA 0xd2 | 
Definition at line 384 of file fpgaconfi2c.c.
| #define D | ( | x | ) | 
*************************************************************************** fpgaconfi2c.c
Definition at line 32 of file fpgaconfi2c.c.
| #define XCLOCK_HIGH_TIME 8 | 
Definition at line 36 of file fpgaconfi2c.c.
| #define XCLOCK_LOW_TIME 8 | 
Definition at line 35 of file fpgaconfi2c.c.
| #define XENABLE_INPUT 0x00 | 
Definition at line 40 of file fpgaconfi2c.c.
| #define XENABLE_OUTPUT 0x01 | 
Definition at line 39 of file fpgaconfi2c.c.
| #define XI2C_CLOCK_HIGH 1 | 
Definition at line 41 of file fpgaconfi2c.c.
| #define XI2C_CLOCK_LOW 0 | 
Definition at line 42 of file fpgaconfi2c.c.
| #define XI2C_DATA_HIGH 1 | 
Definition at line 43 of file fpgaconfi2c.c.
| #define XI2C_DATA_LOW 0 | 
Definition at line 44 of file fpgaconfi2c.c.
| #define xi2c_delay | ( | usecs | ) | udelay(usecs) | 
Definition at line 63 of file fpgaconfi2c.c.
| #define xi2c_dir_in *R_PORT_PB_SET=(portb_shadow = 0x0203) | 
Definition at line 84 of file fpgaconfi2c.c.
| #define xi2c_dir_out *R_PORT_PB_SET=(portb_shadow = 0x0303) | 
Definition at line 83 of file fpgaconfi2c.c.
| #define xi2c_disable *R_PORT_PB_SET=(portb_shadow = 0x0203) | 
Definition at line 82 of file fpgaconfi2c.c.
Referenced by initPortB(), xi2c_diagnose(), xi2c_nostop(), and xi2c_start().
| #define xi2c_getbit (*R_PORT_PB_READ & 1) | 
Definition at line 88 of file fpgaconfi2c.c.
Referenced by xi2c_diagnose(), xi2c_inbyte(), xi2c_outbyte(), and xi2c_start().
| #define xi2c_getscl ((*R_PORT_PB_READ >>1) & 1) | 
| #define xi2c_scl_0 *R_PORT_PB_SET=(portb_shadow &= 0x0301) | 
Definition at line 85 of file fpgaconfi2c.c.
| #define xi2c_scl_1 *R_PORT_PB_SET=(portb_shadow |= 0x0002) | 
Definition at line 86 of file fpgaconfi2c.c.
| #define xi2c_sda | ( | x | ) | *R_PORT_PB_SET=(portb_shadow = (portb_shadow & 0x0002) | 0x0300 | ((x)? 1:0)); | 
Definition at line 87 of file fpgaconfi2c.c.
Referenced by xi2c_diagnose(), xi2c_inbyte(), xi2c_nostop(), xi2c_outbyte(), xi2c_sendack(), xi2c_start(), and xi2c_stop().
| #define XSTART_CONDITION_HOLD_TIME 8 | 
Definition at line 37 of file fpgaconfi2c.c.
| #define XSTOP_CONDITION_HOLD_TIME 8 | 
Definition at line 38 of file fpgaconfi2c.c.
| int fi2c_ioctl | ( | struct inode * | inode, | |
| struct file * | file, | |||
| unsigned int | cmd, | |||
| unsigned long | arg | |||
| ) | 
Definition at line 334 of file fpgaconfi2c.c.
References D, data, error(), fi2c_readData(), fi2c_writeData(), FPGACONF_IOCTYPE, I2C_ARGREG, I2C_ARGSLAVE, I2C_ARGVALUE, I2C_READREG, I2C_WRITEREG, and printk.
| int fi2c_readData | ( | unsigned char | theSlave, | |
| unsigned char * | theData, | |||
| int | size | |||
| ) | 
Definition at line 312 of file fpgaconfi2c.c.
References D, ERR_I2C_BSY, error(), printk, xi2c_inbyte(), xi2c_outbyte(), xi2c_sendack(), xi2c_start(), and xi2c_stop().
| int fi2c_writeData | ( | unsigned char | theSlave, | |
| unsigned char * | theData, | |||
| int | size | |||
| ) | 
Definition at line 281 of file fpgaconfi2c.c.
References D, ERR_I2C_BSY, ERR_I2C_NACK, error(), printk, xi2c_outbyte(), xi2c_start(), and xi2c_stop().
| void initPortB | ( | void | ) | 
| int setClockFreq | ( | int | nclock, | |
| int | freq | |||
| ) | 
| int setCYField | ( | int | addr, | |
| int | mask, | |||
| int | value | |||
| ) | 
| int xi2c_diagnose | ( | void | ) | 
| unsigned char xi2c_inbyte | ( | void | ) | 
| int xi2c_outbyte | ( | unsigned char | d | ) | 
| void xi2c_sendack | ( | void | ) | 
| int xi2c_start | ( | void | ) | 
| void xi2c_stop | ( | void | ) | 
| unsigned long portb_shadow = 0x0000fe03  [static] | 
 1.5.1
 1.5.1