aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/Peripheral
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2011-01-30 21:02:31 +0000
committerDean Camera <dean@fourwalledcubicle.com>2011-01-30 21:02:31 +0000
commit43c473530552acabcf5bb1db29555bfb5ea70b79 (patch)
treeb67e5b8295633262ed839e1c74f81a65b4dd59ea /LUFA/Drivers/Peripheral
parentafd828c095f38753e989391eab670b8736e4bd6e (diff)
downloadlufa-43c473530552acabcf5bb1db29555bfb5ea70b79.tar.gz
lufa-43c473530552acabcf5bb1db29555bfb5ea70b79.tar.bz2
lufa-43c473530552acabcf5bb1db29555bfb5ea70b79.zip
Renamed the PRNT_Host_SendString(), CDC_Host_SendString() and CDC_Device_SendString() functions to *_SendData(), and added new versions of the *_SendString() routines that expect a null terminated string instead.
Added new Serial_SendData() function to the Serial driver.
Diffstat (limited to 'LUFA/Drivers/Peripheral')
-rw-r--r--LUFA/Drivers/Peripheral/Serial.c5
-rw-r--r--LUFA/Drivers/Peripheral/Serial.h7
2 files changed, 12 insertions, 0 deletions
diff --git a/LUFA/Drivers/Peripheral/Serial.c b/LUFA/Drivers/Peripheral/Serial.c
index d9d946e36..99af2000c 100644
--- a/LUFA/Drivers/Peripheral/Serial.c
+++ b/LUFA/Drivers/Peripheral/Serial.c
@@ -81,3 +81,8 @@ void Serial_SendString(const char* StringPtr)
}
}
+void Serial_SendData(const uint8_t* Buffer, uint16_t Length)
+{
+ while (Length--)
+ Serial_SendByte(*(Buffer++));
+}
diff --git a/LUFA/Drivers/Peripheral/Serial.h b/LUFA/Drivers/Peripheral/Serial.h
index 58c570eab..f276479ae 100644
--- a/LUFA/Drivers/Peripheral/Serial.h
+++ b/LUFA/Drivers/Peripheral/Serial.h
@@ -117,6 +117,13 @@
*/
void Serial_SendString(const char* StringPtr) ATTR_NON_NULL_PTR_ARG(1);
+ /** Transmits a given buffer located in SRAM memory through the USART.
+ *
+ * \param[in] Buffer Pointer to a buffer containing the data to send.
+ * \param[in] Length Length of the data to send, in bytes.
+ */
+ void Serial_SendData(const uint8_t* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
+
/* Inline Functions: */
/** Initializes the USART, ready for serial data transmission and reception. This initializes the interface to
* standard 8-bit, no parity, 1 stop bit settings suitable for most applications.