Fujitsu DTV/STB solution driver (FAPex driver) Documentation [V01L00R00]


fapex/abst_libi2c.h File Reference

abstraction library header file (I2C driver) More...

Data Structures

struct  FAPEX_I2C_OpenParamStrT
 open parameters for the I2C driver More...
struct  FAPEX_I2C_RWParamStrT
 read/write parameters for the I2C driver More...

Defines

#define FAPEX_I2C0   (uint32_t) 0
 I2C0 hardware block.
#define FAPEX_I2C1   (uint32_t) 1
 I2C1 hardware block.
#define FAPEX_I2C2   (uint32_t) 2
 I2C2 hardware block.
#define FAPEX_I2C_ERR_BASE   (int32_t)(FAPEX_I2C_MODULE_BASE + FAPEX_RET_ERR_BASE)
#define FAPEX_I2C_ERR_BAD_PARAMETER   (int32_t)(FAPEX_I2C_ERR_BASE + FAPEX_ERR_BAD_PARAMETER)
#define FAPEX_I2C_ERR_OUT_OF_MEMORY   (int32_t)(FAPEX_I2C_ERR_BASE + FAPEX_ERR_OUT_OF_MEMORY)
#define FAPEX_IOCCOM_I2C_OPEN   _IOW(FAPEX_DEV_TYPE, FAPEX_IOCCOM_NB_I2C + 0, FAPEX_I2C_OpenParamStrT)
 ioctl specific command for the I2C driver
#define FAPEX_IOCCOM_I2C_SET_PROTOCOL   _IOW(FAPEX_DEV_TYPE, FAPEX_IOCCOM_NB_I2C + 1, int32_t)
#define FAPEX_IOCCOM_I2C_READ   _IOR(FAPEX_DEV_TYPE, FAPEX_IOCCOM_NB_I2C + 2, FAPEX_I2C_RWParamStrT)
#define FAPEX_IOCCOM_I2C_WRITE   _IOW(FAPEX_DEV_TYPE, FAPEX_IOCCOM_NB_I2C + 2, FAPEX_I2C_RWParamStrT)

Enumerations

enum  FAPEX_I2C_SpeedT { FAPEX_I2C_100KBPS = (int32_t)1, FAPEX_I2C_400KBPS = (int32_t)2 }
 

I2C datarate speed modes.

More...
enum  FAPEX_I2C_ProtocolT { FAPEX_I2C_COMMON_PROTOCOL = (int32_t)0, FAPEX_I2C_RESTART_PROTOCOL = (int32_t)1 }
 

Protocol modes.

More...
enum  FAPEX_I2C_TypeT { FAPEX_I2C_HARDWARE = (int32_t)0, FAPEX_I2C_SOFTWARE = (int32_t)1 }
 

I2C types.

More...
enum  FAPEX_I2C_OperationModeT { FAPEX_I2C_GENERIC_MASTER_MODE = (int32_t)0, FAPEX_I2C_GENERIC_SLAVE_MODE = (int32_t)1, FAPEX_I2C_AUTO_MASTER_MODE = (int32_t)2 }
 

I2C operation modes.

More...

Functions

FAPEXOPENRET_T FAPEX_I2C_Open (FAPEXOPENARG1_T id, FAPEXOPENARG2_T flags, FAPEXOPENARG3_T argptr)
 open method. This function is called with the systemcall "open".
FAPEXRELRET_T FAPEX_I2C_Close (FAPEXRELARG1_T id)
 release method. This function is called with the systemcall "close".
FAPEXIOCRET_T FAPEX_I2C_Ioctl (FAPEXIOCARG1_T id, FAPEXIOCARG2_T cmd, FAPEXIOCARG3_T pArg)
 ioctl method. This function is called with the systemcall "ioctl".

Detailed Description

abstraction library header file (I2C driver)

Attention:
This program is provided as is. You can redistribute it and/or modify it. Fujitsu Semiconductor Limited accepts no responsibility or liability for any errors or omissions.

Copyright (C) 2008-2010 Fujitsu Semiconductor Limited, All Rights Reserved.


Define Documentation

#define FAPEX_I2C0   (uint32_t) 0

I2C0 hardware block.

#define FAPEX_I2C1   (uint32_t) 1

I2C1 hardware block.

#define FAPEX_I2C2   (uint32_t) 2

I2C2 hardware block.

#define FAPEX_I2C_ERR_BASE   (int32_t)(FAPEX_I2C_MODULE_BASE + FAPEX_RET_ERR_BASE)

FAPex I2C error code base value

#define FAPEX_I2C_ERR_BAD_PARAMETER   (int32_t)(FAPEX_I2C_ERR_BASE + FAPEX_ERR_BAD_PARAMETER)

Bad parameter passed.

#define FAPEX_I2C_ERR_OUT_OF_MEMORY   (int32_t)(FAPEX_I2C_ERR_BASE + FAPEX_ERR_OUT_OF_MEMORY)

Memory allocation failed.

#define FAPEX_IOCCOM_I2C_OPEN   _IOW(FAPEX_DEV_TYPE, FAPEX_IOCCOM_NB_I2C + 0, FAPEX_I2C_OpenParamStrT)

ioctl specific command for the I2C driver

#define FAPEX_IOCCOM_I2C_SET_PROTOCOL   _IOW(FAPEX_DEV_TYPE, FAPEX_IOCCOM_NB_I2C + 1, int32_t)
#define FAPEX_IOCCOM_I2C_READ   _IOR(FAPEX_DEV_TYPE, FAPEX_IOCCOM_NB_I2C + 2, FAPEX_I2C_RWParamStrT)
#define FAPEX_IOCCOM_I2C_WRITE   _IOW(FAPEX_DEV_TYPE, FAPEX_IOCCOM_NB_I2C + 2, FAPEX_I2C_RWParamStrT)

Enumeration Type Documentation

I2C datarate speed modes.

This enumeration specifies the speed of the I2C bus.

See also:
FAPEX_I2C_OpenParamsT
Enumerator:
FAPEX_I2C_100KBPS 

100kHz datarate.

FAPEX_I2C_400KBPS 

400kHz datarate.

Protocol modes.

This enumeration specifies which protocol shall be used. FAPEX_I2C_RESTART_PROTOCOL is used in case a restart has to be sent after the addressing sequence.

See also:
FAPEX_I2C_SetProtocol()
Enumerator:
FAPEX_I2C_COMMON_PROTOCOL 

Common protocol.

FAPEX_I2C_RESTART_PROTOCOL 

Protocol with restart.

I2C types.

This enumeration specifies whether the I2C bus shall be run in HW mode or in SW mode.

See also:
FAPEX_I2C_OpenParamsT
Enumerator:
FAPEX_I2C_HARDWARE 

I2C hardware driver.

FAPEX_I2C_SOFTWARE 

I2C software driver.

I2C operation modes.

This enumeration covers all possible modes of operation. Software mode is determined by FAPEX_I2C_TypeT.

See also:
FAPEX_I2C_SetOperationMode()
Enumerator:
FAPEX_I2C_GENERIC_MASTER_MODE 

Generic master mode.

FAPEX_I2C_GENERIC_SLAVE_MODE 

Generic slave mode.

FAPEX_I2C_AUTO_MASTER_MODE 

Auto master mode.


Function Documentation

FAPEXOPENRET_T FAPEX_I2C_Open ( FAPEXOPENARG1_T  id,
FAPEXOPENARG2_T  flags,
FAPEXOPENARG3_T  argptr 
)

open method. This function is called with the systemcall "open".

Parameters:
idThe device identifier.
flagsThis parameter indicate a open mode (read only/write only/read-write).
This implementation supports only read-write mode.
argptrargument pointer(FAPEX_I2C_OpenParamStrT)
If descriptor for this 'id' has already been opened, this 'argptr' will be invalid.
Return values:
>=0process OK, new file descriptor is returned.
<0process fails, its value is set to errno.
FAPEXRELRET_T FAPEX_I2C_Close ( FAPEXRELARG1_T  id )

release method. This function is called with the systemcall "close".

Parameters:
idThe identifier for this descriptor.
Return values:
0process OK
<0process fails, its value is set to errno.
FAPEXIOCRET_T FAPEX_I2C_Ioctl ( FAPEXIOCARG1_T  id,
FAPEXIOCARG2_T  cmd,
FAPEXIOCARG3_T  pArg 
)

ioctl method. This function is called with the systemcall "ioctl".

Parameters:
idThe identifier for this descriptor.
cmdThe ioctl command.
pArgThe pointer to the argument of the ioctl command.
Return values:
0process OK
<0process fails, its value is set to errno.

ioctl command(cmd) type:

  • FAPEX_IOCCOM_I2C_READ
    read I2C
    Set pointer of FAPEX_I2C_RWParamStrT data field to pArg.
    Please follow the specification of the connected device about the method of setting slaveaddress and subaddress(in txData), etc.

  • FAPEX_IOCCOM_I2C_WRITE
    write I2C
    Set pointer of FAPEX_I2C_RWParamStrT data field to pArg.
    Please follow the specification of the connected device about the method of setting slaveaddress and subaddress(in txData), etc.


Copyright © 2006-2010 by Fujitsu Semiconductor Europe GmbH
Copyright © 2008-2010 by Fujitsu Semiconductor Limited

Disclaimer:
Please note that the use of this has been based on the terms and conditions of "DK Consent Letter (For Linux)" agreement between you and Fujitsu Semiconductor Limited.
The contents of this document may be revised without prior notice. Contact our sales department for confirmation. The information in this document are presented as is, no license is granted by implication or otherwise.
More...

FUJITSU sales representatives