mp32  2.0.0.0
Functions
Public function

Functions

void mp32_cfg_setup (mp32_cfg_t *cfg)
 Config Object Initialization function. More...
 
MP32_RETVAL mp32_init (mp32_t *ctx, mp32_cfg_t *cfg)
 Initialization function. More...
 
void mp32_generic_write (mp32_t *ctx, char *data_buf, uint16_t len)
 Generic write function. More...
 
int32_t mp32_generic_read (mp32_t *ctx, char *data_buf, uint16_t max_len)
 Generic read function. More...
 
void mp32_hw_reset (mp32_t *ctx)
 Reset the device function. More...
 
void mp32_rx_cmd (mp32_t *ctx, uint8_t *rd_data, uint8_t len)
 Received response data function. More...
 
void mp32_tx_cmd (mp32_t *ctx, uint8_t cmd, uint16_t spec_data)
 Write command function. More...
 
void mp32_sw_reset (mp32_t *ctx)
 Software reset function. More...
 
void mp32_play_specific (mp32_t *ctx, uint16_t track_index)
 Play specific function. More...
 
void mp32_play_mode (mp32_t *ctx)
 Play mode function. More...
 
void mp32_pause_mode (mp32_t *ctx)
 Pause mode function. More...
 
void mp32_stop_mode (mp32_t *ctx)
 Stop mode function. More...
 
void mp32_set_volume (mp32_t *ctx, uint8_t perc)
 Set Volume function. More...
 
void mp32_volume_up (mp32_t *ctx)
 Volume up function. More...
 
void mp32_volume_down (mp32_t *ctx)
 Play next command function. More...
 
void mp32_play_next (mp32_t *ctx)
 Play previous command function. More...
 
void mp32_play_previous (mp32_t *ctx)
 Play previous command function. More...
 
void mp32_set_eq (mp32_t *ctx, uint8_t eq)
 Set equalizer mode function. More...
 
void mp32_repeat_current (mp32_t *ctx)
 Repeat current mode function. More...
 
void mp32_set_device (mp32_t *ctx, uint8_t device)
 Set device function. More...
 
void mp32_set_low_power_mode (mp32_t *ctx)
 Set Low power mode function. More...
 
void mp32_play_spec_in_fol (mp32_t *ctx, uint8_t fol_inx, uint8_t track_inx)
 Specify a certain folder and play tracks inside function. More...
 
void mp32_loop_all (mp32_t *ctx, uint8_t loop_mode)
 Play specific in loop mode function. More...
 
void mp32_play_fol (mp32_t *ctx, uint8_t fol_inx)
 Play folder function. More...
 
void mp32_loop_fol (mp32_t *ctx, uint8_t fol_inx)
 Loop folder function. More...
 
void mp32_random_all (mp32_t *ctx)
 Random Play function. More...
 
void mp32_loop (mp32_t *ctx, uint8_t state)
 Repeat a current song function. More...
 

Detailed Description

Function Documentation

◆ mp32_cfg_setup()

void mp32_cfg_setup ( mp32_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ mp32_generic_read()

int32_t mp32_generic_read ( mp32_t ctx,
char *  data_buf,
uint16_t  max_len 
)

Generic read function.

Parameters
ctxClick object.
data_bufData buffer for read data.
max_lenThe maximum length of data that can be read.
Returns
Number of reads data.

◆ mp32_generic_write()

void mp32_generic_write ( mp32_t ctx,
char *  data_buf,
uint16_t  len 
)

Generic write function.

Parameters
ctxClick object.
data_bufData buffer for sends.
lenNumber of bytes for sends.

◆ mp32_hw_reset()

void mp32_hw_reset ( mp32_t ctx)

Reset the device function.

Parameters
ctxClick object.

@description Function reset the device by set state high of the RST pin.

◆ mp32_init()

MP32_RETVAL mp32_init ( mp32_t ctx,
mp32_cfg_t cfg 
)

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ mp32_loop()

void mp32_loop ( mp32_t ctx,
uint8_t  state 
)

Repeat a current song function.

Parameters
ctxClick object.
loop_modeLoop mode:
  • 0 : Start repeating a current song.
  • 1 : Stop repeating a current song.

@description The function set repeat a current song device mode.

◆ mp32_loop_all()

void mp32_loop_all ( mp32_t ctx,
uint8_t  loop_mode 
)

Play specific in loop mode function.

Parameters
ctxClick object.
loop_mode
Loop mode:
  • 0 : Looping stop.
  • 1 : Looping start.

@description The function play specific in loop mode.

◆ mp32_loop_fol()

void mp32_loop_fol ( mp32_t ctx,
uint8_t  fol_inx 
)

Loop folder function.

Parameters
ctxClick object.
fol_inxCertain folder index.

@description The function specify a folder for looping tracks inside.

◆ mp32_pause_mode()

void mp32_pause_mode ( mp32_t ctx)

Pause mode function.

Parameters
ctxClick object.

@description The function set Pause mode command.

◆ mp32_play_fol()

void mp32_play_fol ( mp32_t ctx,
uint8_t  fol_inx 
)

Play folder function.

Parameters
ctxClick object.
fol_inxCertain folder index.

@description The function specify a folder named MP3 and paly tracks inside.

◆ mp32_play_mode()

void mp32_play_mode ( mp32_t ctx)

Play mode function.

Parameters
ctxClick object.

@description The function set Play mode command.

◆ mp32_play_next()

void mp32_play_next ( mp32_t ctx)

Play previous command function.

Parameters
ctxClick object.

@description The function command for Play previous song.

◆ mp32_play_previous()

void mp32_play_previous ( mp32_t ctx)

Play previous command function.

Parameters
ctxClick object.

@description The function command for Play previous song.

◆ mp32_play_spec_in_fol()

void mp32_play_spec_in_fol ( mp32_t ctx,
uint8_t  fol_inx,
uint8_t  track_inx 
)

Specify a certain folder and play tracks inside function.

Parameters
ctxClick object.
fol_inxCertain folder index.
track_inxTrack index.

@description The function specify a certain folder and play tracks inside.

◆ mp32_play_specific()

void mp32_play_specific ( mp32_t ctx,
uint16_t  track_index 
)

Play specific function.

Parameters
ctxClick object.
track_indexTrack index.

@description The function set instructions for specifying a track to play.

◆ mp32_random_all()

void mp32_random_all ( mp32_t ctx)

Random Play function.

Parameters
ctxClick object.

@description The function set random play command.

◆ mp32_repeat_current()

void mp32_repeat_current ( mp32_t ctx)

Repeat current mode function.

Parameters
ctxClick object.

@description The function set command for Repeat current song.

◆ mp32_rx_cmd()

void mp32_rx_cmd ( mp32_t ctx,
uint8_t *  rd_data,
uint8_t  len 
)

Received response data function.

Parameters
ctxClick object.
rd_dataResponse.
lenResponse length.

@description The function received response from the device.

◆ mp32_set_device()

void mp32_set_device ( mp32_t ctx,
uint8_t  device 
)

Set device function.

Parameters
ctxClick object.

@description The function set specify a device play tracks inside.

◆ mp32_set_eq()

void mp32_set_eq ( mp32_t ctx,
uint8_t  eq 
)

Set equalizer mode function.

Parameters
ctxClick object.
eqEqualizer mode ( from 0 to 4 ).

@description The function set equalizer mode of the device.

◆ mp32_set_low_power_mode()

void mp32_set_low_power_mode ( mp32_t ctx)

Set Low power mode function.

Parameters
ctxClick object.

@description The function set Low power mode of the device.

◆ mp32_set_volume()

void mp32_set_volume ( mp32_t ctx,
uint8_t  perc 
)

Set Volume function.

Parameters
ctxClick object.
percVolume percentage.

@description The function adjust the volume of the device.

◆ mp32_stop_mode()

void mp32_stop_mode ( mp32_t ctx)

Stop mode function.

Parameters
ctxClick object.

@description The function set Stop mode command.

◆ mp32_sw_reset()

void mp32_sw_reset ( mp32_t ctx)

Software reset function.

Parameters
ctxClick object.

@description Function set software reset of device.

◆ mp32_tx_cmd()

void mp32_tx_cmd ( mp32_t ctx,
uint8_t  cmd,
uint16_t  spec_data 
)

Write command function.

Parameters
ctxClick object.
cmdCommand.
spec_data16-bit specific data ( such as song name ).

@description The function write command specific data to the device.

◆ mp32_volume_down()

void mp32_volume_down ( mp32_t ctx)

Play next command function.

Parameters
ctxClick object.

@description The function command for Play next song.

◆ mp32_volume_up()

void mp32_volume_up ( mp32_t ctx)

Volume up function.

Parameters
ctxClick object.

@description The function increase the volume of the device.