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

#include <uart.hpp>

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

公開メンバ関数

 Uart (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<UART_HandleTypeDef * Handle, UartType TxType = UartType::IT, UartType RxType = UartType::IT>
class stm32rcos::peripheral::Uart< Handle, TxType, RxType >

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

#include <cstdio>
extern UART_HandleTypeDef huart2;
extern "C" void main_thread(void *) {
using namespace stm32rcos::core;
using namespace stm32rcos::peripheral;
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);
}
}
bool transmit(const uint8_t *data, size_t size, uint32_t timeout)
Definition uart.hpp:68
Uart(size_t rx_buf_size=64)
Definition uart.hpp:66
bool receive(uint8_t *data, size_t size, uint32_t timeout)
Definition uart.hpp:72
Definition mutex.hpp:10
Definition can.hpp:18
bool enable_stdout(UartBase &uart)

構築子と解体子

◆ Uart()

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

関数詳解

◆ available()

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

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

◆ flush()

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

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

◆ receive()

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

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

◆ transmit()

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

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


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