Contiki-NG
Loading...
Searching...
No Matches

platforms More...

Files

file  mp3-wtv020sd.c
 Header file for the MP3 WTV020SD driver.
 
file  mp3-wtv020sd.h
 Header file for the MP3 WTV020SD driver.
 

Functions

int mp3_wtv020sd_config (uint8_t mode)
 Init function for the MP3 driver.
 
int mp3_wtv020sd_gpio_play (void)
 Function to play a current track.
 
int mp3_wtv020sd_gpio_stop (void)
 Function to stop a current track.
 
int mp3_wtv020sd_gpio_next (void)
 Advances and play the next track, wraps over the playlist.
 
int mp3_wtv020sd_busy (void)
 Get the current status of the device (playing/stopped)
 
int mp3_wtv020sd_reset (void)
 Trigger a module reset.
 
int mp3_wtv020sd_sync_play (uint16_t track)
 Plays the selected track and waits until it stops.
 
int mp3_wtv020sd_async_play (uint16_t track)
 Plays the selected track and returns immediately.
 
int mp3_wtv020sd_stop (void)
 Stops the current track.
 
int mp3_wtv020sd_pause (void)
 Pauses the current track.
 

Detailed Description

platforms

Driver to control the MP3 WTV020SD board in MP3 mode (GPIO based) and the 2-line serial mode (CLK/DI). Loop Mode and Key Modes not implemented. More product information available at: http://avrproject.ru/chasy-budilnik/WTV020SD.pdf An example on how to wire with a sound power amplifier and speakers at http://www.hackster.io/zolertia Based on the Arduino Wtv020sd16p library

Driver to control the MP3 WTV020SD board in MP3 mode (GPIO based) and the 2-line serial mode (CLK/DI). Loop Mode and Key Modes not implemented. More product information available at: http://avrproject.ru/chasy-budilnik/WTV020SD.pdf An example on how to wire with a sound power amplifier and speakers at http://www.hackster.io/zolertia

Function Documentation

◆ mp3_wtv020sd_async_play()

int mp3_wtv020sd_async_play ( uint16_t track)

Plays the selected track and returns immediately.

Parameters
trackforwards and play the selected track, starting from MP3_TRACK_BASE (0000.ad4) up to MP3_TRACK_BASE + 511 (0511.ad4)
Returns
MP3_WTV020SD_ERROR if invalid mode used, otherwise it will return MP3_WTV020SD_SUCCESS

Definition at line 225 of file mp3-wtv020sd.c.

◆ mp3_wtv020sd_busy()

int mp3_wtv020sd_busy ( void )

Get the current status of the device (playing/stopped)

Returns
MP3_WTV020SD_BUSY if a track is playing, otherwise it will return MP3_WTV020SD_IDLE

Definition at line 185 of file mp3-wtv020sd.c.

References GPIO_READ_PIN.

Referenced by mp3_wtv020sd_sync_play().

◆ mp3_wtv020sd_config()

int mp3_wtv020sd_config ( uint8_t mode)

Init function for the MP3 driver.

Configures the pins required to operate in either driver mode

Parameters
modedrive the board using GPIOs or the two-line mode, using either MP3_WTV020SD_GPIO_MODE or MP3_WTV020SD_LINE_MODE
Returns
MP3_WTV020SD_ERROR if invalid mode selected, otherwise it will return MP3_WTV020SD_SUCCESS

Definition at line 120 of file mp3-wtv020sd.c.

References GPIO_SET_INPUT, GPIO_SET_OUTPUT, GPIO_SET_PIN, and GPIO_SOFTWARE_CONTROL.

◆ mp3_wtv020sd_gpio_next()

int mp3_wtv020sd_gpio_next ( void )

Advances and play the next track, wraps over the playlist.

Returns
MP3_WTV020SD_ERROR if invalid mode used, otherwise it will return MP3_WTV020SD_SUCCESS

Definition at line 173 of file mp3-wtv020sd.c.

References clock_delay_usec(), GPIO_CLR_PIN, and GPIO_SET_PIN.

◆ mp3_wtv020sd_gpio_play()

int mp3_wtv020sd_gpio_play ( void )

Function to play a current track.

Returns
MP3_WTV020SD_ERROR if invalid mode used, otherwise it will return MP3_WTV020SD_SUCCESS

Definition at line 153 of file mp3-wtv020sd.c.

References GPIO_CLR_PIN.

◆ mp3_wtv020sd_gpio_stop()

int mp3_wtv020sd_gpio_stop ( void )

Function to stop a current track.

Returns
MP3_WTV020SD_ERROR if invalid mode used, otherwise it will return MP3_WTV020SD_SUCCESS

Definition at line 163 of file mp3-wtv020sd.c.

References GPIO_SET_PIN.

◆ mp3_wtv020sd_pause()

int mp3_wtv020sd_pause ( void )

Pauses the current track.

Returns
MP3_WTV020SD_ERROR if invalid mode used, otherwise it will return MP3_WTV020SD_SUCCESS

Definition at line 245 of file mp3-wtv020sd.c.

◆ mp3_wtv020sd_reset()

int mp3_wtv020sd_reset ( void )

Trigger a module reset.

Returns
MP3_WTV020SD_ERROR if invalid mode used, otherwise it will return MP3_WTV020SD_SUCCESS

Definition at line 198 of file mp3-wtv020sd.c.

References clock_delay_usec(), GPIO_CLR_PIN, and GPIO_SET_PIN.

◆ mp3_wtv020sd_stop()

int mp3_wtv020sd_stop ( void )

Stops the current track.

Returns
MP3_WTV020SD_ERROR if invalid mode used, otherwise it will return MP3_WTV020SD_SUCCESS

Definition at line 235 of file mp3-wtv020sd.c.

◆ mp3_wtv020sd_sync_play()

int mp3_wtv020sd_sync_play ( uint16_t track)

Plays the selected track and waits until it stops.

Parameters
trackforwards and play the selected track, starting from MP3_TRACK_BASE (0000.ad4) up to MP3_TRACK_BASE + 511 (0511.ad4)
Returns
MP3_WTV020SD_ERROR if invalid mode used, otherwise it will return MP3_WTV020SD_SUCCESS

Definition at line 214 of file mp3-wtv020sd.c.

References mp3_wtv020sd_busy().