All Projects → ht-deko → vt100_stm32

ht-deko / vt100_stm32

Licence: MIT License
VT100 Terminal Emulator for Arduino STM32

Programming Languages

c
50402 projects - #5 most used programming language
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to vt100 stm32

versaloon
JTAG Versaloon firmware for the STM32 Bluepill board
Stars: ✭ 95 (+251.85%)
Mutual labels:  stm32, bluepill
Modbus-STM32-HAL-FreeRTOS
Modbus TCP and RTU, Master and Slave for STM32 using Cube HAL and FreeRTOS
Stars: ✭ 272 (+907.41%)
Mutual labels:  stm32, bluepill
esm
Lightweight communicating state machine framework for embedded systems
Stars: ✭ 21 (-22.22%)
Mutual labels:  stm32, bluepill
MPU6050
STM32 HAL library for GY-521 (MPU6050) with Kalman filter
Stars: ✭ 114 (+322.22%)
Mutual labels:  stm32, bluepill
stm32-blue-pill-rust
Rust for STM32 Blue Pill with Visual Studio Code
Stars: ✭ 98 (+262.96%)
Mutual labels:  stm32, bluepill
fabooh
c++ template library for cortex-m0+ (lpc8xx), cortex-m0 ( lpc1114 ), cortex-m3 (bluepill), and msp430 ( small msp430 )
Stars: ✭ 28 (+3.7%)
Mutual labels:  stm32, bluepill
stm32-tkg-hid-bootloader
A HID driverless bootloader and flash tool companion for the STM32F1 line
Stars: ✭ 30 (+11.11%)
Mutual labels:  stm32, bluepill
BlueVGA
VGA library for STM32F103C (BluePill) that can manipulate a screen with 28x30 tiles with 8x8 pixels each, in a total resolution of 224x240 pixels with 8 colors using a very low footprint
Stars: ✭ 39 (+44.44%)
Mutual labels:  stm32, bluepill
stm32 tiny monitor
A tiny external monitor for PC using STM32 and ST7789. Connects to PC over USB and displays the captured screen on ST7789 (240x240) display.
Stars: ✭ 61 (+125.93%)
Mutual labels:  stm32, bluepill
platformio-libopencm3-freertos
Sample blinky project for PlatformIO using libopencm3 and FreeRTOS
Stars: ✭ 14 (-48.15%)
Mutual labels:  stm32, bluepill
px-fwlib
open source bare-metal C firmware and documentation for microcontrollers
Stars: ✭ 247 (+814.81%)
Mutual labels:  stm32
async-stm32f1xx
Abstractions for asynchronous programming on the STM32F1xx family of microcontrollers.
Stars: ✭ 24 (-11.11%)
Mutual labels:  stm32
STM32 XPD
STM32 eXtensible Peripheral Drivers
Stars: ✭ 38 (+40.74%)
Mutual labels:  stm32
OpenWare
Firmware for OWL devices
Stars: ✭ 23 (-14.81%)
Mutual labels:  stm32
MPU60X0
Fast, Lightweight STM32 I2C HAL Driver for the MPU6000/MPU6050 IMU
Stars: ✭ 15 (-44.44%)
Mutual labels:  stm32
STM32-Bare-Metal
STM32F103C8 bare metal template
Stars: ✭ 26 (-3.7%)
Mutual labels:  stm32
toolchain68k
build a toolchain for cross developement. Supports motorola m68k-elf, avr and arm-none-eabi
Stars: ✭ 18 (-33.33%)
Mutual labels:  stm32
firmware
设备固件库,适用于IntoRobot系列产品
Stars: ✭ 19 (-29.63%)
Mutual labels:  stm32
CMSIS NN-INTQ
INT-Q Extension of the CMSIS-NN library for ARM Cortex-M target
Stars: ✭ 15 (-44.44%)
Mutual labels:  stm32
STM32 HAL FREEMODBUS RTU
FreeMODBUS RTU port for STM32 HAL library
Stars: ✭ 111 (+311.11%)
Mutual labels:  stm32

VT100 Terminal Emulator for Arduino STM32

Arduino STM32 用の VT100 エミュレータです。

image

必要なハードウェア

以下のハードウェアが必要です。

  • Blue Pill (STM32F103 minimum development board)
  • ILI9341 TFT LCD Display (SPI)
  • PS/2 Keyboard Connector
  • Passive Buzzer (Option)
  • LED (Option)

See also:

接続

接続は以下のようになります。

image

ILI9341 TFT LCD Display

SPI 接続です。

image

TFT LCD Blue Pill (STM32)
1 VCC 3.3V
2 GND GND
3 CS PA4
4 RESET PA3
5 DC PA2
6 MOSI PA7
7 SCK PA5
8 LED 3.3V
9 MISO PA6

PS/2 Keyboard Connector

ピンを移動させる場合には 5V トレラントのピンを選んでください。CLK と DAT ピンは 10kΩ でプルアップする必要があります。

image

PS/2 Blue Pill (STM32)
1 CLK PB6
2 DAT PB7
3 VCC 5V
4 GND GND

Passive Buzzer

PA8 に接続します。

LED

PB15 ~ PB12 に接続します、電流制限抵抗をお忘れなく。

必要なソフトウェア

コンパイルするには以下のソフトウェアが必要です。

転送はブートローダーでもシリアルでも ST-Link でも構いません。

See also:

シリアルバッファのサイズ調整

Arduino STM32 のデフォルトである 64 だと 9600bps で描画が追い付かない事があるためシリアルバッファを増やします (usart.h)。

/*
 * Devices
 */

#ifndef USART_RX_BUF_SIZE
#define USART_RX_BUF_SIZE               512
#endif

#ifndef USART_TX_BUF_SIZE
#define USART_TX_BUF_SIZE               128
#endif

Ctrl キー対応

Ctrl キーに対応させるため、Arduino_PS2Keyboard の PS2Keyboard.cpp を編集します。

#define BREAK     0x01
#define MODIFIER  0x02
#define SHIFT_L   0x04
#define SHIFT_R   0x08
#define ALTGR     0x10
/* 追加 BEGIN */
#define ALT       0x20
#define CTRL      0x40
/* 追加 END */

static char get_iso8859_code(void)
{
  static uint8_t state = 0;
  static uint8_t sState = 0; // 追加
  uint8_t s;
  char c;

  while (1) {
    s = get_scan_code();
    if (!s) return 0;
    if (s == 0xF0) {
      state |= BREAK;
    } else if (s == 0xE0) {
      state |= MODIFIER;
    } else {
      if (state & BREAK) {
        if (s == 0x12) {
          state &= ~SHIFT_L;
        } else if (s == 0x59) {
          state &= ~SHIFT_R;
        } else if (s == 0x11 && (state & MODIFIER)) {
          state &= ~ALTGR;
        }
        // CTRL, ALT & WIN keys could be added
        // but is that really worth the overhead?
        state &= ~(BREAK | MODIFIER);
        continue;
      }
      if (s == 0x12) {
        state |= SHIFT_L;
        sState |= SHIFT_L; // 追加
        continue;
      /* 追加 BEGIN */
      } else if (s == 0x11) {
        sState |= ALT;
        continue;
      } else if (s == 0x14) {
        sState |= CTRL;
        continue;
      /* 追加 END */
      } else if (s == 0x59) {
        state |= SHIFT_R;
        sState |= SHIFT_R; // 追加
        continue;
      } else if (s == 0x11 && (state & MODIFIER)) {
        state |= ALTGR;
        sState |= ALTGR; // 追加
      }
      c = 0;
      if (state & MODIFIER) {
        switch (s) {
//        case 0x70: c = PS2_INSERT;      break;
//        case 0x6C: c = PS2_HOME;        break;
//        case 0x7D: c = PS2_PAGEUP;      break;
          case 0x71: c = PS2_DELETE;      break;
//        case 0x69: c = PS2_END;         break;
//        case 0x7A: c = PS2_PAGEDOWN;    break;
          case 0x75: c = PS2_UPARROW;     break;
          case 0x6B: c = PS2_LEFTARROW;   break;
          case 0x72: c = PS2_DOWNARROW;   break;
          case 0x74: c = PS2_RIGHTARROW;  break;
          case 0x4A: c = '/';             break;
          case 0x5A: c = PS2_ENTER;       break;
          default: break;
        }
      } else if (state & ALTGR) {
        // [右ALT]+[カナ/かな]キーが押された
        if (s == 0x13) {
          kana_f = ~kana_f ;
          if (kana_f == 0) {
            keymap = &PS2Keymap_JP ;      // 日本語キーマップに戻す
          } else {
            keymap = &PS2Keymap_KANA ;    // カタカナキーマップにする
          }
          c = PS2_KANA ; // この行をコメントにすればキーコードは返りません
        }
      } else if (state & (SHIFT_L | SHIFT_R)) {
        if (s < PS2_KEYMAP_SIZE)
          c = pgm_read_byte(keymap->shift + s);
      } else {
        if (s < PS2_KEYMAP_SIZE)
          c = pgm_read_byte(keymap->noshift + s);
      }
      state &= ~(BREAK | MODIFIER);
      if (c) {
        /* 追加 BEGIN */
        if (sState & 0x40) {
          c &= 0x1F;
          sState = 0;  
        }
        /* 追加 END */
        return c;
      }
    }
  }
}

使い方

キーボードを接続し、Blue Pill (STM32) と通信相手をつなぎます。

COM Blue Pill (STM32)
TXD PB11 (Serial3: RXD)
RXD PB10 (Serial3: TXD)
GND GND

RunCPMCP/M 8266 と接続してみました。

image

※ この VT100 エミュレータの通信速度は 9600 bps、画面サイズは 53 x 30 です。

VT100 の参考資料

image

VT100 のエスケープシーケンスは以下のサイトを参考にしました。

コーディング上の参考資料

パク...インスパイア元です。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].