Use 16-bit length for TWI driver packet read/write requests for longer transfers.
authorDean Camera <dean@fourwalledcubicle.com>
Sun, 27 Sep 2015 06:08:13 +0000 (16:08 +1000)
committerDean Camera <dean@fourwalledcubicle.com>
Sun, 27 Sep 2015 06:08:13 +0000 (16:08 +1000)
LUFA/DoxygenPages/ChangeLog.txt
LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c
LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.h
LUFA/Drivers/Peripheral/XMEGA/TWI_XMEGA.c
LUFA/Drivers/Peripheral/XMEGA/TWI_XMEGA.h

index f57ea8f..e3382d8 100644 (file)
@@ -13,6 +13,9 @@
   *   - Added new PROGMEM variant send functions to the CDC class host driver
   *
   *  <b>Changed:</b>
   *   - Added new PROGMEM variant send functions to the CDC class host driver
   *
   *  <b>Changed:</b>
+  *  - Core:
+  *   - The TWI peripheral driver's TWI_WritePacket() and TWI_ReadPacket() functions now takes a 16-bit Length rather than an 8-bit
+  *     length, for longer transfers
   *  - Library Applications:
   *   - The CDC, DFU, Mass Storage and Printer class bootloaders will no longer run the user application if the application reset
   *     vector is blank (thanks to Alex Kazik)
   *  - Library Applications:
   *   - The CDC, DFU, Mass Storage and Printer class bootloaders will no longer run the user application if the application reset
   *     vector is blank (thanks to Alex Kazik)
index 5955358..61652a7 100644 (file)
@@ -135,7 +135,7 @@ uint8_t TWI_ReadPacket(const uint8_t SlaveAddress,
                        const uint8_t* InternalAddress,
                        uint8_t InternalAddressLen,
                        uint8_t* Buffer,
                        const uint8_t* InternalAddress,
                        uint8_t InternalAddressLen,
                        uint8_t* Buffer,
-                       uint8_t Length)
+                       uint16_t Length)
 {
        uint8_t ErrorCode;
 
 {
        uint8_t ErrorCode;
 
@@ -175,7 +175,7 @@ uint8_t TWI_WritePacket(const uint8_t SlaveAddress,
                         const uint8_t* InternalAddress,
                         uint8_t InternalAddressLen,
                         const uint8_t* Buffer,
                         const uint8_t* InternalAddress,
                         uint8_t InternalAddressLen,
                         const uint8_t* Buffer,
-                        uint8_t Length)
+                        uint16_t Length)
 {
        uint8_t ErrorCode;
 
 {
        uint8_t ErrorCode;
 
index 9465fe0..33bed98 100644 (file)
                                               const uint8_t* InternalAddress,
                                               uint8_t InternalAddressLen,
                                               uint8_t* Buffer,
                                               const uint8_t* InternalAddress,
                                               uint8_t InternalAddressLen,
                                               uint8_t* Buffer,
-                                              uint8_t Length) ATTR_NON_NULL_PTR_ARG(3);
+                                              uint16_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.
 
                        /** High level function to perform a complete packet transfer over the TWI bus from the specified
                         *  device.
                                                const uint8_t* InternalAddress,
                                                uint8_t InternalAddressLen,
                                                const uint8_t* Buffer,
                                                const uint8_t* InternalAddress,
                                                uint8_t InternalAddressLen,
                                                const uint8_t* Buffer,
-                                               uint8_t Length) ATTR_NON_NULL_PTR_ARG(3);
+                                               uint16_t Length) ATTR_NON_NULL_PTR_ARG(3);
 
        /* Disable C linkage for C++ Compilers: */
                #if defined(__cplusplus)
 
        /* Disable C linkage for C++ Compilers: */
                #if defined(__cplusplus)
index 56334c8..3fdf1a1 100644 (file)
@@ -110,7 +110,7 @@ uint8_t TWI_ReadPacket(TWI_t* const TWI,
                        const uint8_t* InternalAddress,
                        uint8_t InternalAddressLen,
                        uint8_t* Buffer,
                        const uint8_t* InternalAddress,
                        uint8_t InternalAddressLen,
                        uint8_t* Buffer,
-                       uint8_t Length)
+                       uint16_t Length)
 {
        uint8_t ErrorCode;
 
 {
        uint8_t ErrorCode;
 
@@ -151,7 +151,7 @@ uint8_t TWI_WritePacket(TWI_t* const TWI,
                         const uint8_t* InternalAddress,
                         uint8_t InternalAddressLen,
                         const uint8_t* Buffer,
                         const uint8_t* InternalAddress,
                         uint8_t InternalAddressLen,
                         const uint8_t* Buffer,
-                        uint8_t Length)
+                        uint16_t Length)
 {
        uint8_t ErrorCode;
 
 {
        uint8_t ErrorCode;
 
index e4d14b8..734bba6 100644 (file)
                                               const uint8_t* InternalAddress,
                                               uint8_t InternalAddressLen,
                                               uint8_t* Buffer,
                                               const uint8_t* InternalAddress,
                                               uint8_t InternalAddressLen,
                                               uint8_t* Buffer,
-                                              uint8_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(4);
+                                              uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(4);
 
                        /** High level function to perform a complete packet transfer over the TWI bus from the specified
                         *  device.
 
                        /** High level function to perform a complete packet transfer over the TWI bus from the specified
                         *  device.
                                                const uint8_t* InternalAddress,
                                                uint8_t InternalAddressLen,
                                                const uint8_t* Buffer,
                                                const uint8_t* InternalAddress,
                                                uint8_t InternalAddressLen,
                                                const uint8_t* Buffer,
-                                               uint8_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(4);
+                                               uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(4);
 
        /* Disable C linkage for C++ Compilers: */
                #if defined(__cplusplus)
 
        /* Disable C linkage for C++ Compilers: */
                #if defined(__cplusplus)