LibDriver WM8978
Loading...
Searching...
No Matches
wav simple player function

wav simple player modules More...

Collaboration diagram for wav simple player function:

Data Structures

struct  wav_header_s
 wav header structure definition More...
struct  wav_handle_s
 wav handle structure definition More...

Macros

#define WAV_BUFFER_SIZE   (1024 * 32)
 wav buffer size definition
#define WAV_LINK_INIT(HANDLE, STRUCTURE)
 initialize wav_handle_t structure
#define WAV_LINK_AUDIO_INIT(HANDLE, FUC)
 link audio_init function
#define WAV_LINK_AUDIO_DEINIT(HANDLE, FUC)
 link audio_deinit function
#define WAV_LINK_AUDIO_READ(HANDLE, FUC)
 link audio_read function
#define WAV_LINK_AUDIO_WRITE(HANDLE, FUC)
 link audio_write function
#define WAV_LINK_IIS_INIT(HANDLE, FUC)
 link iis_init function
#define WAV_LINK_IIS_DEINIT(HANDLE, FUC)
 link iis_deinit function
#define WAV_LINK_IIS_STOP(HANDLE, FUC)
 link iis_stop function
#define WAV_LINK_IIS_PAUSE(HANDLE, FUC)
 link iis_pause function
#define WAV_LINK_IIS_RESUME(HANDLE, FUC)
 link iis_resume function
#define WAV_LINK_IIS_SET_FREQ(HANDLE, FUC)
 link iis_set_freq function
#define WAV_LINK_IIS_WRITE(HANDLE, FUC)
 link iis_write function
#define WAV_LINK_IIS_READ(HANDLE, FUC)
 link iis_read function
#define WAV_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define WAV_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function

Typedefs

typedef struct wav_header_s wav_header_t
 wav header structure definition
typedef struct wav_handle_s wav_handle_t
 wav handle structure definition

Enumerations

enum  wav_status_t { WAV_STATUS_STOP = 0x00 , WAV_STATUS_PLAY = 0x01 }
 wav status enumeration definition More...

Functions

uint8_t wav_init (wav_handle_t *handle)
 initialize the wav
uint8_t wav_deinit (wav_handle_t *handle)
 wav deinit
uint8_t wav_player_init (wav_handle_t *handle, char *path)
 initialize the wav player
uint8_t wav_player_buffer_fill (wav_handle_t *handle, uint8_t index)
 wav player buffer fill
uint8_t wav_record_file_fill (wav_handle_t *handle, uint8_t index)
 wav record file fill
uint8_t wav_player_get_status (wav_handle_t *handle, wav_status_t *status)
 wav get status
uint8_t wav_player_config (wav_handle_t *handle, uint32_t standard, uint32_t mode, uint32_t polarity, uint32_t format, uint32_t enable, uint32_t freq)
 wav player config
uint8_t wav_record_start (wav_handle_t *handle, uint32_t sample_rate, char *path)
 wav record start
uint8_t wav_record_stop (wav_handle_t *handle)
 wav record stop
uint8_t wav_player_start (wav_handle_t *handle)
 wav player start
uint8_t wav_player_stop (wav_handle_t *handle)
 wav player stop
uint8_t wav_player_pause (wav_handle_t *handle)
 wav player pause
uint8_t wav_player_resume (wav_handle_t *handle)
 wav player resume

Detailed Description

wav simple player modules

Macro Definition Documentation

◆ WAV_BUFFER_SIZE

#define WAV_BUFFER_SIZE   (1024 * 32)

wav buffer size definition

Definition at line 59 of file wav_player.h.

◆ WAV_LINK_AUDIO_DEINIT

#define WAV_LINK_AUDIO_DEINIT ( HANDLE,
FUC )
Value:
(HANDLE)->audio_deinit = FUC

link audio_deinit function

Parameters
[in]HANDLEpointer to a wav handle structure
[in]FUCpointer to an audio_deinit function address
Note
none

Definition at line 141 of file wav_player.h.

◆ WAV_LINK_AUDIO_INIT

#define WAV_LINK_AUDIO_INIT ( HANDLE,
FUC )
Value:
(HANDLE)->audio_init = FUC

link audio_init function

Parameters
[in]HANDLEpointer to a wav handle structure
[in]FUCpointer to an audio_init function address
Note
none

Definition at line 133 of file wav_player.h.

◆ WAV_LINK_AUDIO_READ

#define WAV_LINK_AUDIO_READ ( HANDLE,
FUC )
Value:
(HANDLE)->audio_read = FUC

link audio_read function

Parameters
[in]HANDLEpointer to a wav handle structure
[in]FUCpointer to an audio_read function address
Note
none

Definition at line 149 of file wav_player.h.

◆ WAV_LINK_AUDIO_WRITE

#define WAV_LINK_AUDIO_WRITE ( HANDLE,
FUC )
Value:
(HANDLE)->audio_write = FUC

link audio_write function

Parameters
[in]HANDLEpointer to a wav handle structure
[in]FUCpointer to an audio_write function address
Note
none

Definition at line 157 of file wav_player.h.

◆ WAV_LINK_DEBUG_PRINT

#define WAV_LINK_DEBUG_PRINT ( HANDLE,
FUC )
Value:
(HANDLE)->debug_print = FUC

link debug_print function

Parameters
[in]HANDLEpointer to a wav handle structure
[in]FUCpointer to a debug_print function address
Note
none

Definition at line 237 of file wav_player.h.

◆ WAV_LINK_DELAY_MS

#define WAV_LINK_DELAY_MS ( HANDLE,
FUC )
Value:
(HANDLE)->delay_ms = FUC

link delay_ms function

Parameters
[in]HANDLEpointer to a wav handle structure
[in]FUCpointer to a delay_ms function address
Note
none

Definition at line 229 of file wav_player.h.

◆ WAV_LINK_IIS_DEINIT

#define WAV_LINK_IIS_DEINIT ( HANDLE,
FUC )
Value:
(HANDLE)->iis_deinit = FUC

link iis_deinit function

Parameters
[in]HANDLEpointer to a wav handle structure
[in]FUCpointer to an iis_deinit function address
Note
none

Definition at line 173 of file wav_player.h.

◆ WAV_LINK_IIS_INIT

#define WAV_LINK_IIS_INIT ( HANDLE,
FUC )
Value:
(HANDLE)->iis_init = FUC

link iis_init function

Parameters
[in]HANDLEpointer to a wav handle structure
[in]FUCpointer to an iis_init function address
Note
none

Definition at line 165 of file wav_player.h.

◆ WAV_LINK_IIS_PAUSE

#define WAV_LINK_IIS_PAUSE ( HANDLE,
FUC )
Value:
(HANDLE)->iis_pause = FUC

link iis_pause function

Parameters
[in]HANDLEpointer to a wav handle structure
[in]FUCpointer to an iis_pause function address
Note
none

Definition at line 189 of file wav_player.h.

◆ WAV_LINK_IIS_READ

#define WAV_LINK_IIS_READ ( HANDLE,
FUC )
Value:
(HANDLE)->iis_read = FUC

link iis_read function

Parameters
[in]HANDLEpointer to a wav handle structure
[in]FUCpointer to an iis_write function address
Note
none

Definition at line 221 of file wav_player.h.

◆ WAV_LINK_IIS_RESUME

#define WAV_LINK_IIS_RESUME ( HANDLE,
FUC )
Value:
(HANDLE)->iis_resume = FUC

link iis_resume function

Parameters
[in]HANDLEpointer to a wav handle structure
[in]FUCpointer to an iis_resume function address
Note
none

Definition at line 197 of file wav_player.h.

◆ WAV_LINK_IIS_SET_FREQ

#define WAV_LINK_IIS_SET_FREQ ( HANDLE,
FUC )
Value:
(HANDLE)->iis_set_freq = FUC

link iis_set_freq function

Parameters
[in]HANDLEpointer to a wav handle structure
[in]FUCpointer to an iis_set_freq function address
Note
none

Definition at line 205 of file wav_player.h.

◆ WAV_LINK_IIS_STOP

#define WAV_LINK_IIS_STOP ( HANDLE,
FUC )
Value:
(HANDLE)->iis_stop = FUC

link iis_stop function

Parameters
[in]HANDLEpointer to a wav handle structure
[in]FUCpointer to an iis_stop function address
Note
none

Definition at line 181 of file wav_player.h.

◆ WAV_LINK_IIS_WRITE

#define WAV_LINK_IIS_WRITE ( HANDLE,
FUC )
Value:
(HANDLE)->iis_write = FUC

link iis_write function

Parameters
[in]HANDLEpointer to a wav handle structure
[in]FUCpointer to an iis_write function address
Note
none

Definition at line 213 of file wav_player.h.

◆ WAV_LINK_INIT

#define WAV_LINK_INIT ( HANDLE,
STRUCTURE )
Value:
memset(HANDLE, 0, sizeof(STRUCTURE))

initialize wav_handle_t structure

Parameters
[in]HANDLEpointer to a wav handle structure
[in]STRUCTUREwav_handle_t
Note
none

Definition at line 125 of file wav_player.h.

Typedef Documentation

◆ wav_handle_t

typedef struct wav_handle_s wav_handle_t

wav handle structure definition

◆ wav_header_t

typedef struct wav_header_s wav_header_t

wav header structure definition

Enumeration Type Documentation

◆ wav_status_t

wav status enumeration definition

Enumerator
WAV_STATUS_STOP 

stop status

WAV_STATUS_PLAY 

play status

Definition at line 65 of file wav_player.h.

Function Documentation

◆ wav_deinit()

uint8_t wav_deinit ( wav_handle_t * handle)

wav deinit

Parameters
[in]*handlepointer to a wav handle structure
Returns
status code
  • 0 success
  • 1 deinit failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 221 of file wav_player.c.

◆ wav_init()

uint8_t wav_init ( wav_handle_t * handle)

initialize the wav

Parameters
[in]*handlepointer to a wav handle structure
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 linked functions is NULL
Note
none

Definition at line 117 of file wav_player.c.

◆ wav_player_buffer_fill()

uint8_t wav_player_buffer_fill ( wav_handle_t * handle,
uint8_t index )

wav player buffer fill

Parameters
[in]*handlepointer to a wav handle structure
[in]indexfill index
Returns
status code
  • 0 success
  • 1 fill failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 not playing
Note
none

Definition at line 825 of file wav_player.c.

◆ wav_player_config()

uint8_t wav_player_config ( wav_handle_t * handle,
uint32_t standard,
uint32_t mode,
uint32_t polarity,
uint32_t format,
uint32_t enable,
uint32_t freq )

wav player config

Parameters
[in]*handlepointer to a wav handle structure
[in]standardiis standard
[in]modeiis mode
[in]polarityiis polarity
[in]formatiis format
[in]enablemclk output
[in]freqset freq
Returns
status code
  • 0 success
  • 1 config failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 391 of file wav_player.c.

◆ wav_player_get_status()

uint8_t wav_player_get_status ( wav_handle_t * handle,
wav_status_t * status )

wav get status

Parameters
[in]*handlepointer to a wav handle structure
[out]*statuspointer to a status buffer
Returns
status code
  • 0 success
  • 1 get status failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 797 of file wav_player.c.

◆ wav_player_init()

uint8_t wav_player_init ( wav_handle_t * handle,
char * path )

initialize the wav player

Parameters
[in]*handlepointer to a wav handle structure
[in]*pathpointer to a path buffer
Returns
status code
  • 0 success
  • 1 play failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 format is invalid
Note
none

Definition at line 249 of file wav_player.c.

◆ wav_player_pause()

uint8_t wav_player_pause ( wav_handle_t * handle)

wav player pause

Parameters
[in]*handlepointer to a wav handle structure
Returns
status code
  • 0 success
  • 1 pause failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 not playing
Note
none

Definition at line 721 of file wav_player.c.

◆ wav_player_resume()

uint8_t wav_player_resume ( wav_handle_t * handle)

wav player resume

Parameters
[in]*handlepointer to a wav handle structure
Returns
status code
  • 0 success
  • 1 resume failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 be playing
Note
none

Definition at line 759 of file wav_player.c.

◆ wav_player_start()

uint8_t wav_player_start ( wav_handle_t * handle)

wav player start

Parameters
[in]*handlepointer to a wav handle structure
Returns
status code
  • 0 success
  • 1 start failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 be playing
Note
none

Definition at line 431 of file wav_player.c.

◆ wav_player_stop()

uint8_t wav_player_stop ( wav_handle_t * handle)

wav player stop

Parameters
[in]*handlepointer to a wav handle structure
Returns
status code
  • 0 success
  • 1 stop failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 not playing
Note
none

Definition at line 670 of file wav_player.c.

◆ wav_record_file_fill()

uint8_t wav_record_file_fill ( wav_handle_t * handle,
uint8_t index )

wav record file fill

Parameters
[in]*handlepointer to a wav handle structure
[in]indexfill index
Returns
status code
  • 0 success
  • 1 fill failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 not recording
Note
none

Definition at line 558 of file wav_player.c.

◆ wav_record_start()

uint8_t wav_record_start ( wav_handle_t * handle,
uint32_t sample_rate,
char * path )

wav record start

Parameters
[in]*handlepointer to a wav handle structure
[in]sample_ratesample rate
[in]*pathpointer to a path buffer
Returns
status code
  • 0 success
  • 1 start failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 be recording
Note
none

Definition at line 479 of file wav_player.c.

◆ wav_record_stop()

uint8_t wav_record_stop ( wav_handle_t * handle)

wav record stop

Parameters
[in]*handlepointer to a wav handle structure
Returns
status code
  • 0 success
  • 1 stop failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 not recording
Note
none

Definition at line 611 of file wav_player.c.