aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/Peripheral/AVRU4U6U7/TWI.h
diff options
context:
space:
mode:
Diffstat (limited to 'LUFA/Drivers/Peripheral/AVRU4U6U7/TWI.h')
-rw-r--r--LUFA/Drivers/Peripheral/AVRU4U6U7/TWI.h35
1 files changed, 19 insertions, 16 deletions
diff --git a/LUFA/Drivers/Peripheral/AVRU4U6U7/TWI.h b/LUFA/Drivers/Peripheral/AVRU4U6U7/TWI.h
index 8b289fb66..e2c3d6a10 100644
--- a/LUFA/Drivers/Peripheral/AVRU4U6U7/TWI.h
+++ b/LUFA/Drivers/Peripheral/AVRU4U6U7/TWI.h
@@ -70,24 +70,27 @@
#endif
/* Public Interface - May be used in end-application: */
- /* Pseudo-Function Macros: */
- #if defined(__DOXYGEN__)
- /** Initializes the TWI hardware into master mode, ready for data transmission and reception. This must be
- * before any other TWI operations.
- */
- static inline void TWI_Init(void);
-
- /** Turns off the TWI driver hardware. If this is called, any further TWI operations will require a call to
- * \ref TWI_Init() before the TWI can be used again.
- */
- static inline void TWI_ShutDown(void);
- #else
- #define TWI_Init() MACROS{ TWCR |= (1 << TWEN); }MACROE
- #define TWI_ShutDown() MACROS{ TWCR &= ~(1 << TWEN); }MACROE
- #endif
-
/* Inline Functions: */
+ /** Initializes the TWI hardware into master mode, ready for data transmission and reception. This must be
+ * before any other TWI operations.
+ */
+ static inline void TWI_Init(void) ATTR_ALWAYS_INLINE;
+ static inline void TWI_Init(void)
+ {
+ TWCR |= (1 << TWEN);
+ }
+
+ /** Turns off the TWI driver hardware. If this is called, any further TWI operations will require a call to
+ * \ref TWI_Init() before the TWI can be used again.
+ */
+ static inline void TWI_ShutDown(void) ATTR_ALWAYS_INLINE;
+ static inline void TWI_ShutDown(void)
+ {
+ TWCR &= ~(1 << TWEN);
+ }
+
/** Sends a TWI STOP onto the TWI bus, terminating communication with the currently addressed device. */
+ static inline void TWI_StopTransmission(void) ATTR_ALWAYS_INLINE;
static inline void TWI_StopTransmission(void)
{
TWCR = ((1 << TWINT) | (1 << TWSTO) | (1 << TWEN));