APDS-9130 library
Prox.h@2:9db88ca586db, 2016-03-04 (annotated)
- Committer:
- sleighton
- Date:
- Fri Mar 04 18:46:17 2016 +0000
- Revision:
- 2:9db88ca586db
- Parent:
- 1:159407640167
Before Tidy up
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 | 1:159407640167 | 14 | void ReadWord(char addr, char reg, uint16_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 | 1:159407640167 | 19 | uint16_t readProx(); |
sleighton | 0:10fe9a5a884f | 20 | |
sleighton | 0:10fe9a5a884f | 21 | }; |