APDS-9130 library
Prox.h@0:10fe9a5a884f, 2016-01-04 (annotated)
- Committer:
- sleighton
- Date:
- Mon Jan 04 12:28:26 2016 +0000
- Revision:
- 0:10fe9a5a884f
- Child:
- 1:159407640167
Working version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sleighton | 0:10fe9a5a884f | 1 | #include "mbed.h" |
sleighton | 0:10fe9a5a884f | 2 | |
sleighton | 0:10fe9a5a884f | 3 | /** interface class for configuring, sending and recieving data using an APDS-9130 */ |
sleighton | 0:10fe9a5a884f | 4 | class Prox |
sleighton | 0:10fe9a5a884f | 5 | { |
sleighton | 0:10fe9a5a884f | 6 | private: |
sleighton | 0:10fe9a5a884f | 7 | PinName _sda; |
sleighton | 0:10fe9a5a884f | 8 | PinName _scl; |
sleighton | 0:10fe9a5a884f | 9 | |
sleighton | 0:10fe9a5a884f | 10 | public: |
sleighton | 0:10fe9a5a884f | 11 | |
sleighton | 0:10fe9a5a884f | 12 | Prox(PinName sda, PinName scl); |
sleighton | 0:10fe9a5a884f | 13 | |
sleighton | 0:10fe9a5a884f | 14 | void ReadWord(char addr, char reg, uint8_t *data); |
sleighton | 0:10fe9a5a884f | 15 | void ReadByte(char addr, char reg, char *bytedata); |
sleighton | 0:10fe9a5a884f | 16 | void WriteByte(uint8_t addr, uint8_t reg, char data); |
sleighton | 0:10fe9a5a884f | 17 | void WriteByte(uint8_t addr, uint8_t reg); |
sleighton | 0:10fe9a5a884f | 18 | |
sleighton | 0:10fe9a5a884f | 19 | uint8_t readProx(); |
sleighton | 0:10fe9a5a884f | 20 | |
sleighton | 0:10fe9a5a884f | 21 | }; |