RCELE 85
/
ADT7320_Test
test program for ADT7320 temperature sensor
Diff: ADT7320_SPI.h
- Revision:
- 0:66156a1e785a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ADT7320_SPI.h Sat Dec 24 15:31:40 2016 +0000 @@ -0,0 +1,55 @@ +#ifndef ADT7320_SPI_H +#define ADT7320_SPI_H + +/** + * Includes + */ +#include "mbed.h" + + +class ADT7320_SPI { + + public: + + /** + * Constructor. + * + * @param mosi mbed pin to use for SDA line of I2C interface. + * @param sck mbed pin to use for SCL line of I2C interface. + */ + ADT7320_SPI(PinName mosi, PinName miso, PinName sclk, PinName cs); + float readTemp(void); + /** + * Get the output of all three axes. + * + * @param Pointer to a buffer to hold the accelerometer value for the + * x-axis, y-axis and z-axis [in that order]. + */ + + + private: + + SPI spi_; + DigitalOut cs_; + unsigned int readRegister(uint8_t thisRegister, int bytesToRead ); + /** + * Read one byte from a register on the device. + * + * @param: - the address to be read from + * + * @return: the value of the data read + */ + + + /** + * Write one byte to a register on the device. + * + * @param: + - address of the register to write to. + - the value of the data to store + */ + + +}; + +#endif \ No newline at end of file