aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/Peripheral/AVR8
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2011-07-12 05:18:10 +0000
committerDean Camera <dean@fourwalledcubicle.com>2011-07-12 05:18:10 +0000
commit04287b76c578b61fb16c90600af622d3e22e523b (patch)
treeb8370a871f7f53f24330491e3ff6e07e9e0b130c /LUFA/Drivers/Peripheral/AVR8
parent7207b0569529f5dcf180ec1d84d86c3f573168aa (diff)
downloadlufa-04287b76c578b61fb16c90600af622d3e22e523b.tar.gz
lufa-04287b76c578b61fb16c90600af622d3e22e523b.tar.bz2
lufa-04287b76c578b61fb16c90600af622d3e22e523b.zip
Add more missing function attributes to the TWI peripheral driver.
Fix incorrect standard request name in the host standard request driver.
Diffstat (limited to 'LUFA/Drivers/Peripheral/AVR8')
-rw-r--r--LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.h36
1 files changed, 20 insertions, 16 deletions
diff --git a/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.h b/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.h
index 8ff38a16f..df63b6ad7 100644
--- a/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.h
+++ b/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.h
@@ -232,13 +232,13 @@
/** Receives a byte from the currently addressed device on the TWI bus.
*
- * \param[in] Byte Location where the read byte is to be stored
- * \param[in] LastByte Indicates if the byte should be ACKed if false, NAKed if true
+ * \param[in] Byte Location where the read byte is to be stored.
+ * \param[in] LastByte Indicates if the byte should be ACKed if false, NAKed if true.
*
- * \return Boolean \c true if the byte reception successfully completed, \c false otherwise
+ * \return Boolean \c true if the byte reception successfully completed, \c false otherwise.
*/
- static inline uint8_t TWI_ReceiveByte(uint8_t* const Byte,
- const bool LastByte)
+ static inline bool TWI_ReceiveByte(uint8_t* const Byte,
+ const bool LastByte)
{
uint8_t TWCRMask = ((1 << TWINT) | (1 << TWEN));
@@ -255,10 +255,10 @@
/* Function Prototypes: */
/** Begins a master mode TWI bus communication with the given slave device address.
*
- * \param[in] SlaveAddress Address of the slave TWI device to communicate with
- * \param[in] TimeoutMS Timeout period within which the slave must respond, in milliseconds
+ * \param[in] SlaveAddress Address of the slave TWI device to communicate with.
+ * \param[in] TimeoutMS Timeout period within which the slave must respond, in milliseconds.
*
- * \return A value from the \ref TWI_ErrorCodes_t enum
+ * \return A value from the \ref TWI_ErrorCodes_t enum.
*/
uint8_t TWI_StartTransmission(const uint8_t SlaveAddress,
const uint8_t TimeoutMS);
@@ -266,19 +266,21 @@
/** High level function to perform a complete packet transfer over the TWI bus to the specified
* device.
*
- * \param[in] SlaveAddress Base address of the TWI slave device to communicate with
- * \param[in] TimeoutMS Timeout for bus capture and slave START ACK, in milliseconds
- * \param[in] InternalAddress Pointer to a location where the internal slave read start address is stored
- * \param[in] InternalAddressLen Size of the internal device address, in bytes
- * \param[in] Buffer Pointer to a buffer where the read packet data is to be stored
- * \param[in] Length Size of the packet to read, in bytes
+ * \param[in] SlaveAddress Base address of the TWI slave device to communicate with.
+ * \param[in] TimeoutMS Timeout for bus capture and slave START ACK, in milliseconds.
+ * \param[in] InternalAddress Pointer to a location where the internal slave read start address is stored.
+ * \param[in] InternalAddressLen Size of the internal device address, in bytes.
+ * \param[in] Buffer Pointer to a buffer where the read packet data is to be stored.
+ * \param[in] Length Size of the packet to read, in bytes.
+ *
+ * \return A value from the \ref TWI_ErrorCodes_t enum.
*/
uint8_t TWI_ReadPacket(const uint8_t SlaveAddress,
const uint8_t TimeoutMS,
const uint8_t* InternalAddress,
const uint8_t InternalAddressLen,
uint8_t* Buffer,
- uint8_t Length);
+ uint8_t Length) ATTR_NON_NULL_PTR_ARG(3);
/** High level function to perform a complete packet transfer over the TWI bus from the specified
* device.
@@ -289,13 +291,15 @@
* \param[in] InternalAddressLen Size of the internal device address, in bytes
* \param[in] Buffer Pointer to a buffer where the packet data to send is stored
* \param[in] Length Size of the packet to send, in bytes
+ *
+ * \return A value from the \ref TWI_ErrorCodes_t enum.
*/
uint8_t TWI_WritePacket(const uint8_t SlaveAddress,
const uint8_t TimeoutMS,
const uint8_t* InternalAddress,
uint8_t InternalAddressLen,
const uint8_t* Buffer,
- uint8_t Length);
+ uint8_t Length) ATTR_NON_NULL_PTR_ARG(3);
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)