|
MHVLib
20111227
An efficiency oriented runtime library for AVR microcontrollers
|
00001 /* Copyright (c) 2011, Make, Hack, Void Inc 00002 * All rights reserved. 00003 * 00004 * Redistribution and use in source and binary forms, with or without 00005 * modification, are permitted provided that the following conditions are met: 00006 * * Redistributions of source code must retain the above copyright 00007 * notice, this list of conditions and the following disclaimer. 00008 * * Redistributions in binary form must reproduce the above copyright 00009 * notice, this list of conditions and the following disclaimer in the 00010 * documentation and/or other materials provided with the distribution. 00011 * * Neither the name of the Make, Hack, Void nor the 00012 * names of its contributors may be used to endorse or promote products 00013 * derived from this software without specific prior written permission. 00014 * 00015 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 00016 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00017 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00018 * DISCLAIMED. IN NO EVENT SHALL MAKE, HACK, VOID BE LIABLE FOR ANY 00019 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00020 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00021 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00022 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00023 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00024 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00025 */ 00026 00027 00028 #ifndef MHV_RGB_H_ 00029 #define MHV_RGB_H_ 00030 00031 #include <MHV_io.h> 00032 00043 #define MHV_RGB_ORDER_RGB 1 00044 #define MHV_RGB_ORDER_RBG 2 00045 #define MHV_RGB_ORDER_GRB 3 00046 #define MHV_RGB_ORDER_GBR 4 00047 #define MHV_RGB_ORDER_BGR 5 00048 #define MHV_RGB_ORDER_BRG 6 00049 00050 #ifndef MHV_RGB_ORDER 00051 #define MHV_RGB_ORDER MHV_RGB_ORDER_RGB 00052 #endif 00053 00054 #if MHV_RGB_ORDER == MHV_RGB_ORDER_RGB 00055 struct mhv_rgb { 00056 uint8_t red; 00057 uint8_t green; 00058 uint8_t blue; 00059 }; 00060 #elif MHV_RGB_ORDER == MHV_RGB_ORDER_RBG 00061 struct mhv_rgb { 00062 uint8_t red; 00063 uint8_t blue; 00064 uint8_t green; 00065 }; 00066 #elif MHV_RGB_ORDER == MHV_RGB_ORDER_GRB 00067 struct mhv_rgb { 00068 uint8_t green; 00069 uint8_t red; 00070 uint8_t blue; 00071 }; 00072 #elif MHV_RGB_ORDER == MHV_RGB_ORDER_GBR 00073 struct mhv_rgb { 00074 uint8_t green; 00075 uint8_t blue; 00076 uint8_t red; 00077 }; 00078 #elif MHV_RGB_ORDER == MHV_RGB_ORDER_BGR 00079 struct mhv_rgb { 00080 uint8_t blue; 00081 uint8_t green; 00082 uint8_t red; 00083 }; 00084 #elif MHV_RGB_ORDER == MHV_RGB_ORDER_BRG 00085 struct mhv_rgb { 00086 uint8_t blue; 00087 uint8_t red; 00088 uint8_t green; 00089 }; 00090 #endif 00091 00092 typedef struct mhv_rgb MHV_RGB; 00093 00094 #endif /* MHV_RGB_H_ */