amiro-os / include / amiro / bus / spi / HWSPIDriver.hpp @ 2af9778e
History | View | Annotate | Download (602 Bytes)
1 |
#ifndef HWSPIDRIVER_HPP_
|
---|---|
2 |
#define HWSPIDRIVER_HPP_
|
3 |
|
4 |
#include <ch.hpp> |
5 |
#include <hal.h> |
6 |
|
7 |
/**
|
8 |
* @brief AMiRo
|
9 |
*/
|
10 |
namespace amiro {
|
11 |
|
12 |
/**
|
13 |
* @brief Input/Output driver class
|
14 |
*/
|
15 |
class HWSPIDriver { |
16 |
public:
|
17 |
HWSPIDriver(::SPIDriver *driver, const ::SPIConfig *config);
|
18 |
virtual ~HWSPIDriver();
|
19 |
void exchange(uint8_t *readData, const uint8_t *writeData, size_t length); |
20 |
void read(uint8_t *data, size_t length);
|
21 |
void write(const uint8_t *data, size_t length); |
22 |
|
23 |
private:
|
24 |
::SPIDriver *driver; |
25 |
const ::SPIConfig *config;
|
26 |
}; |
27 |
|
28 |
} /* amiro */
|
29 |
|
30 |
#endif /* HWSPIDRIVER_HPP_ */ |