//================================================================== // // Filename: mapp_AMI.h // Description: // //------------------------------------------------------------------ // // version: // date: 00:08am, 09.Apr.2012, by Sirius // Description: // //------------------------------------------------------------------ //================================================================== #ifndef _MAPP_AMI_H_ #define _MAPP_AMI_H_ /*------------------------------------------------------------------------------ * I N C L U D E *------------------------------------------------------------------------------*/ #include "stm32f0xx.h" #include "general.h" /*------------------------------------------------------------------------------ * D E F I N E *------------------------------------------------------------------------------*/ /*--- DVD protocol format ---*/ #define AMI_HEAD_CODE (0x2E) #define AMI_PROTOCOL_HEAD ((U08)0x2E) #define AMI_PROTOCOL_ACK (1) #define AMI_ACK_OK ((U08)0xFF) #define AMI_ACK_NG ((U08)0xF0) #define XBS_PROTOCOL #ifndef XBS_PROTOCOL #define XINPU_PROTOCOL #endif //------------------------------------------------------------------ // AMI message entrance // 22:05pm, 07.Jan.2014, modified by Charlie //------------------------------------------------------------------ typedef enum { AMI_MSG_NULL, /* No message to transmit */ AMI_MSG_KEY, /* Transmit steer wheel key */ AMI_MSG_ID, /* Transmit EPS packet */ AMI_MSG_VER, /* Transmit version request */ NumOfAMIMsg } T_AMI_MSG; /*------------------------------------------------------------------------------ * S T R U C T *------------------------------------------------------------------------------*/ //------------------------------------------------------------------ // struct for AMI Rx function. // 22:05pm, 07.Jan.2014, modified by Charlie //------------------------------------------------------------------ typedef struct { const U08 * datatype; void (*pfunc)(void); } T_AMI_RX_FUNC; //------------------------------------------------------------------ // AMI data structure. // 09:30am, 08.Jan.2014, modified by Charlie //------------------------------------------------------------------ typedef struct { U08 i2cstate; U08 workmode; U08 ledhm1620pwmLevel[20]; U08 ledhm1620Date[3]; U32 Ledhm1620AllDate; U08 PCA9635Led[16]; U08 PCA9635LedEn; U08 RTL8152_flag; U08 Uled; U08 Relay[3]; U08 DoorLed[3]; U16 MicVolume; U16 SpkVolume; U08 KeyVaule; U08 KeyState; U08 KeyStateBack; U08 KeyResetFlag; U08 rf_data[4]; U08 decode_ok; //½âÂë³É¹¦±ê־λ U08 callled_red; U08 callled_yel; U08 startworkflag; U08 LedKeyState; U16 FJKeymac; U08 BufRxSentTime; //bus Êý¾Ý·¢ËÍÑÓʱ U08 BufTxSentTime; //bus Êý¾Ý·¢ËÍÑÓÊ U08 Bus_RevLength; } T_AMI_CFG; /*------------------------------------------------------------------------------ * E X T E R N *------------------------------------------------------------------------------*/ extern T_AMI_CFG gtAMI; /*------------------------------------------------------------------------------ * P R O T O T Y P E *------------------------------------------------------------------------------*/ void AmiTxTask(void); void AmiRxTask(void); void AmiTaskTmr(void); void AmiValInit(void); #endif /* _MAPP_DVD_H_ */ /*------------------------------- E O F ----------------------------------------*/