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-wiced.hpp
Go to the documentation of this file.
1 
11 #ifndef SPIC_WICED_HPP_
12 #define SPIC_WICED_HPP_
13 
14 #include "../../../config/tle5012-conf.hpp"
15 
16 #if (TLE5012_FRAMEWORK == TLE5012_FRMWK_WICED)
17 
18 #include "../../../pal/spic.hpp"
19 #include <platform.h>
20 #include <wiced_platform.h>
21 #include "wiced_time.h"
22 #include "wiced_rtos.h"
23 
34 class SPICWiced: virtual public SPIC
35 {
36  private:
37  wiced_gpio_t csPin = WICED_GPIO_7;
38  wiced_gpio_t misoPin = WICED_GPIO_8;
39  wiced_gpio_t mosiPin = WICED_GPIO_6;
40  wiced_gpio_t sckPin = WICED_GPIO_5;
41  wiced_spi_t port;
42  wiced_spi_device_t spi;
43  uint8_t lsb;
44  uint8_t mode;
45  uint8_t clock;
46 
47  uint8_t sendBuffer[2];
48  uint8_t receiveBuffer[2];
49  bool spiSetting = false;
50 
51  //* @brief Definition of the SPI-Segment which contains the data for the communication
52  wiced_spi_message_segment_t segment;
53 
54  public:
55 
56  SPICWiced(wiced_gpio_t csPin);
57  SPICWiced(wiced_spi_t port, wiced_gpio_t csPin, wiced_gpio_t misoPin , wiced_gpio_t mosiPin , wiced_gpio_t sckPin );
58  ~SPICWiced();
59  Error_t init();
60  Error_t deinit();
61  Error_t transfer16(uint16_t send, uint16_t &received);
63  Error_t sendReceive(uint16_t* sent_data, uint16_t size_of_sent_data, uint16_t* received_data, uint16_t size_of_received_data);
64 
65 };
68 #endif
69 #endif
Error_t
Definition: spic.hpp:25
Definition: spic.hpp:21
Error_t deinit()
Deinitialize the SPIC.
Definition: spic-wiced.cpp:112
~SPICWiced()
Destructor of the WICED SPIC class.
Definition: spic-wiced.cpp:82
Error_t transfer16(uint16_t send, uint16_t &received)
transfers a data package via the spi bus
Definition: spic-wiced.cpp:125
SPICWiced(wiced_gpio_t csPin)
Constructor of the WICED SPIC class.
Definition: spic-wiced.cpp:42
Error_t sendReceive(uint16_t *sent_data, uint16_t size_of_sent_data, uint16_t *received_data, uint16_t size_of_received_data)
Definition: spic-wiced.cpp:162
Error_t init()
Initialize the SPIC.
Definition: spic-wiced.cpp:94
Error_t triggerUpdate()
Triggers an update in the register buffer. This function should be triggered once before UPD register...
Definition: spic-wiced.cpp:144
Wiced SPIC class.
Definition: spic-wiced.hpp:35