GithubHelp home page GithubHelp logo

rotcehdnih / opentco Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fishpepper/opentco

0.0 1.0 0.0 4 KB

open serial protocol for VTX, Camera and OSD control

License: GNU Lesser General Public License v3.0

opentco's Introduction

openTCO : an open vTx, Cam and Osd control protocol

This is a work in progress in order to assemble a lightweight and
open serial protocol for generic Video TX, Camera and OSD control.

I am going to implement this on my upcoming tinyOSD project.

This is a draft and open for discussion. Please fork this repo and submit a pull request for discussion.

Frame format

[HEADER:8 0x80] [DEVICE_ID:4 COMMAND:4] ..data.. [CRC:8]

The total frame length is variable in order to efficiently allow short commands. Using CRC8 as a checksum should be sufficient as we do not send packets longer than 64 bytes. (or do we?)

DEVICE_IDs

  • 0x0 = generic OSD
  • 0x1 = generic Vtx
  • 0x2 = generic Camera
  • 0x3 ... 0xF reserved for now

generic OSD device command set:

COMMANDS < 0x8 will have a fixed length
COMMANDS >= 0x8 will have variable length (byte 2 = length)

0x0 SET FLAGS

set flags such as enable, video format,...

packet length: 4 frame format: [0x80] [0x00] [FLAGS:8] [CRC:8]

  • bit 0 : enable osd
  • bit 1+2 : video format (0 = auto, 1 = pal, 2 = ntsc, 3 = reserved)
  • bit 3..7 : reserved

0x1 FILL SCREEN

fill the whole screen with the given value

packet length: 4 frame format: [0x80] [0x01] [VALUE:8] [CRC:8]

0x2 SET CHARACTER

Set a single character to a given value packet length: 6 frame format: [0x80] [0x02] [X:8] [Y:8] [VALUE:8] [CRC:8]

0x3 .. 0x7 RESERVED

0x8 CHAR WRITE (horizontal auto increment)

Write n characters to the given position with horizontal auto increment.

packet length: 4 + DATA{2} frame format: [0x80] [0x08] [LEN:8] [X:8] [Y:8] [LEN-2*DATA:8] [CRC:8] with LEN = 0..60 (as the serial buffer is 64 bytes)

The x position will auto increment for every byte in the buffer, y position will increment when the end of line is reached and x is set to zero.

0x9 CHAR WRITE (vertical auto increment)

Write n characters to the given position with vertical auto increment.

packet length: 4 + DATA{2} frame format: [0x80] [0x09] [LEN:8] [X:8] [Y:8] [LEN-2*DATA:8] [CRC:8] with LEN = 1..60 (as the serial buffer is 64 bytes)

The y position will auto increment for every byte in the buffer, x position will increment when the end of line is reached and y is set to zero.

0xA..0xE reserved

0xF SPECIAL COMMAND

special commands for gui effects (stick positions, render a spectrum, ...)

packet length: 4 + DATA{2} frame format: [0x80] [0x0F] [LEN:8] [SPECIAL_CMD:8] ... [CRC:8]

SPECIAL_COMMAND:

  • 0x00 : sticks and state, LEN=5, DATA = [A:8] [E:8] [T:8] [R:8] [FC_STATE:8]
  • 0x01..0xFF reserved

open points:

  • this protocol is meant to be bi-directional, further improvements will follow.
  • missing command for font, custom logo / graphic upload
  • missing command for enter bootloader (fw upgrades)

generic VTX command set:

This is open for discussion, should be similar to OSD

generic Camera control command set:

This is open for discussion, should be similar to OSD

opentco's People

Contributors

fishpepper avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.