bitbang: Convert logging to AVR_LOG()
[simavr] / simavr / sim / avr_spi.h
index 2c24e52..0f10252 100644 (file)
        along with simavr.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef AVR_SPI_H_
-#define AVR_SPI_H_
+#ifndef __AVR_SPI_H__
+#define __AVR_SPI_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 #include "sim_avr.h"
 
@@ -38,17 +42,23 @@ typedef struct avr_spi_t {
        char name;
        avr_regbit_t    disabled;       // bit in the PRR
 
-       uint8_t r_spdr;                 // data register
-       uint8_t r_spcr;                 // control register
-       uint8_t r_spsr;                 // status register
+       avr_io_addr_t   r_spdr;                 // data register
+       avr_io_addr_t   r_spcr;                 // control register
+       avr_io_addr_t   r_spsr;                 // status register
        
        avr_regbit_t spe;               // spi enable
        avr_regbit_t mstr;              // master/slave
        avr_regbit_t spr[4];    // clock divider
        
        avr_int_vector_t spi;   // spi interrupt
+
+       uint8_t         input_data_register;
 } avr_spi_t;
 
 void avr_spi_init(avr_t * avr, avr_spi_t * port);
 
-#endif /* AVR_SPI_H_ */
+#ifdef __cplusplus
+};
+#endif
+
+#endif /*__AVR_SPI_H__*/