31#ifndef __ARM_2D_TYPES_H__
32#define __ARM_2D_TYPES_H__
40#include "arm_2d_features.h"
41#include "arm_2d_utils.h"
42#include "__arm_2d_math.h"
49# pragma clang diagnostic push
50# pragma clang diagnostic ignored "-Wunknown-warning-option"
51# pragma clang diagnostic ignored "-Wreserved-identifier"
52# pragma clang diagnostic ignored "-Wmissing-declarations"
53# pragma clang diagnostic ignored "-Wpadded"
54# pragma clang diagnostic ignored "-Wc11-extensions"
55#elif __IS_COMPILER_ARM_COMPILER_5__
56# pragma diag_suppress 64
57#elif __IS_COMPILER_GCC__
58# pragma GCC diagnostic push
59# pragma GCC diagnostic ignored "-Wmissing-declarations"
60# pragma GCC diagnostic ignored "-Wpadded"
78 arm_fsm_rt_on_going = 1,
79 arm_fsm_rt_wait_for_obj = 2,
81 arm_fsm_rt_wait_for_res = 4,
89 ARM_2D_ERR_UNSUPPORTED_COLOUR = -11,
90 ARM_2D_ERR_BUSY = -10,
91 ARM_2D_ERR_INSUFFICIENT_RESOURCE = -9,
92 ARM_2D_ERR_IO_BUSY = -8,
93 ARM_2D_ERR_IO_ERROR = -7,
94 ARM_2D_ERR_MISSING_PARAM = -6,
95 ARM_2D_ERR_INVALID_OP = -5,
96 ARM_2D_ERR_NOT_SUPPORT = -4,
97 ARM_2D_ERR_OUT_OF_REGION = -3,
98 ARM_2D_ERR_INVALID_PARAM = -2,
99 ARM_2D_ERR_UNKNOWN = -1,
107 ARM_2D_CMP_SMALLER = -1,
108 ARM_2D_CMP_EQUALS = 0,
109 ARM_2D_CMP_LARGER = 1,
191 ARM_2D_COLOUR_SZ_1BIT = 0,
192 ARM_2D_COLOUR_SZ_2BIT = 1,
193 ARM_2D_COLOUR_SZ_4BIT = 2,
194 ARM_2D_COLOUR_SZ_8BIT = 3,
195 ARM_2D_COLOUR_SZ_16BIT = 4,
196 ARM_2D_COLOUR_SZ_32BIT = 5,
198 ARM_2D_COLOUR_SZ_1BIT_msk = ARM_2D_COLOUR_SZ_1BIT << 1,
199 ARM_2D_COLOUR_SZ_2BIT_msk = ARM_2D_COLOUR_SZ_2BIT << 1,
200 ARM_2D_COLOUR_SZ_4BIT_msk = ARM_2D_COLOUR_SZ_4BIT << 1,
201 ARM_2D_COLOUR_SZ_8BIT_msk = ARM_2D_COLOUR_SZ_8BIT << 1,
202 ARM_2D_COLOUR_SZ_16BIT_msk = ARM_2D_COLOUR_SZ_16BIT<< 1,
203 ARM_2D_COLOUR_SZ_32BIT_msk = ARM_2D_COLOUR_SZ_32BIT<< 1,
204 ARM_2D_COLOUR_SZ_msk = (0x07 << 1),
206 ARM_2D_COLOUR_LITTLE_ENDIAN = 0,
207 ARM_2D_COLOUR_BIG_ENDIAN = 1,
209 ARM_2D_COLOUR_LITTLE_ENDIAN_msk = ARM_2D_COLOUR_LITTLE_ENDIAN << 4,
210 ARM_2D_COLOUR_BIG_ENDIAN_msk = ARM_2D_COLOUR_BIG_ENDIAN << 4,
212 ARM_2D_COLOUR_NO_ALPHA = 0,
213 ARM_2D_COLOUR_HAS_ALPHA = 1,
215 ARM_2D_COLOUR_NO_ALPHA_msk = ARM_2D_COLOUR_NO_ALPHA << 0,
216 ARM_2D_COLOUR_HAS_ALPHA_msk = ARM_2D_COLOUR_HAS_ALPHA << 0,
218 ARM_2D_COLOUR_VARIANT_pos = 5,
219 ARM_2D_COLOUR_VARIANT_msk = 0x07 << ARM_2D_COLOUR_VARIANT_pos,
225#define ARM_2D_M_COLOUR_SZ_1BIT 0
226#define ARM_2D_M_COLOUR_SZ_2BIT 1
227#define ARM_2D_M_COLOUR_SZ_4BIT 2
228#define ARM_2D_M_COLOUR_SZ_8BIT 3
229#define ARM_2D_M_COLOUR_SZ_16BIT 4
230#define ARM_2D_M_COLOUR_SZ_32BIT 5
232#define ARM_2D_M_COLOUR_SZ_1BIT_msk (ARM_2D_M_COLOUR_SZ_1BIT << 1)
233#define ARM_2D_M_COLOUR_SZ_2BIT_msk (ARM_2D_M_COLOUR_SZ_2BIT << 1)
234#define ARM_2D_M_COLOUR_SZ_4BIT_msk (ARM_2D_M_COLOUR_SZ_4BIT << 1)
235#define ARM_2D_M_COLOUR_SZ_8BIT_msk (ARM_2D_M_COLOUR_SZ_8BIT << 1)
236#define ARM_2D_M_COLOUR_SZ_16BIT_msk (ARM_2D_M_COLOUR_SZ_16BIT<< 1)
237#define ARM_2D_M_COLOUR_SZ_32BIT_msk (ARM_2D_M_COLOUR_SZ_32BIT<< 1)
238#define ARM_2D_M_COLOUR_SZ_msk (0x07 << 1),
240#define ARM_2D_M_COLOUR_LITTLE_ENDIAN 0
241#define ARM_2D_M_COLOUR_BIG_ENDIAN 1
243#define ARM_2D_M_COLOUR_LITTLE_ENDIAN_msk (ARM_2D_M_COLOUR_LITTLE_ENDIAN << 4)
244#define ARM_2D_M_COLOUR_BIG_ENDIAN_msk (ARM_2D_M_COLOUR_BIG_ENDIAN << 4)
246#define ARM_2D_M_COLOUR_NO_ALPHA 0
247#define ARM_2D_M_COLOUR_HAS_ALPHA 1
249#define ARM_2D_M_COLOUR_NO_ALPHA_msk (ARM_2D_M_COLOUR_NO_ALPHA << 0)
250#define ARM_2D_M_COLOUR_HAS_ALPHA_msk (ARM_2D_M_COLOUR_HAS_ALPHA << 0)
252#define ARM_2D_M_COLOUR_VARIANT_pos 5
253#define ARM_2D_M_COLOUR_VARIANT_msk (0x07 << ARM_2D_M_COLOUR_VARIANT_pos)
259 ARM_2D_COLOUR_BIN = ARM_2D_COLOUR_SZ_1BIT_msk,
260 ARM_2D_COLOUR_1BIT = ARM_2D_COLOUR_SZ_1BIT_msk,
262 ARM_2D_COLOUR_8BIT = ARM_2D_COLOUR_SZ_8BIT_msk,
263 ARM_2D_COLOUR_GRAY8 = ARM_2D_COLOUR_SZ_8BIT_msk,
265 ARM_2D_COLOUR_16BIT = ARM_2D_COLOUR_SZ_16BIT_msk,
266 ARM_2D_COLOUR_RGB16 = ARM_2D_COLOUR_SZ_16BIT_msk,
267 ARM_2D_COLOUR_RGB565 = ARM_2D_COLOUR_RGB16,
274 ARM_2D_COLOUR_32BIT = ARM_2D_COLOUR_SZ_32BIT_msk ,
275 ARM_2D_COLOUR_RGB32 = ARM_2D_COLOUR_SZ_32BIT_msk ,
277 ARM_2D_COLOUR_CCCN888 = ARM_2D_COLOUR_RGB32 ,
278 ARM_2D_COLOUR_CCCA8888 = ARM_2D_COLOUR_SZ_32BIT_msk |
279 ARM_2D_COLOUR_HAS_ALPHA_msk ,
281 ARM_2D_COLOUR_RGB888 = ARM_2D_COLOUR_CCCN888 ,
282 ARM_2D_COLOUR_RGBA8888 = ARM_2D_COLOUR_CCCA8888 ,
291 ARM_2D_CHANNEL_8in32 = ARM_2D_COLOUR_SZ_32BIT_msk |
292 ARM_2D_COLOUR_HAS_ALPHA_msk |
293 ARM_2D_COLOUR_VARIANT_msk ,
299#define ARM_2D_M_COLOUR_BIN ARM_2D_M_COLOUR_SZ_1BIT_msk
300#define ARM_2D_M_COLOUR_1BIT ARM_2D_M_COLOUR_SZ_1BIT_msk
302#define ARM_2D_M_COLOUR_8BIT ARM_2D_M_COLOUR_SZ_8BIT_msk
303#define ARM_2D_M_COLOUR_GRAY8 ARM_2D_M_COLOUR_SZ_8BIT_msk
305#define ARM_2D_M_COLOUR_16BIT ARM_2D_M_COLOUR_SZ_16BIT_msk
306#define ARM_2D_M_COLOUR_RGB16 ARM_2D_M_COLOUR_SZ_16BIT_msk
307#define ARM_2D_M_COLOUR_RGB565 ARM_2D_M_COLOUR_RGB16
314#define ARM_2D_M_COLOUR_32BIT ARM_2D_M_COLOUR_SZ_32BIT_msk
315#define ARM_2D_M_COLOUR_RGB32 ARM_2D_M_COLOUR_SZ_32BIT_msk
317#define ARM_2D_M_COLOUR_CCCN888 ARM_2D_M_COLOUR_RGB32
318#define ARM_2D_M_COLOUR_CCCA8888 ( ARM_2D_M_COLOUR_SZ_32BIT_msk \
319 | ARM_2D_M_COLOUR_HAS_ALPHA_msk)
321#define ARM_2D_M_COLOUR_RGB888 ARM_2D_M_COLOUR_CCCN888
322#define ARM_2D_M_COLOUR_RGBA8888 ARM_2D_M_COLOUR_CCCA8888
331#define ARM_2D_M_CHANNEL_8in32 ( ARM_2D_M_COLOUR_SZ_32BIT_msk \
332 | ARM_2D_M_COLOUR_HAS_ALPHA_msk) \
333 | ARM_2D_M_COLOUR_VARIANT_msk )
338 uint8_t bHasAlpha : 1;
339 uint8_t u3ColourSZ : 3;
340 uint8_t bBigEndian : 1;
341 uint8_t u3Variant : 3;
379 implement_ex(
struct {
381 uint8_t bHasEnforcedColour : 1;
382 uint8_t bDerivedResource : 1;
408 arm_fsm_rt_t tResult;
422 arm_fsm_rt_t tResult,
430typedef bool arm_2d_evt_handler_t(
void *pTarget);
438#define ARM_2D_OP_INFO_PARAM_HAS_SOURCE _BV(0)
439#define ARM_2D_OP_INFO_PARAM_HAS_TARGET _BV(1)
440#define ARM_2D_OP_INFO_PARAM_HAS_SOURCE_MASK _BV(2)
441#define ARM_2D_OP_INFO_PARAM_HAS_TARGET_MASK _BV(3)
442#define ARM_2D_OP_INFO_PARAM_HAS_ORIGIN _BV(4)
445typedef struct __arm_2d_low_level_io_t __arm_2d_low_level_io_t;
452 uint8_t bHasSource : 1;
453 uint8_t bHasTarget : 1;
454 uint8_t bHasSrcMask : 1;
455 uint8_t bHasDesMask : 1;
456 uint8_t bHasOrigin : 1;
458 uint8_t bAllowEnforcedColour : 1;
463 uint8_t chInClassOffset;
472 uint8_t CopyOrigLike;
473 uint8_t FillOrigLike;
476 uint8_t TileProcessLike;
478 }LowLevelInterfaceIndex;
481 const __arm_2d_low_level_io_t *IO[2];
484 const __arm_2d_low_level_io_t *ptCopyLike;
485 const __arm_2d_low_level_io_t *ptFillLike;
488 const __arm_2d_low_level_io_t *ptCopyOrigLike;
489 const __arm_2d_low_level_io_t *ptFillOrigLike;
492 const __arm_2d_low_level_io_t *ptTileProcessLike;
504 ARM_2D_PREF_ACC_USE_HW_IF_POSSIBLE = 0,
507 ARM_2D_PREF_ACC_HW_ONLY = 1,
510 ARM_2D_PREF_ACC_SW_ONLY = 2,
513 ARM_2D_PREF_ACC_DONT_CARE = 3,
518#define __ARM_2D_OP_STATUS_BUSY_msk (1 << 4)
519#define __ARM_2D_OP_STATUS_IO_ERROR_msk (1 << 5)
520#define __ARM_2D_OP_STATUS_CPL_msk (1 << 6)
525 uint16_t u4SubTaskCount : 4;
526 uint16_t bIsBusy : 1;
527 uint16_t bIOError : 1;
541 uint8_t u2ACCMethods : 2;
551 uintptr_t pUserParam;
663#if (__ARM_2D_HAS_HELIUM_FLOAT__ || __ARM_2D_HAS_FPU__) \
664 && !__ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__
687#if defined(__clang__)
688#pragma clang diagnostic pop
689#elif __IS_COMPILER_ARM_COMPILER_5__
690#pragma diag_warning 64
691#elif __IS_COMPILER_GCC__
692#pragma GCC diagnostic pop