TLE5012B  3.1.0
The TLE5012B is a pre-calibrated 360° angle sensor that detects the orientation of a magnetic field. The raw signals (sine and cosine) are digitally processed internally to calculate the angle orientation of the magnetic field (magnet).
spic.hpp
Go to the documentation of this file.
1 
10 #include <stdint.h>
11 
12 #ifndef SPIC_HPP_
13 #define SPIC_HPP_
14 
20 class SPIC
21 {
22  public:
23 
24  enum Error_t
25  {
26  OK = 0,
27  INTF_ERROR = -1,
28  CONF_ERROR = -2,
29  READ_ERROR = -3,
30  WRITE_ERROR = -4,
31  };
32 
39  virtual Error_t init () = 0;
40 
47  virtual Error_t deinit () = 0;
48 
55  virtual Error_t triggerUpdate() = 0;
56 
68  virtual Error_t sendReceive(uint16_t* sent_data, uint16_t size_of_sent_data, uint16_t* received_data, uint16_t size_of_received_data) = 0;
69 
71 
72  private:
73  Error_t errorStatus;
74 
75 };
76 
79 #endif
virtual Error_t deinit()=0
Deinitializes the SPIC.
virtual Error_t triggerUpdate()=0
Sends a trigger through out the SPI bus.
virtual Error_t init()=0
Initializes the SPIC.
virtual Error_t sendReceive(uint16_t *sent_data, uint16_t size_of_sent_data, uint16_t *received_data, uint16_t size_of_received_data)=0
Function which allows 3wire SPI (SSC) by sending and receiving data in the same function.
Error_t
Definition: spic.hpp:25
@ INTF_ERROR
Definition: spic.hpp:27
@ READ_ERROR
Definition: spic.hpp:29
@ CONF_ERROR
Definition: spic.hpp:28
@ OK
Definition: spic.hpp:26
@ WRITE_ERROR
Definition: spic.hpp:30
Error_t checkErrorStatus()
Definition: spic.cpp:13
Definition: spic.hpp:21