Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: platforms/stm/disco_fletch/src/uart.h

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « platforms/stm/disco_fletch/src/test.dart ('k') | platforms/stm/disco_fletch/src/uart.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: platforms/stm/disco_fletch/src/uart.h
diff --git a/platforms/stm/disco_fletch/src/uart.h b/platforms/stm/disco_fletch/src/uart.h
deleted file mode 100644
index ff5df58952292f106e2eab5b3707514d5ca7721e..0000000000000000000000000000000000000000
--- a/platforms/stm/disco_fletch/src/uart.h
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE.md file.
-
-#ifndef PLATFORMS_STM_DISCO_FLETCH_SRC_UART_H_
-#define PLATFORMS_STM_DISCO_FLETCH_SRC_UART_H_
-
-#include <inttypes.h>
-
-#include <cmsis_os.h>
-#include <stm32f7xx_hal.h>
-
-#include "platforms/stm/disco_fletch/src/circular_buffer.h"
-
-// Interface to the universal asynchronous receiver/transmitter
-// (UART).
-class Uart {
- public:
- // Access the UART on the first UART port.
- Uart();
-
- // Start processing the UART.
- void Start();
-
- // Read up to count bytes from the UART into the buffer starting at
- // buffer.
- //
- // This will block until at least one byte can be read.
- size_t Read(uint8_t* buffer, size_t count);
-
-
- // Read up to count bytes from the buffer starting at buffer to the
- // UART.
- //
- // This will block until at least one byte can be written.
- size_t Write(const uint8_t* buffer, size_t count);
-
- private:
- static const int kTxBlockSize = 10;
-
- void Task();
-
- void EnsureTransmission();
-
- UART_HandleTypeDef* uart_;
- int error_count_;
- osSemaphoreDef(semaphore_def_);
- osSemaphoreId(semaphore_);
-
- // Receive status.
- uint8_t rx_data_; // The one byte received at the time.
- CircularBuffer* rx_buffer_;
-
- // Transmit status.
- fletch::Mutex* tx_mutex_;
- uint8_t tx_data_[kTxBlockSize]; // Buffer send to the HAL.
- bool tx_pending_;
- CircularBuffer* tx_buffer_;
-
- friend void __UartTask(const void*);
-};
-
-#endif // PLATFORMS_STM_DISCO_FLETCH_SRC_UART_H_
« no previous file with comments | « platforms/stm/disco_fletch/src/test.dart ('k') | platforms/stm/disco_fletch/src/uart.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698