Changeset 15 in flair-src for trunk/lib/FlairCore/src/RTDM_I2cPort.h


Ignore:
Timestamp:
04/08/16 15:40:57 (8 years ago)
Author:
Bayard Gildas
Message:

sources reformatted with flair-format-dir script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/RTDM_I2cPort.h

    r2 r15  
    1616#include <I2cPort.h>
    1717
    18 namespace flair
    19 {
    20 namespace core
    21 {
    22     /*! \class RTDM_I2cPort
    23     *
    24     * \brief Class for real time i2c port using RTDM
    25     *
    26     * This class can only be used with the real time version of Framework library.
    27     *
    28     */
    29     class RTDM_I2cPort: public I2cPort
    30     {
    31         public:
    32             /*!
    33             * \brief Constructor
    34             *
    35             * Construct an RTDM i2c port, with the following default values: \n
    36             * - 400kbits baudrate \n
    37             * - 500000ns RX timeout \n
    38             * - 1000000ns TX timeout
    39             *
    40             * \param parent parent
    41             * \param name name
    42             * \param device i2c device (ex rti2c1)
    43             */
    44             RTDM_I2cPort(const Object* parent,std::string name,std::string device);
     18namespace flair {
     19namespace core {
     20/*! \class RTDM_I2cPort
     21*
     22* \brief Class for real time i2c port using RTDM
     23*
     24* This class can only be used with the real time version of Framework library.
     25*
     26*/
     27class RTDM_I2cPort : public I2cPort {
     28public:
     29  /*!
     30  * \brief Constructor
     31  *
     32  * Construct an RTDM i2c port, with the following default values: \n
     33  * - 400kbits baudrate \n
     34  * - 500000ns RX timeout \n
     35  * - 1000000ns TX timeout
     36  *
     37  * \param parent parent
     38  * \param name name
     39  * \param device i2c device (ex rti2c1)
     40  */
     41  RTDM_I2cPort(const Object *parent, std::string name, std::string device);
    4542
    46             /*!
    47             * \brief Destructor
    48             *
    49             */
    50             ~RTDM_I2cPort();
     43  /*!
     44  * \brief Destructor
     45  *
     46  */
     47  ~RTDM_I2cPort();
    5148
    52             /*!
    53             * \brief Set slave's address
    54             *
    55             * This method need to be called before any communication.
    56             *
    57             * \param address slave's address
    58             */
    59             int SetSlave(uint16_t address);
     49  /*!
     50  * \brief Set slave's address
     51  *
     52  * This method need to be called before any communication.
     53  *
     54  * \param address slave's address
     55  */
     56  int SetSlave(uint16_t address);
    6057
    61             /*!
    62             * \brief Write datas
    63             *
    64             * \param buf pointer to datas
    65             * \param nbyte length of datas
    66             *
    67             * \return amount of written datas
    68             */
    69             ssize_t Write(const void *buf,size_t nbyte);
     58  /*!
     59  * \brief Write datas
     60  *
     61  * \param buf pointer to datas
     62  * \param nbyte length of datas
     63  *
     64  * \return amount of written datas
     65  */
     66  ssize_t Write(const void *buf, size_t nbyte);
    7067
    71             /*!
    72             * \brief Read datas
    73             *
    74             * \param buf pointer to datas
    75             * \param nbyte length of datas
    76             *
    77             * \return amount of read datas
    78             */
    79             ssize_t Read(void *buf,size_t nbyte);
     68  /*!
     69  * \brief Read datas
     70  *
     71  * \param buf pointer to datas
     72  * \param nbyte length of datas
     73  *
     74  * \return amount of read datas
     75  */
     76  ssize_t Read(void *buf, size_t nbyte);
    8077
    81             /*!
    82             * \brief Set RX timeout
    83             *
    84             * Timeout for waiting an ACK from the slave.
    85             *
    86             * \param timeout_ns timeout in nano second
    87             */
    88             void SetRxTimeout(Time timeout_ns);
     78  /*!
     79  * \brief Set RX timeout
     80  *
     81  * Timeout for waiting an ACK from the slave.
     82  *
     83  * \param timeout_ns timeout in nano second
     84  */
     85  void SetRxTimeout(Time timeout_ns);
    8986
    90             /*!
    91             * \brief Set TX timeout
    92             *
    93             * Timeout for waiting an ACK from the slave.
    94             *
    95             * \param timeout_ns timeout in nano second
    96             */
    97             void SetTxTimeout(Time timeout_ns);
     87  /*!
     88  * \brief Set TX timeout
     89  *
     90  * Timeout for waiting an ACK from the slave.
     91  *
     92  * \param timeout_ns timeout in nano second
     93  */
     94  void SetTxTimeout(Time timeout_ns);
    9895
    99         private:
    100             int fd;
    101     };
     96private:
     97  int fd;
     98};
    10299} // end namespace core
    103100} // end namespace flair
Note: See TracChangeset for help on using the changeset viewer.