Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:43

0001 /**
0002  * @file
0003  * @ingroup lm32_milkymist_tmu RTEMSBSPsLM32SharedMilkymistOne
0004  * @brief Milkymist TMU driver
0005  */
0006 
0007 /*  milkymist_tmu.h
0008  *
0009  *  Milkymist TMU driver for RTEMS
0010  *
0011  *  The license and distribution terms for this file may be
0012  *  found in the file LICENSE in this distribution or at
0013  *  http://www.rtems.org/license/LICENSE.
0014  *
0015  *  COPYRIGHT (c) 2010 Sebastien Bourdeauducq
0016  */
0017 
0018 /**
0019  * @defgroup lm32_milkymist_tmu Milkymist TMU
0020  * @ingroup RTEMSBSPsLM32SharedMilkymistOne
0021  * @brief Milkymist TMU driver
0022  * @{
0023  */
0024 
0025 #ifndef __MILKYMIST_TMU_H_
0026 #define __MILKYMIST_TMU_H_
0027 
0028 #ifdef __cplusplus
0029 extern "C" {
0030 #endif
0031 
0032 /* Ioctls */
0033 #define TMU_EXECUTE             0x5400
0034 #define TMU_EXECUTE_NONBLOCK    0x5401
0035 #define TMU_EXECUTE_WAIT        0x5402
0036 
0037 struct tmu_vertex {
0038   int x;
0039   int y;
0040 } __attribute__((packed));
0041 
0042 struct tmu_td {
0043   unsigned int flags;
0044   unsigned int hmeshlast;
0045   unsigned int vmeshlast;
0046   unsigned int brightness;
0047   unsigned short chromakey;
0048   struct tmu_vertex *vertices;
0049   unsigned short *texfbuf;
0050   unsigned int texhres;
0051   unsigned int texvres;
0052   unsigned int texhmask;
0053   unsigned int texvmask;
0054   unsigned short *dstfbuf;
0055   unsigned int dsthres;
0056   unsigned int dstvres;
0057   int dsthoffset;
0058   int dstvoffset;
0059   unsigned int dstsquarew;
0060   unsigned int dstsquareh;
0061   unsigned int alpha;
0062 
0063   bool invalidate_before;
0064   bool invalidate_after;
0065 };
0066 
0067 #define TMU_BRIGHTNESS_MAX     (63)
0068 #define TMU_MASK_NOFILTER      (0x3ffc0)
0069 #define TMU_MASK_FULL          (0x3ffff)
0070 #define TMU_FIXEDPOINT_SHIFT   (6)
0071 #define TMU_ALPHA_MAX          (63)
0072 #define TMU_MESH_MAXSIZE       (128)
0073 
0074 #define TMU_FLAG_CHROMAKEY     (2)
0075 #define TMU_FLAG_ADDITIVE      (4)
0076 
0077 rtems_device_driver tmu_initialize(
0078   rtems_device_major_number major,
0079   rtems_device_minor_number minor,
0080   void *arg
0081 );
0082 
0083 rtems_device_driver tmu_control(
0084   rtems_device_major_number major,
0085   rtems_device_minor_number minor,
0086   void *arg
0087 );
0088 
0089 #define TMU_DRIVER_TABLE_ENTRY {tmu_initialize, \
0090 NULL, NULL, NULL, NULL, tmu_control}
0091 
0092 /** @} */
0093 
0094 #ifdef __cplusplus
0095 }
0096 #endif
0097 
0098 #endif /* __MILKYMIST_TMU_H_ */