summaryrefslogtreecommitdiff
path: root/CMSIS/Driver/DriverTemplates/Driver_USART.c
diff options
context:
space:
mode:
Diffstat (limited to 'CMSIS/Driver/DriverTemplates/Driver_USART.c')
-rw-r--r--CMSIS/Driver/DriverTemplates/Driver_USART.c132
1 files changed, 132 insertions, 0 deletions
diff --git a/CMSIS/Driver/DriverTemplates/Driver_USART.c b/CMSIS/Driver/DriverTemplates/Driver_USART.c
new file mode 100644
index 0000000..c81a904
--- /dev/null
+++ b/CMSIS/Driver/DriverTemplates/Driver_USART.c
@@ -0,0 +1,132 @@
+#include "Driver_USART.h"
+
+#define ARM_USART_DRV_VERSION ARM_DRIVER_VERSION_MAJOR_MINOR(2, 0) /* driver version */
+
+/* Driver Version */
+static const ARM_DRIVER_VERSION DriverVersion = {
+ ARM_USART_API_VERSION,
+ ARM_USART_DRV_VERSION
+};
+
+/* Driver Capabilities */
+static const ARM_USART_CAPABILITIES DriverCapabilities = {
+ 1, /* supports UART (Asynchronous) mode */
+ 0, /* supports Synchronous Master mode */
+ 0, /* supports Synchronous Slave mode */
+ 0, /* supports UART Single-wire mode */
+ 0, /* supports UART IrDA mode */
+ 0, /* supports UART Smart Card mode */
+ 0, /* Smart Card Clock generator available */
+ 0, /* RTS Flow Control available */
+ 0, /* CTS Flow Control available */
+ 0, /* Transmit completed event: \ref ARM_USART_EVENT_TX_COMPLETE */
+ 0, /* Signal receive character timeout event: \ref ARM_USART_EVENT_RX_TIMEOUT */
+ 0, /* RTS Line: 0=not available, 1=available */
+ 0, /* CTS Line: 0=not available, 1=available */
+ 0, /* DTR Line: 0=not available, 1=available */
+ 0, /* DSR Line: 0=not available, 1=available */
+ 0, /* DCD Line: 0=not available, 1=available */
+ 0, /* RI Line: 0=not available, 1=available */
+ 0, /* Signal CTS change event: \ref ARM_USART_EVENT_CTS */
+ 0, /* Signal DSR change event: \ref ARM_USART_EVENT_DSR */
+ 0, /* Signal DCD change event: \ref ARM_USART_EVENT_DCD */
+ 0 /* Signal RI change event: \ref ARM_USART_EVENT_RI */
+};
+
+//
+// Functions
+//
+
+ARM_DRIVER_VERSION ARM_USART_GetVersion(void)
+{
+}
+
+ARM_USART_CAPABILITIES ARM_USART_GetCapabilities(void)
+{
+}
+
+int32_t ARM_USART_Initialize(ARM_USART_SignalEvent_t cb_event)
+{
+}
+
+int32_t ARM_USART_Uninitialize(void)
+{
+}
+
+int32_t ARM_USART_PowerControl(ARM_POWER_STATE state)
+{
+ switch (state)
+ {
+ case ARM_POWER_OFF:
+ break;
+
+ case ARM_POWER_LOW:
+ break;
+
+ case ARM_POWER_FULL:
+ break;
+
+ default:
+ return ARM_DRIVER_ERROR_UNSUPPORTED;
+ }
+}
+
+int32_t ARM_USART_Send(const void *data, uint32_t num)
+{
+}
+
+int32_t ARM_USART_Receive(void *data, uint32_t num)
+{
+}
+
+int32_t ARM_USART_Transfer(const void *data_out, void *data_in, uint32_t num)
+{
+}
+
+uint32_t ARM_USART_GetTxCount(void)
+{
+}
+
+uint32_t ARM_USART_GetRxCount(void)
+{
+}
+
+int32_t ARM_USART_Control(uint32_t control, uint32_t arg)
+{
+}
+
+ARM_USART_STATUS ARM_USART_GetStatus(void)
+{
+}
+
+int32_t ARM_USART_SetModemControl(ARM_USART_MODEM_CONTROL control)
+{
+}
+
+ARM_USART_MODEM_STATUS ARM_USART_GetModemStatus(void)
+{
+}
+
+void ARM_USART_SignalEvent(uint32_t event)
+{
+ // function body
+}
+
+// End USART Interface
+
+ARM_DRIVER_USART Driver_USART = {
+ ARM_USART_GetVersion,
+ ARM_USART_GetCapabilities,
+ ARM_USART_Initialize,
+ ARM_USART_Uninitialize,
+ ARM_USART_PowerControl,
+ ARM_USART_Send,
+ ARM_USART_Receive,
+ ARM_USART_Transfer,
+ ARM_USART_GetTxCount,
+ ARM_USART_GetRxCount,
+ ARM_USART_Control,
+ ARM_USART_GetStatus,
+ ARM_USART_SetModemControl,
+ ARM_USART_GetModemStatus
+};