interface for the temperature sensor chip adt7320, with sw SPI interface
Diff: adt7320.cpp
- Revision:
- 2:2b886cea4fcb
- Parent:
- 1:1b9f706b8abc
- Child:
- 3:49638acbc5d4
diff -r 1b9f706b8abc -r 2b886cea4fcb adt7320.cpp --- a/adt7320.cpp Sun Oct 05 17:12:21 2014 +0000 +++ b/adt7320.cpp Tue Oct 14 17:10:50 2014 +0000 @@ -82,6 +82,17 @@ +void adt7320::serial_line_rst() { + set_spi_mode(32); + u32 data=0xFFFFFFFF; + cs->write(CS_ACTIVE); // needed ? + data= spi->write(data); + cs->write(CS_DEACTIVE); + set_spi_mode(24); +} + + + u8 adt7320::getId(){ return getR08(0x03); }