テスト用のあれこれ共用フォルダ
修订版 | 2fa9bf9fc8b6a1ea96f97df0a487df5878d4eb93 (tree) |
---|---|
时间 | 2017-11-06 06:23:15 |
作者 | takemasa <suikan@user...> |
Commiter | takemasa |
Editing doxygen comment
@@ -29,6 +29,7 @@ UART::~UART() { | ||
29 | 29 | vSemaphoreDelete(mutex_protect_tx_); |
30 | 30 | } |
31 | 31 | |
32 | +//todo: modify to return the boolean value. | |
32 | 33 | bool UART::Transmit(uint8_t * data, uint16_t size, WaitMilliSeconds timeout_ms) |
33 | 34 | { |
34 | 35 | EnterProtection(mutex_protect_tx_); |
@@ -52,6 +53,7 @@ bool UART::CompleteEntireTransmit(void* ptr) { | ||
52 | 53 | } |
53 | 54 | } |
54 | 55 | |
56 | +//todo: modify to return the boolean value. | |
55 | 57 | bool UART::Receive(uint8_t * data, uint16_t size, WaitMilliSeconds timeout_ms) { |
56 | 58 | EnterProtection(mutex_protect_rx_); |
57 | 59 |
@@ -52,8 +52,52 @@ class UART : public AbstractUART { | ||
52 | 52 | * Convenience, this function is forbiddedn to call from ISR. |
53 | 53 | */ |
54 | 54 | virtual bool Transmit(uint8_t * data, uint16_t count, WaitMilliSeconds timeout_ms); |
55 | + /** | |
56 | + * \brief Receive raw data through UART by blocking mode. | |
57 | + * \param data Data buffer to place the received data.. | |
58 | + * \param count The count of the data ( byte ) to be transfered. | |
59 | + * \param timeout_ms Time out limit by milliseconds. | |
60 | + * \return True if all data transfered completely. False if time out happen. | |
61 | + * \details | |
62 | + * Receive to given data buffer through the UART device. | |
63 | + * | |
64 | + * The receiving mode is blocking. That means, function returns when specified number of data has been received, except timeout. | |
65 | + * Passing kIndefinitely to the parameter timeout_ms orders not to return until complete receiving. Other value of | |
66 | + * timeout_ms parameter specifies the time out by millisecond. If time out happen, function returns false. If not happen, it returns true. | |
67 | + * | |
68 | + * This function is exclusive. Internally this function is guarded by mutex. Then this function is thread safe. In return for this | |
69 | + * Convenience, this function is forbiddedn to call from ISR. | |
70 | + */ | |
55 | 71 | virtual bool Receive(uint8_t * data, uint16_t count, WaitMilliSeconds timeout_ms); |
72 | + /** | |
73 | + * \brief Call back to be called for entire block transfer is complete. | |
74 | + * \param ptr Pointer to UART_HandleTypeDef struct. | |
75 | + * \return true: ptr matches with UART device and handle the call back. false : doesn't match. | |
76 | + * \details | |
77 | + * A call back to notify the end of entire block transfer. This is considered for DMA based transmission and | |
78 | + * called from an DMA ISR. | |
79 | + * | |
80 | + * An object of this class checks whether the given ptr parameter matches its own device, and if matched, | |
81 | + * Release the waiting task and return true. If it doesn't match, just return false. | |
82 | + * | |
83 | + * This method have to be called from ISR context. | |
84 | + */ | |
85 | + | |
56 | 86 | virtual bool CompleteEntireTransmit(void* ptr); |
87 | + /** | |
88 | + * \brief Call back to be called for entire block transfer is complete. | |
89 | + * \param ptr Pointer to UART_HandleTypeDef struct. | |
90 | + * \return true: ptr matches with UART device and handle the call back. false : doesn't match. | |
91 | + * \details | |
92 | + * A call back to notify the end of entire block transfer. This is considered for DMA based receiving and | |
93 | + * called from an DMA ISR. | |
94 | + * | |
95 | + * An object of this class checks whether the given ptr parameter matches its own device, and if matched, | |
96 | + * Release the waiting task and return true. If it doesn't match, just return false. | |
97 | + * | |
98 | + * This method have to be called from ISR context. | |
99 | + */ | |
100 | + | |
57 | 101 | virtual bool CompleteEntireReceive(void* ptr); |
58 | 102 | private: |
59 | 103 | UART_HandleTypeDef* uart_; |