Sound_Player.h 1002 Bytes
Newer Older
hu's avatar
hu committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47

#ifndef _SOUND_PLAYER_H_
#define _SOUND_PLAYER_H_

#include "TYW_stdint.h"
#include "Sound_Source.h"

                     /*
extern volatile uint8_t SoundPlaySeatbeltSync;
#define   SND_SEATBELT_SYNC                 SoundPlaySeatbeltSync
                            */

#define   SND_PLAYER_IDLE                   0x00
#define   SND_PLAYER_PLAY_REQ               0x01
#define   SND_PLAYER_PLAYING                0x02
#define   SND_PLAYER_STOP_REQ               0x03

#define   SND_VOLUME_HI                      8
#define   SND_VOLUME_MID                     4
#define   SND_VOLUME_LOW                     1





typedef struct
{
    uint8_t   Status;
    uint8_t   Playing;
    uint16_t  Timer;
    uint8_t   Cycle;
    uint8_t   VolInit;
} SoundPlayCtrlStruct;




void Sound_Player_Init ( void );

uint8_t Sound_Play ( uint8_t SoundID );
uint8_t Sound_Stop ( uint8_t SoundID );
void Sound_Clear ( void );
uint8_t Sound_Priority_Query ( uint8_t SoundID );

void Sound_Play_Service ( void );

#endif