i

Dependencies:   mbed mbed

Files at this revision

API Documentation at this revision

Comitter:
TUATBM
Date:
Tue Aug 28 07:37:40 2018 +0000
Commit message:
i

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
mbed.lib Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 78f11e7b3aa2 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Aug 28 07:37:40 2018 +0000
@@ -0,0 +1,72 @@
+#include "mbed.h"
+#include "Serial.h"
+
+/*送信*/
+/*
+Serial usbSerial(PA_9, PA_10);
+ 
+void ISR_Serial_Rx()
+{
+    // シリアルの受信処理
+    char data = usbSerial.getc();
+}
+ 
+void ISR_Serial_Tx()
+{
+    // シリアルのs送信処理
+    usbSerial.attach(NULL, Serial::TxIrq);
+}
+ 
+int main()
+{
+    // シリアル通信の速度設定
+    usbSerial.baud(9600);
+ 
+    // シリアル通信受信の割り込みイベント登録
+    usbSerial.attach(ISR_Serial_Rx, Serial::RxIrq);
+ 
+    // シリアル通信のデータ送信
+    usbSerial.attach(ISR_Serial_Tx, Serial::TxIrq);
+   
+    usbSerial.putc(5);
+    
+ 
+    while (1) {
+        // メイン処理
+        wait(1.0);
+        printf("a\r\n");
+    }
+}
+*/
+
+
+/*受信*/
+
+Serial usbSerial(PA_9,PA_10);
+Serial MySerial1(USBTX,USBRX);
+ 
+void ISR_Serial_Rx()
+{
+    // シリアルの受信処理
+    char data = usbSerial.getc();
+    usbSerial.putc(data);
+  
+    
+}
+ 
+int main()
+{
+    // シリアル通信の速度設定
+    usbSerial.baud(9600);
+ 
+    // シリアル通信受信の割り込みイベント登録
+    usbSerial.attach(ISR_Serial_Rx, Serial::RxIrq);
+ 
+    while (1) { 
+        // メイン処理
+        printf("NOKOLAT\r\n");
+        wait(1.0);
+ 
+        }
+    
+}
diff -r 000000000000 -r 78f11e7b3aa2 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Aug 28 07:37:40 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/a7c7b631e539
\ No newline at end of file
diff -r 000000000000 -r 78f11e7b3aa2 mbed.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.lib	Tue Aug 28 07:37:40 2018 +0000
@@ -0,0 +1,1 @@
+http://os.mbed.com/users/screamer/code/mbed/#aff670d0d510