Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: F446_FunctionGenerator F446_UpSampling_GraphicEqualizer F446_UpSampling_ReverbSystem F446_UpSampling_FrqShifter_Weaver ... more
SerialTxIntr.hpp
- Committer:
- MikamiUitOpen
- Date:
- 2019-11-23
- Revision:
- 9:a90a9abeaea0
- Parent:
- 8:8f6e9351f313
- Child:
- 10:6525f1c28ef6
File content as of revision 9:a90a9abeaea0:
//-------------------------------------------------------------
// Nucleo ボードの USB コネクタに対応するシリアルポート送信割込みで
// キャラクタの送信をサポ-トするクラス
//
// ボーレートのデフォルト値は 9,600 boud
//
// 2019/01/26, Copyright (c) 2019 MIKAMI, Naoki
//-------------------------------------------------------------
#include "mbed.h"
#include <queue>
#include <string>
#ifndef SERIAL_TX_INTR_HPP
#define SERIAL_TX_INTR_HPP
namespace Mikami
{
class SerialTxIntr
{
public:
explicit SerialTxIntr(Serial &tx); // コンストラクタ
void TxWrite(char c); // 送信データ書き込み
void TxString(string str); // 文字列の送信
private:
Serial &tx_; // シリアルポートに対応するオブジェクトの参照
std::queue<char> que_; // FIFO による送信用バッファ
void TxIsr(); // シリアルポート送信割込みサービスルーチン
// コピー・コンストラクタの禁止のため
SerialTxIntr(const SerialTxIntr&);
// 代入演算子の禁止のため
SerialTxIntr& operator=(const SerialTxIntr&);
};
}
#endif // SERIAL_TX_INTR_HPP