NIBObee Library  1.4
nibobee/bgx1_protocol.h
gehe zur Dokumentation dieser Datei
00001 /*  BSD-License:
00002 
00003 Copyright (c) 2010 by Nils Springob, nicai-systems, Germany
00004 
00005 All rights reserved.
00006 
00007 Redistribution and use in source and binary forms, with or without modification,
00008 are permitted provided that the following conditions are met:
00009 
00010   * Redistributions of source code must retain the above copyright notice,
00011     this list of conditions and the following disclaimer.
00012   * Redistributions in binary form must reproduce the above copyright notice,
00013     this list of conditions and the following disclaimer in the documentation
00014     and/or other materials provided with the distribution.
00015   * Neither the name nicai-systems nor the names of its contributors may be
00016     used to endorse or promote products derived from this software without
00017     specific prior written permission.
00018 
00019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00020 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00021 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00022 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
00023 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00024 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00025 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00026 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00027 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00028 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00029 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00030 
00031 */
00032 
00040 #ifndef NIBOBEE_BGX1_PROTOCOL_H_
00041 #define NIBOBEE_BGX1_PROTOCOL_H_
00042 
00043 #include <stdint.h>
00044 #include <avr/pgmspace.h>
00045 
00046 #ifdef __cplusplus
00047 extern "C" {
00048 #endif
00049 
00050 
00051 #define BGX1_VERSION 0x0103
00052 
00053 
00054 enum {
00055   // System:
00056   CMD_Reset           = 0x00, // () -> ()
00057   CMD_GetVersion      = 0x01, // () -> (uint16_t version)
00058   CMD_GetStatus       = 0x02, // () -> (uint8_t status)
00059   CMD_SetStatus       = 0x03, // (uint8_t status) -> ()
00060   //CMD_ReadEEPROM      = 0x04, // (uint16_t address, uint8_t size) -> (uint8_t[] data)
00061   //CMD_WriteEEPROM     = 0x05, // (uint16_t address, uint8_t size, uint8_t[] data) -> ()
00062   
00063   // Display:
00064   CMD_Move            = 0x10, // (uint8_t x, uint8_t y) -> ()
00065   CMD_Mode            = 0x11, // (uint8_t mode) -> ()
00066   CMD_FillAll         = 0x12, // (uint8_t pattern) -> ()
00067   CMD_Print           = 0x13, // (char text[]) -> (uint8_t x, uint8_t y)
00068   CMD_TextWidth       = 0x14, // (char text[]) -> (uint8_t width)
00069   CMD_SelectFont      = 0x15, // (uint8_t id) -> ()
00070   CMD_HLine           = 0x16, // (uint8_t length) -> (uint8_t x, uint8_t y)
00071   CMD_VLine           = 0x17, // (uint8_t length) -> (uint8_t x, uint8_t y)
00072   CMD_Box             = 0x18, // (uint8_t width, uint8_t height) -> (uint8_t x, uint8_t y)
00073   CMD_Bitmap          = 0x19, // (uint8_t width, uint8_t height, uint8_t bitmap[]) -> (uint8_t x, uint8_t y)
00074   CMD_EmbeddedImage   = 0x1a, // (uint8_t id) -> (uint8_t x, uint8_t y)
00075   CMD_LineTo          = 0x1b, // (uint8_t x, uint8_t y) -> ()
00076 
00077   // Terminal:
00078   CMD_TermClear       = 0x30, // () -> ()
00079   CMD_TermGoto        = 0x31, // (uint8_t col, uint8_t row) -> ()
00080   CMD_TermScroll      = 0x32, // (uint8_t lines) -> ()
00081   CMD_TermPrint       = 0x33, // (char text[]) -> ()
00082 
00083   // IO:
00084   CMD_SyncPort        = 0x40, // (uint8_t ddr, uint8_t port) -> (uint8_t pin)
00085   CMD_GetAnalog       = 0x41, // (uint8_t idx) -> (uint16_t value)
00086   CMD_SyncInterface   = 0x42, // (uint8_t leds) -> (uint8_t keys)
00087   CMD_SetIllumination = 0x43, // (uint16_t value) -> ()
00088   
00089   CMD_INVALID         = 0xff 
00090 };
00091 
00092 
00093 #ifdef __cplusplus
00094 } // extern "C"
00095 #endif
00096 
00097 #endif // NIBOBEE_BGX1_PROTOCOL_H_

Erzeugt am Fre Jun 3 2011 16:39:44 für NIBObee Library von doxygen 1.7.4-20110426