/* SPDX-License-Identifier: LGPL-2.1-only OR BSD-3-Clause */
/******************************************************************************
 *
 * This file is provided under a dual license.  When you use or
 * distribute this software, you may choose to be licensed under
 * version 2.1 of the GNU Lesser General Public License
 * ("LGPLv2.1 License") or BSD License.
 *
 * LGPLv2.1 License
 *
 * Copyright(C) 2019 MediaTek Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of version 2.1 of the GNU Lesser General Public
 * License as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html for more
 * details.
 *
 * BSD LICENSE
 *
 * Copyright(C) 2019 MediaTek Inc.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 *  * Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *  * Neither the name of the copyright holder nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *****************************************************************************/

/*-----------------------------------------------------------------------------
 * $RCSfile: extmjc_if.h,v $
 * $Revision: #1 $
 * $Date: 2015/11/10 $
 * $Author: dtvbm11 $
 *
 * Description: 
 *---------------------------------------------------------------------------*/

#ifndef _DRV_EXTMJC_H_
#define _DRV_EXTMJC_H_

/*-----------------------------------------------------------------------------
                    include files
-----------------------------------------------------------------------------*/
#include "x_common.h"


/*-----------------------------------------------------------------------------
                    macros, defines, typedefs, enums
-----------------------------------------------------------------------------*/
#define DRV_EXTMJCR_OK                       ((INT32)     0)
#define DRV_EXTMJCR_INV_ARG                  ((INT32)     -1)
#define DRV_EXTMJCR_TX_FAIL                  ((INT32)     -2)
#define DRV_EXTMJCR_INV_RESP                 ((INT32)     -3)
#define DRV_EXTMJCR_REG_FAIL                 ((INT32)     -4)
#define DRV_EXTMJCR_CONNECT_NOT_READY        ((INT32)     -5)

#define DRV_EXTMJC_COLOR_TEMPERATURE_EX_IDX_RED_OFFSET11	 0
#define DRV_EXTMJC_COLOR_TEMPERATURE_EX_IDX_GREEN_OFFSET11	 1
#define DRV_EXTMJC_COLOR_TEMPERATURE_EX_IDX_BLUE_OFFSET11	 2
#define DRV_EXTMJC_COLOR_TEMPERATURE_EX_IDX_RED_GAIN1		 3
#define DRV_EXTMJC_COLOR_TEMPERATURE_EX_IDX_GREEN_GAIN1      4
#define DRV_EXTMJC_COLOR_TEMPERATURE_EX_IDX_BLUE_GAIN1		 5
#define DRV_EXTMJC_COLOR_TEMPERATURE_EX_IDX_RED_OFFSET12	 6
#define DRV_EXTMJC_COLOR_TEMPERATURE_EX_IDX_GREEN_OFFSET12	 7
#define DRV_EXTMJC_COLOR_TEMPERATURE_EX_IDX_BLUE_OFFSET12	 8
#define DRV_EXTMJC_COLOR_TEMPERATURE_EX_IDX_RED_GAIN2		 9
#define DRV_EXTMJC_COLOR_TEMPERATURE_EX_IDX_GREEN_GAIN2		 10
#define DRV_EXTMJC_COLOR_TEMPERATURE_EX_IDX_BLUE_GAIN2		 11
#define DRV_EXTMJC_COLOR_TEMPERATURE_EX_IDX_RED_OFFSET2		 12
#define DRV_EXTMJC_COLOR_TEMPERATURE_EX_IDX_GREEN_OFFSET2	 13
#define DRV_EXTMJC_COLOR_TEMPERATURE_EX_IDX_BLUE_OFFSET2	 14
#define DRV_EXTMJC_COLOR_TEMPERATURE_EX_IDX_BYPASS           0xFF


#define DRV_EXTMJC_GAMMA_OFF                    0
#define DRV_EXTMJC_GAMMA_DARK                   1
#define DRV_EXTMJC_GAMMA_MIDDLE                 2
#define DRV_EXTMJC_GAMMA_BRIGHT                 3

#define DRV_EXTMJC_LVDS_MODE_NORMAL             0
#define DRV_EXTMJC_LVDS_MODE_YUV                1
#define DRV_EXTMJC_LVDS_MODE_RGB                2

#define DRV_EXTMJC_VIDEO_FMT_COLOR_DOMAIN_YUV   1
#define DRV_EXTMJC_VIDEO_FMT_COLOR_DOMAIN_RGB   2

#define DRV_EXTMJC_PIP_MODE_NORMAL              0
#define DRV_EXTMJC_PIP_MODE_PIP                 1
#define DRV_EXTMJC_PIP_MODE_POP                 2

#define DRV_EXTMJC_OSD_MODE_NORMAL              0
#define DRV_EXTMJC_OSD_MODE_DMA                 1
#define DRV_EXTMJC_OSD_MODE_GRAPHIC             2

#define DRV_EXTMJC_MODE_OFF                     0
#define DRV_EXTMJC_MODE_MJC                     1
#define DRV_EXTMJC_MODE_DNM                     2

#define DRV_EXTMJC_VCR_MODE_ON                  1
#define DRV_EXTMJC_VCR_MODE_OFF                 2

#define DRV_EXTMJC_INPUT_SOURCE_TYPE_TV         0
#define DRV_EXTMJC_INPUT_SOURCE_TYPE_AV         1
#define DRV_EXTMJC_INPUT_SOURCE_TYPE_SV         2
#define DRV_EXTMJC_INPUT_SOURCE_TYPE_YP         3       
#define DRV_EXTMJC_INPUT_SOURCE_TYPE_VGA        4
#define DRV_EXTMJC_INPUT_SOURCE_TYPE_DVI        5
#define DRV_EXTMJC_INPUT_SOURCE_TYPE_MPEG       6

#define DRV_CUSTOM_EXTMJCR_OK                                   ((INT32)    0)    /**<        */
#define DRV_CUSTOM_EXTMJCR_INV_ARG                              ((INT32)   -1)    /**<        */
#define DRV_CUSTOM_EXTMJCR_TX_FAIL                              ((INT32)   -2)    /**<        */
#define DRV_CUSTOM_EXTMJCR_INV_RESP                             ((INT32)   -3)    /**<        */
#define DRV_CUSTOM_EXTMJCR_REG_FAIL                             ((INT32)   -4)    /**<        */
#define DRV_CUSTOM_EXTMJCR_CONNECT_NOT_READY                    ((INT32)   -5)    /**<        */

#define DRV_CUSTOM_EXTMJC_OSD_MODE_NORMAL                       ((UINT8)    0)    /**<        */
#define DRV_CUSTOM_EXTMJC_OSD_MODE_DMA                          ((UINT8)    1)    /**<        */
#define DRV_CUSTOM_EXTMJC_OSD_MODE_GRAPHIC                      ((UINT8)    2)    /**<        */

#define DRV_CUSTOM_EXTMJC_DEMO_MODE_NORMAL                      ((UINT8)    0)    /**<        */
#define DRV_CUSTOM_EXTMJC_DEMO_MODE_LEFT_MJC                    ((UINT8)    1)    /**<        */
#define DRV_CUSTOM_EXTMJC_DEMO_MODE_RIGHT_MJC                   ((UINT8)    2)    /**<        */
#define DRV_CUSTOM_EXTMJC_DEMO_MODE_BOTH_MJC                    ((UINT8)    3)    /**<        */
#define DRV_CUSTOM_EXTMJC_DEMO_MODE_LEFT_DNM                    ((UINT8)    4)    /**<        */
#define DRV_CUSTOM_EXTMJC_DEMO_MODE_RIGHT_DNM                   ((UINT8)    5)    /**<        */
#define DRV_CUSTOM_EXTMJC_DEMO_MODE_BOTH_DNM                    ((UINT8)    6)    /**<        */
#define DRV_CUSTOM_EXTMJC_DEMO_MODE_DISABLE                     ((UINT8)    7)    /**<        */

#define DRV_CUSTOM_EXTMJC_SETTING_EFFECT_OFF                    ((UINT8)    0)    /**<        */
#define DRV_CUSTOM_EXTMJC_SETTING_EFFECT_LOW                    ((UINT8)    1)    /**<        */
#define DRV_CUSTOM_EXTMJC_SETTING_EFFECT_MIDDLE                 ((UINT8)    2)    /**<        */
#define DRV_CUSTOM_EXTMJC_SETTING_EFFECT_HIGH                   ((UINT8)    3)    /**<        */

#define DRV_CUSTOM_EXTMJC_SETTING_60                            ((UINT8)    0)    /**<        */
#define DRV_CUSTOM_EXTMJC_SETTING_120                           ((UINT8)    1)    /**<        */

#define DRV_CUSTOM_EXTMJC_SETTING_DEMO_OFF                      ((UINT8)    0)    /**<        */
#define DRV_CUSTOM_EXTMJC_SETTING_DEMO_RIGHT                    ((UINT8)    1)    /**<        */
#define DRV_CUSTOM_EXTMJC_SETTING_DEMO_LEFT                     ((UINT8)    2)    /**<        */

/* message */
#define EXTMJC_MSG_TYPE_TX_EMPTY    0
#define EXTMJC_MSG_TYPE_TX_RETRY    1
#define EXTMJC_MSG_TYPE_PING        2
#define EXTMJC_MSG_TYPE_PING_FAIL   3

typedef struct _EXTMJC_MSG_T
{
    /* */
    UINT8                           ui1_msg_type;
    VOID*                           pt_obj;
} EXTMJC_MSG_T;
typedef struct DRV_EXTMJC_PIP
{
    UINT8       ui1_pip_mode;

    BOOL        b_main;
    
    UINT16      ui2_vid_left_top_x;
    UINT16      ui2_vid_left_top_y;
    UINT16      ui2_vid_right_bottom_x;
    UINT16      ui2_vid_right_bottom_y;
} DRV_EXTMJC_PIP_T;

typedef struct DRV_EXTMJC_GAMMA_TEST
{
    BOOL        b_onoff;
    UINT8       ui1_red;
    UINT8       ui1_green;
    UINT8       ui1_blue;
} DRV_EXTMJC_GAMMA_TEST_T;


/*----------------------------------------------------------------------------*/
/*! @struct DRV_CUSTOM_EXTMJC_VERSION_T
 *  @brief  This structure contains the external MJC version information
 *
 *  @code
 *  typedef struct DRV_CUSTOM_EXTMJC_VERSION
 *  {
 *      UINT8       ui1_size;
 *      UINT8       ui1_len;
 *      UINT8*      pui1_version;
 *  } DRV_CUSTOM_EXTMJC_VERSION_T;
 *  @endcode
 *
 *  @li@c  ui1_size     -
 *  @li@c  ui1_len      -
 *  @li@c  pui1_version -
 */
/*----------------------------------------------------------------------------*/
typedef struct DRV_CUSTOM_EXTMJC_VERSION
{
    UINT8       ui1_size;
    UINT8       ui1_len;
    UINT8*      pui1_version;
} DRV_CUSTOM_EXTMJC_VERSION_T;

/*----------------------------------------------------------------------------*/
/*! @struct DRV_CUSTOM_EXTMJC_WINDOW_POSITION_T
 *  @brief  This structure contains the external MJC window postion information
 *
 *  @code
 *  typedef struct DRV_CUSTOM_EXTMJC_WINDOW_POSITION
 *  {
 *      UINT16      ui2_left_top_x;
 *      UINT16      ui2_left_top_y;
 *      UINT16      ui2_right_bottom_x;
 *      UINT16      ui2_right_bottom_y;
 *  } DRV_CUSTOM_EXTMJC_WINDOW_POSITION_T;
 *  @endcode
 *
 *  @li@c  ui2_left_top_x                                    -
 *  @li@c  ui2_left_top_y                                    -
 *  @li@c  ui2_right_bottom_x                                -
 *  @li@c  ui2_right_bottom_y                                -
 */
/*----------------------------------------------------------------------------*/
typedef struct DRV_CUSTOM_EXTMJC_WINDOW_POSITION
{
    UINT16      ui2_left_top_x;
    UINT16      ui2_left_top_y;
    UINT16      ui2_right_bottom_x;
    UINT16      ui2_right_bottom_y;
} DRV_CUSTOM_EXTMJC_WINDOW_POSITION_T;

/*----------------------------------------------------------------------------*/
/*! @enum  DRV_CUSTOM_EXTMJC_COLOR_PATTERN_T
 *  @brief
 *
 *  @code
 *  typedef enum DRV_CUSTOM_EXTMJC_COLOR_PATTERN
 *  {
 *      DRV_CUSTOM_EXTMJC_COLOR_PATTERN_RED   = 0,
 *      DRV_CUSTOM_EXTMJC_COLOR_PATTERN_GREEN = 1,
 *      DRV_CUSTOM_EXTMJC_COLOR_PATTERN_BLUE  = 2,
 *      DRV_CUSTOM_EXTMJC_COLOR_PATTERN_WHITE = 3,
 *      DRV_CUSTOM_EXTMJC_COLOR_PATTERN_NONE  = 0xFF
 *  } DRV_CUSTOM_EXTMJC_COLOR_PATTERN_T;
 *  @endcode
 *
 *  @li@c  DRV_CUSTOM_EXTMJC_COLOR_PATTERN_RED               -
 *  @li@c  DRV_CUSTOM_EXTMJC_COLOR_PATTERN_GREEN             -
 *  @li@c  DRV_CUSTOM_EXTMJC_COLOR_PATTERN_BLUE              -
 *  @li@c  DRV_CUSTOM_EXTMJC_COLOR_PATTERN_WHITE             -
 *  @li@c  DRV_CUSTOM_EXTMJC_COLOR_PATTERN_NONE              -
 */
/*----------------------------------------------------------------------------*/
typedef enum DRV_CUSTOM_EXTMJC_COLOR_PATTERN
{
    DRV_CUSTOM_EXTMJC_COLOR_PATTERN_RED   = 0,
    DRV_CUSTOM_EXTMJC_COLOR_PATTERN_GREEN = 1,
    DRV_CUSTOM_EXTMJC_COLOR_PATTERN_BLUE  = 2,
    DRV_CUSTOM_EXTMJC_COLOR_PATTERN_WHITE = 3,
    DRV_CUSTOM_EXTMJC_COLOR_PATTERN_NONE  = 0xFF
} DRV_CUSTOM_EXTMJC_COLOR_PATTERN_T;

extern UINT32 _u48282UiUnmteTimeout;


/*-----------------------------------------------------------------------------
                    functions declarations
-----------------------------------------------------------------------------*/

extern INT32 drv_extmjc_init(VOID);
extern INT32 drv_extmjc_reset(VOID);
extern  UINT8 drv_extmjc_gamma_send(VOID);
extern INT32 extmjc_send_msg(EXTMJC_MSG_T* pt_msg);
extern UINT8 u1ExtmjcReadRegByI2C(
    UINT16 addr, 
    UINT8* pdata
    );

extern UINT8 u1ExtmjcWriteRegByI2C(
    UINT16 u2addr, 
    UINT32 u1data
    );

extern UINT16 u2ExtmjcWriteRegByI2CNBytes(UINT32 u4Reg, UINT8 *pData,UINT32 u4Size);

extern UINT32 u4ExtmjcGetSfCrcChecksum(UINT32 u4_size);

extern INT32 drv_extmjc_i2c_checksum_enable(BOOL flag);

extern INT32 drv_extmjc_i2c_mem_write(UINT32 u4SrcAddress,UINT32 u4DstAddress,UINT32 u4Size);
extern void drv_extmjc_gamma_write(UINT8 **pDark,UINT8 **pMiddle,
                                        UINT8 **pBright,UINT32 u4ChannelSize);
extern INT32 drv_extmjc_send_panel(UINT8 *pPanel,UINT32 len);

extern BOOL drv_extmjc_is_enable(VOID);

extern INT32 drv_extmjc_set_mjc_mode(
    UINT8       ui1_mjc_mode,
    UINT8*      pui1_msg_error
    );

extern INT32 drv_extmjc_set_color_temperature_ex(
    UINT8       ui1_path,
    UINT8       ui1_index,
    UINT16      ui2_value
    );

extern INT32 drv_extmjc_set_gamma(
    UINT8       ui1_gamma,
    UINT8*      pui1_msg_error
    );

extern INT32 drv_extmjc_set_video_fmt(
    UINT8       ui1_lvds_mode,
    UINT8       ui1_refresh_rate,
    UINT16      ui2_h_total,
    UINT16      ui2_v_total,
    UINT8       ui1_mjc_on_off,
    UINT8*      pui1_msg_error
    );

extern INT32 drv_extmjc_set_lvds_mode(
    UINT8       ui1_lvds_mode,
    UINT8*      pui1_msg_error
    );

extern INT32 drv_extmjc_set_pip(
    DRV_EXTMJC_PIP_T*   pt_pip,
    UINT8*              pui1_msg_error
    );


extern INT32 drv_extmjc_set_ping(
    UINT8*              pui1_msg_error
    );

extern INT32 drv_extmjc_set_RX_reset(
    UINT8*              pui1_msg_error
    );

extern INT32 drv_extmjc_set_lvds_enable(
    BOOL                b_enable,
    UINT8*              pui1_msg_error
    );

extern INT32 drv_extmjc_set_osd_turn_on(VOID);

extern INT32 drv_extmjc_set_osd_enable(
    BOOL                b_osd_enable,
    UINT8*              pui1_msg_error
    );

extern INT32 drv_extmjc_set_osd_mode(
    UINT8               ui1_osd_mode,
    UINT8*              pui1_msg_error
    );

extern INT32 drv_extmjc_set_osd_info(
    BOOL                b_enable_scaler,
    UINT16              ui2_osd_width,
    UINT16              ui2_osd_height,
    UINT8*              pui1_msg_error
    );

extern INT32 drv_extmjc_reset_rx_tx(
    UINT32 u4resetCnt,
    UINT8* pui1_msg_error
    );
    
extern INT32 drv_extmjc_set_vcr_mode(
    UINT8               ui1_vcr_mode,
    UINT8*              pui1_msg_error
    );

extern INT32 drv_extmjc_set_input_source_type(
    UINT8               ui1_input_source_type,
    UINT8*              pui1_msg_error
    );

extern INT32 drv_extmjc_sram_read(
    UINT16              ui2_sram_addr,
    UINT8*              pui1_msg_error
    );

extern INT32 drv_extmjc_sram_write(
    UINT16                                  ui2_sram_addr,
    UINT32                                  ui4_sram_data,
    UINT8*                                  pui1_msg_error
    );

extern INT32 d_custom_extmjc_get_dram(
    UINT32                                  ui4_addr,
    UINT32*                                 pui4_data,
    UINT8*                                  pui1_msg_error
    );

extern INT32 d_custom_extmjc_set_dram(
    UINT32                                  ui4_addr,
    UINT32                                  ui4_data,
    UINT8*                                  pui1_msg_error
    );

extern INT32 d_custom_extmjc_set_fastmute(
    BOOL              ui1_on_off,
    UINT8*              pui1_msg_error
    );
    
INT32 d_custom_extmjc_set_fastmute_timeout(
    UINT32             Counter,
    UINT8*              pui1_msg_error
    );

extern INT32 d_custom_extmjc_set_mjc_setting(
    UINT8       ui1_mjc_effect,
    UINT8       ui1_60_120,
    UINT8       ui1_demo_mode,
    UINT8*      pui1_msg_error
    );

INT32 d_custom_extmjc_set_mute(
    BOOL                ui1_on_off,
    UINT8*              pui1_msg_error
    );

extern INT32 d_custom_extmjc_set_osd_mode(
    UINT8               ui1_osd_mode,
    UINT8*              pui1_msg_error
    );

extern INT32 drv_extmjc_sflash_ProtDis(
    UINT8*      pui1_msg_error
    );

extern INT32 drv_extmjc_sflash_ProtEn(
    UINT8*      pui1_msg_error
    );

extern INT32 drv_extmjc_i2c_access_enable_password(
    UINT8*      pui1_msg_error
    );

extern INT32 drv_extmjc_i2c_access_disable_password(
    UINT8*      pui1_msg_error
    );

extern INT32 drv_extmjc_cpu_run(
    UINT8*      pui1_msg_error
    );

extern INT32 drv_extmjc_cpu_stop(
    UINT8*      pui1_msg_error
    );

extern INT32 drv_extmjc_i2c_accessable_group(
    UINT16      ui2_accessable_group,
    UINT8*      pui1_msg_error
    );

void vDrvExtmjcRedoTwoChipConnection(UINT8 u1Path,BOOL fgEnable);
void vDrvExtmjcNormProc(void);
void vDrvExtmjcSetMute(UINT32 u4Count);

// merged from u_drv_cust.h
/*----------------------------------------------------------------------------*/
/*! @brief
 *  @param [in]
 *  @param [out]
 *  @note
 *  @see
 *  @return
 *  @retval      -
 */
/*----------------------------------------------------------------------------*/
extern BOOL d_custom_extmjc_is_enable(
    VOID
);

/*----------------------------------------------------------------------------*/
/*! @brief
 *  @param [in]
 *  @param [out]
 *  @note
 *  @see
 *  @return
 *  @retval      -
 */
/*----------------------------------------------------------------------------*/
extern VOID d_custom_extmjc_enable_alive_check(
    BOOL                           b_enable
);

/*----------------------------------------------------------------------------*/
/*! @brief
 *  @param [in]
 *  @param [out]
 *  @note
 *  @see
 *  @return
 *  @retval      -
 */
/*----------------------------------------------------------------------------*/
extern BOOL d_custom_extmjc_get_alive_check(
    VOID
);

/*----------------------------------------------------------------------------*/
/*! @brief
 *  @param [in]
 *  @param [out]
 *  @note
 *  @see
 *  @return
 *  @retval      -
 */
/*----------------------------------------------------------------------------*/
extern INT32 d_custom_extmjc_get_version(
    UINT8*                         pui1_msg_error,
    DRV_CUSTOM_EXTMJC_VERSION_T*   pt_extmjc_version
);

/*----------------------------------------------------------------------------*/
/*! @brief
 *  @param [in]
 *  @param [out]
 *  @note
 *  @see
 *  @return
 *  @retval      -
 */
/*----------------------------------------------------------------------------*/
/*
extern INT32 d_custom_extmjc_set_mjc_setting(
    UINT8       ui1_mjc_effect,
    UINT8       ui1_60_120,
    UINT8       ui1_demo_mode,
    UINT8*      pui1_msg_error
);
*/
/*----------------------------------------------------------------------------*/
/*! @brief
 *  @param [in]
 *  @param [out]
 *  @note
 *  @see
 *  @return
 *  @retval      -
 */
/*----------------------------------------------------------------------------*/
/*
extern INT32 d_custom_extmjc_set_osd_mode(
    UINT8                                   ui1_osd_mode,
    UINT8*                                  pui1_msg_error
    );
*/
/*----------------------------------------------------------------------------*/
/*! @brief
 *  @param [in]
 *  @param [out]
 *  @note
 *  @see
 *  @return
 *  @retval      -
 */
/*----------------------------------------------------------------------------*/
extern INT32 d_custom_extmjc_set_window_position(
    DRV_CUSTOM_EXTMJC_WINDOW_POSITION_T*    pat_window_position,
    UINT8                                   ui1_window_num,
    UINT8*                                  pui1_msg_error
);

/*----------------------------------------------------------------------------*/
/*! @brief
 *  @param [in]
 *  @param [out]
 *  @note
 *  @see
 *  @return
 *  @retval      -
 */
/*----------------------------------------------------------------------------*/
extern INT32 d_custom_extmjc_set_color_pattern(
    DRV_CUSTOM_EXTMJC_COLOR_PATTERN_T       t_color_pattern,
    UINT8*                                  pui1_msg_error
);

/*----------------------------------------------------------------------------*/
/*! @brief
 *  @param [in]
 *  @param [out]
 *  @note
 *  @see
 *  @return
 *  @retval      -
 */
/*----------------------------------------------------------------------------*/
extern INT32 d_custom_extmjc_get_gpio(
    UINT8     ui1_gpio_id,
    BOOL*     pb_onoff,
    UINT8*    pui1_msg_error
    );

/*----------------------------------------------------------------------------*/
/*! @brief
 *  @param [in]
 *  @param [out]
 *  @note
 *  @see
 *  @return
 *  @retval      -
 */
/*----------------------------------------------------------------------------*/
extern INT32 d_custom_extmjc_set_gpio(
    UINT8     ui1_gpio_id,
    BOOL      b_onoff,
    UINT8*    pui1_msg_error
);

/*----------------------------------------------------------------------------*/
/*! @brief
 *  @param [in]
 *  @param [out]
 *  @note
 *  @see
 *  @return
 *  @retval      -
 */
/*----------------------------------------------------------------------------*/
/*
extern INT32 d_custom_extmjc_get_dram(
    UINT32     ui4_addr,
    UINT32*    pui4_data,
    UINT8*     pui1_msg_error
);
*/

/*----------------------------------------------------------------------------*/
/*! @brief
 *  @param [in]
 *  @param [out]
 *  @note
 *  @see
 *  @return
 *  @retval      -
 */
/*----------------------------------------------------------------------------*/
/*
extern INT32 d_custom_extmjc_set_dram(
    UINT32    ui4_addr,
    UINT32    ui4_data,
    UINT8*    pui1_msg_error
);
*/
/*----------------------------------------------------------------------------*/
/*! @brief
 *  @param [in]
 *  @param [out]
 *  @note
 *  @see
 *  @return
 *  @retval      -
 */
/*----------------------------------------------------------------------------*/
extern INT32 d_custom_extmjc_set_demo_mode(
    UINT8     ui1_demo_mode,
    UINT16    ui2_middle_line_pos,
    UINT8*    pui1_msg_error
);

/*----------------------------------------------------------------------------*/
/*! @brief
 *  @param [in]
 *  @param [out]
 *  @note
 *  @see
 *  @return
 *  @retval      -
 */
/*----------------------------------------------------------------------------*/
extern INT32 d_custom_extmjc_upgrade_open(
    VOID
);

/*----------------------------------------------------------------------------*/
/*! @brief
 *  @param [in]
 *  @param [out]
 *  @note
 *  @see
 *  @return
 *  @retval      -
 */
/*----------------------------------------------------------------------------*/
extern INT32 d_custom_extmjc_upgrade_erase(
    VOID
);

/* The maximun data size is 128 */
/*----------------------------------------------------------------------------*/
/*! @brief
 *  @param [in]
 *  @param [out]
 *  @note
 *  @see
 *  @return
 *  @retval      -
 */
/*----------------------------------------------------------------------------*/
extern INT32 d_custom_extmjc_upgrade_write(
    UINT32    ui4_offset,
    UINT8*    pui1_data,
    UINT32    ui4_data_size
);

/*----------------------------------------------------------------------------*/
/*! @brief
 *  @param [in]
 *  @param [out]
 *  @note
 *  @see
 *  @return
 *  @retval      -
 */
/*----------------------------------------------------------------------------*/
extern INT32 d_custom_extmjc_upgrade_close(
    VOID
);


#endif /* _DRV_EXTMJC_H_ */
