
#ifndef IIS_MAX98357_H__
#define IIS_MAX98357_H__
//#include "TYW_stdint.h"
#include "r_typedefs.h"
typedef enum
{
    IIS_SET_OK = 0,
    IIS_SET_LEN_ERROR,
    IIS_SET_DATA_ERROR,
    IIS_SET_STATUS_ERROR,
    IIS_SET_NUM_ERROR,
} IIS_Start_Status_en_t;
typedef enum
{
    IIS_PLAY_IDLE = 0,
    IIS_PLAY_BUSY,
} IIS_Play_Status_en_t;
typedef enum
{
    IIS_VOLUME_03DB = 0,
    IIS_VOLUME_06DB,
    IIS_VOLUME_09DB,
    IIS_VOLUME_12DB,
    IIS_VOLUME_15DB,
    IIS_VOLUME_ERROR,
} IIS_Volume_en_t;

typedef enum
{
    IIS_STEP_IDLE = 0,
    IIS_STEP_BUSY,

} IIS_Step_en_t;
typedef struct
{
    uint16_t u16IISPlayCount;        /*0xFFFF is forever,0 is illicit */
    uint32_t u32IISTotalCount;       /**/
    uint32_t u32IISTotalCountBackup; /**/
    uint8_t u8IISOnceCount;
    const uint8_t *pu8IISDataBackup;
    const uint8_t *pu8IISData;
    IIS_Step_en_t enIISStep;
    uint8_t u8IISForceStop;
} IIS_Control_st_t;

extern IIS_Control_st_t g_stIISControl;
extern const unsigned char DoorOpen[];

extern void IIS_Reset(void);
extern void I2S_MAX98357_Init(void);
extern IIS_Start_Status_en_t I2S_MAX98357_InternalFlash_CH0_Player(const uint8_t *pu8Data, uint32_t u32Len, uint32_t u32Cycles);
extern void I2S_MAX98357_Stop(uint8_t u8Channel);
extern IIS_Play_Status_en_t I2S_MAX98357_GetStatus(uint8_t u8Channel);
extern void I2S_MAX98357_TX(void);
extern void I2S_MAX98357_Volume_Set(IIS_Volume_en_t enIISVolume);

#endif
