summaryrefslogtreecommitdiffhomepage
path: root/digital/avr/modules/twi/avrconfig.h
diff options
context:
space:
mode:
Diffstat (limited to 'digital/avr/modules/twi/avrconfig.h')
-rw-r--r--digital/avr/modules/twi/avrconfig.h45
1 files changed, 33 insertions, 12 deletions
diff --git a/digital/avr/modules/twi/avrconfig.h b/digital/avr/modules/twi/avrconfig.h
index 5f94ecd1..afa1fb13 100644
--- a/digital/avr/modules/twi/avrconfig.h
+++ b/digital/avr/modules/twi/avrconfig.h
@@ -3,17 +3,17 @@
/* avrconfig.h - TWI module configuration template. */
/* avr.twi - TWI AVR module. {{{
*
- * Copyright (C) 2005 Demonchy Clément
+ * Copyright (C) 2010 Nicolas Schodet
*
- * Robot APB Team/Efrei 2006.
- * Web: http://assos.efrei.fr/robot/
- * Email: robot AT efrei DOT fr
+ * APBTeam:
+ * Web: http://apbteam.org/
+ * Email: team AT apbteam DOT org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -26,13 +26,34 @@
* }}} */
/* twi - TWI module. */
-/** Activate master part. */
-#define AC_TWI_MASTER_ENABLE 0
-/** Activate slave part. */
+/** Driver to implement TWI: HARD, SOFT, or USI. */
+#define AC_TWI_DRIVER HARD
+/** Do not use interrupts. */
+#define AC_TWI_NO_INTERRUPT 0
+/** TWI frequency, should really be 100 kHz. */
+#define AC_TWI_FREQ 100000
+/** Enable slave part. */
#define AC_TWI_SLAVE_ENABLE 0
-/** Slave recv buffer size. */
-#define AC_TWI_SL_RECV_BUFFER_SIZE 16
-/** Slave send buffer size. */
-#define AC_TWI_SL_SEND_BUFFER_SIZE 16
+/** Enable master part. */
+#define AC_TWI_MASTER_ENABLE 0
+/** Use polled slave mode: received data is stored in a buffer which can be
+ * polled using twi_slave_poll. */
+#define AC_TWI_SLAVE_POLLED 1
+/** Slave reception callback to be defined by the user when not in polled
+ * mode. */
+#undef AC_TWI_SLAVE_RECV
+/** Master transfer completion callback, optionally defined by the user, called
+ * at end of master transfer. */
+#undef AC_TWI_MASTER_DONE
+/** Use internal pull up. */
+#define AC_TWI_PULL_UP 0
+/** Slave reception buffer size. */
+#define AC_TWI_SLAVE_RECV_BUFFER_SIZE 16
+/** Slave transmission buffer size. */
+#define AC_TWI_SLAVE_SEND_BUFFER_SIZE 16
+/** SDA line IO for SOFT driver. */
+#define AC_TWI_SOFT_SDA_IO A, 0
+/** SCL line IO for SOFT driver. */
+#define AC_TWI_SOFT_SCL_IO A, 1
#endif /* avrconfig_h */