summaryrefslogblamecommitdiffstats
path: root/bsps/arm/altera-cyclone-v/include/bsp/i2cdrv.h
blob: 80817e0be63259d39b2902f9b12501c104a5edd4 (plain) (tree)
1
2
3
4
5
6
7
8
9


        
                               

   


                                                                 













                                                          
   
                                           
  
                            
  
                     
  
     

   















































                                      

         




                        
/**
 * @file
 *
 * @ingroup RTEMSBSPsARMCycVI2C
 */

/*
 * Copyright (c) 2014 embedded brains GmbH.  All rights reserved.
 *
 * The license and distribution terms for this file may be
 * found in the file LICENSE in this distribution or at
 * http://www.rtems.org/license/LICENSE.
 */

#ifndef I2CDRV_H
#define I2CDRV_H

#include <rtems.h>

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/**
 * @defgroup RTEMSBSPsARMCycVI2C I2C Driver
 *
 * @ingroup RTEMSBSPsARMCycV
 *
 * @brief I2C Driver.
 *
 * @{
 */

rtems_device_driver i2cdrv_initialize(
  rtems_device_major_number major,
  rtems_device_minor_number minor,
  void *arg
);

rtems_device_driver i2cdrv_open(
  rtems_device_major_number major,
  rtems_device_minor_number minor,
  void *arg
);

rtems_device_driver i2cdrv_close(
  rtems_device_major_number major,
  rtems_device_minor_number minor,
  void *arg
);

rtems_device_driver i2cdrv_read(
  rtems_device_major_number major,
  rtems_device_minor_number minor,
  void *arg
);

rtems_device_driver i2cdrv_write(
  rtems_device_major_number major,
  rtems_device_minor_number minor,
  void *arg
);

rtems_device_driver i2cdrv_ioctl(
  rtems_device_major_number major,
  rtems_device_minor_number minor,
  void *arg
);

#define I2C_DRIVER_TABLE_ENTRY \
  { \
    i2cdrv_initialize, \
    i2cdrv_open, \
    i2cdrv_close, \
    i2cdrv_read, \
    i2cdrv_write, \
    i2cdrv_ioctl \
  }

#define I2C_IOC_SET_SLAVE_ADDRESS 1

/** @} */

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* I2CDRV_H */