mp32 2.2.0
mp32.h File Reference

This file contains API for MP3 2 Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_uart.h"

Go to the source code of this file.

Data Structures

struct  mp32_t
 Click ctx object definition. More...
struct  mp32_cfg_t
 Click configuration structure definition. More...

Macros

#define MP32_MAP_MIKROBUS(cfg, mikrobus)
#define MP32_RETVAL   uint8_t
#define MP32_OK   0x00
#define MP32_INIT_ERROR   0xFF
#define DRV_RX_BUFFER_SIZE   200
#define DRV_TX_BUFFER_SIZE   50
#define MP32_NUM_CMD_BYTES   8
#define MP32_TIMEOUT   1000
#define MP32_MAX_VOL   0x1E
#define MP32_CMD_START_CODE   0x7E
#define MP32_CMD_END_CODE   0xEF
#define MP32_VERSION_CODE   0xFF
#define MP32_FDBK_CODE_ON   0x01
#define MP32_FDBK_CODE_OFF   0x00
#define MP32_PLAY_NEXT_SONG   0x01
#define MP32_PLAY_PREV_SONG   0x02
#define MP32_PLAY_SPEC_TRACK   0x03
#define MP32_SET_VOL_UP   0x04
#define MP32_SET_VOL_DOWN   0x05
#define MP32_SET_VOL_VALUE   0x06
#define MP32_SET_EQUALIZER   0x07
#define MP32_REP_CURR_TRACK   0x08
#define MP32_SET_DEV   0x09
#define MP32_ENTER_STDBY_MODE   0x0A
#define MP32_RESET   0x0C
#define MP32_PLAY   0x0D
#define MP32_PAUSE   0x0E
#define MP32_PLAY_SONG_SPEC   0x0F
#define MP32_SET_ALL_LOOP   0x11
#define MP32_PLAY_SONG_MP3   0x12
#define MP32_PLAY_SONG_ADV   0x13
#define MP32_SET_SONG_NAME   0x14
#define MP32_ADD_LOOP_TRACK   0x15
#define MP32_STOP   0x16
#define MP32_SET_LOOP_FOL   0x17
#define MP32_SET_SHUF_ALL   0x18
#define MP32_REP_SINGLE   0x19
#define MP32_SET_SHUF_FOL   0x28
#define MP32_EQ_NORMAL   0x00
#define MP32_EQ_POP   0x01
#define MP32_EQ_ROCK   0x02
#define MP32_EQ_JAZZ   0x03
#define MP32_EQ_CLASSIC   0x04
#define MP32_EQ_BASS   0x05
#define MP32_U_DISK   0x01
#define MP32_SDCARD   0x02
#define MP32_STOP_LOOP   0x00
#define MP32_START_LOOP   0x01
#define MP32_DISABLE   0x00
#define MP32_ENABLE   0x01

Typedefs

typedef uint8_t mp32_error_t
 Error type.

Functions

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

Detailed Description

This file contains API for MP3 2 Click driver.

Macro Definition Documentation

◆ MP32_MAX_VOL

#define MP32_MAX_VOL   0x1E

◆ MP32_NUM_CMD_BYTES

#define MP32_NUM_CMD_BYTES   8

◆ MP32_TIMEOUT

#define MP32_TIMEOUT   1000