Statistics
| Branch: | Tag: | Revision:

amiro-os / include / amiro / bus / i2c / HWI2CDriver.hpp @ 3c3c3bb9

History | View | Annotate | Download (928 Bytes)

1
/*
2
 * HWI2CDriver.hpp
3
 *
4
 *  Created on: Jun 6, 2014
5
 *      Author: Robert ABEL
6
 */
7

    
8
#ifndef HWI2CDRIVER_HPP_
9
#define HWI2CDRIVER_HPP_
10

    
11
#include <ch.hpp>
12
#include <hal.h>
13
#include <amiro/bus/i2c/I2CDriver.hpp>
14

    
15
/**
16
 * @brief   AMiRo
17
 */
18
namespace amiro {
19

    
20
  struct I2CTxParams;
21
  struct I2CRxParams;
22

    
23
  /**
24
   * @brief   I²C HW Driver Abstraction
25
   */
26
  class HWI2CDriver : public I2CDriver {
27

    
28
  public:
29

    
30
    HWI2CDriver(::I2CDriver *d);
31
    virtual ~HWI2CDriver() {};
32

    
33
    virtual void start(const ::I2CConfig *config);
34
    virtual void stop();
35
    virtual i2cflags_t getErrors();
36
    virtual msg_t masterTransmit(const I2CTxParams *params, systime_t timeout = TIME_INFINITE);
37
    virtual msg_t masterReceive(const I2CRxParams *params, systime_t timeout = TIME_INFINITE);
38
    virtual void acquireBus();
39
    virtual void releaseBus();
40

    
41
  private:
42

    
43
    ::I2CDriver *driver;
44

    
45
  };
46

    
47
} /* amiro */
48

    
49
#endif /* HWI2CDRIVER_HPP_ */