stm32rcos
 
読み取り中…
検索中…
一致する文字列を見つけられません
stm32rcos::peripheral::Uart< TxType, RxType > クラステンプレート

#include <uart.hpp>

stm32rcos::peripheral::Uart< TxType, RxType > の継承関係図
stm32rcos::peripheral::Uart< TxType, RxType > 連携図

公開メンバ関数

 Uart (UART_HandleTypeDef *huart, size_t rx_buf_size=64)
 
bool transmit (const uint8_t *data, size_t size, uint32_t timeout)
 
bool receive (uint8_t *data, size_t size, uint32_t timeout)
 
void flush ()
 
size_t available ()
 
- 基底クラス stm32rcos::peripheral::UartBase に属する継承公開メンバ関数
virtual ~UartBase ()
 

詳解

template<UartType TxType = UartType::IT, UartType RxType = UartType::IT>
class stm32rcos::peripheral::Uart< TxType, RxType >

デフォルトでTx, Rxともに割り込みを使用します。

#include <cstdio>
extern UART_HandleTypeDef huart2;
extern "C" void main_thread(void *) {
using namespace stm32rcos::core;
using namespace stm32rcos::peripheral;
Uart uart2(&huart2);
enable_stdout(uart2);
while (true) {
// 7バイト送信
uint8_t data[] = {'h', 'e', 'l', 'l', 'o', '\r', '\n'};
uart2.transmit(data, sizeof(data), osWaitForever);
// 1バイト受信
char c;
if (uart2.receive((uint8_t *)&c, 1, osWaitForever)) {
printf("入力した文字: %c\r\n", c);
}
osDelay(10);
}
}
Uart(UART_HandleTypeDef *huart, size_t rx_buf_size=64)
Definition uart.hpp:65
Definition mutex.hpp:10
Definition can.hpp:18
bool enable_stdout(UartBase &uart)

構築子と解体子

◆ Uart()

template<UartType TxType = UartType::IT, UartType RxType = UartType::IT>
stm32rcos::peripheral::Uart< TxType, RxType >::Uart ( UART_HandleTypeDef * huart,
size_t rx_buf_size = 64 )
inline

関数詳解

◆ available()

template<UartType TxType = UartType::IT, UartType RxType = UartType::IT>
size_t stm32rcos::peripheral::Uart< TxType, RxType >::available ( )
inlinevirtual

stm32rcos::peripheral::UartBaseを実装しています。

◆ flush()

template<UartType TxType = UartType::IT, UartType RxType = UartType::IT>
void stm32rcos::peripheral::Uart< TxType, RxType >::flush ( )
inlinevirtual

stm32rcos::peripheral::UartBaseを実装しています。

◆ receive()

template<UartType TxType = UartType::IT, UartType RxType = UartType::IT>
bool stm32rcos::peripheral::Uart< TxType, RxType >::receive ( uint8_t * data,
size_t size,
uint32_t timeout )
inlinevirtual

stm32rcos::peripheral::UartBaseを実装しています。

◆ transmit()

template<UartType TxType = UartType::IT, UartType RxType = UartType::IT>
bool stm32rcos::peripheral::Uart< TxType, RxType >::transmit ( const uint8_t * data,
size_t size,
uint32_t timeout )
inlinevirtual

stm32rcos::peripheral::UartBaseを実装しています。


このクラス詳解は次のファイルから抽出されました: