43#ifdef PREINIT_SUPPORTED
47#ifdef MikroCCoreVersion
48 #if MikroCCoreVersion >= 1
53#include "drv_digital_out.h"
54#include "drv_digital_in.h"
55#include "drv_spi_master.h"
68#define MP3_MAP_MIKROBUS( cfg, mikrobus ) \
69 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
70 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
71 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
72 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
73 cfg.dreq = MIKROBUS( mikrobus, MIKROBUS_AN ); \
74 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
75 cfg.dcs = MIKROBUS( mikrobus, MIKROBUS_INT )
82#define MP3_WRITE_CMD 0x02
83#define MP3_READ_CMD 0x03
84#define MP3_BASE_ADDR 0x00
85#define MP3_MODE_ADDR 0x00
86#define MP3_STATUS_ADDR 0x01
87#define MP3_BASS_ADDR 0x02
88#define MP3_CLOCKF_ADDR 0x03
89#define MP3_DECODE_TIME_ADDR 0x04
90#define MP3_AUDATA_ADDR 0x05
91#define MP3_WRAM_ADDR 0x06
92#define MP3_WRAMADDR_ADDR 0x07
93#define MP3_HDAT0_ADDR 0x08
94#define MP3_HDAT1_ADDR 0x09
95#define MP3_AIADDR_ADDR 0x0A
96#define MP3_VOL_ADDR 0x0B
97#define MP3_AICTRL0_ADDR 0x0C
98#define MP3_AICTRL1_ADDR 0x0D
99#define MP3_AICTRL2_ADDR 0x0E
100#define MP3_AICTRL3_ADDR 0x0F
void mp3_cfg_setup(mp3_cfg_t *cfg)
Config Object Initialization function.
err_t mp3_data_write(mp3_t *ctx, uint8_t input)
Function writes one byte ( data ) to MP3.
uint16_t mp3_cmd_read(mp3_t *ctx, uint8_t address)
Function reads command from MP3.
err_t mp3_init(mp3_t *ctx, mp3_cfg_t *cfg)
Initialization function.
void mp3_cmd_write(mp3_t *ctx, uint8_t address, uint16_t input)
Function writes one byte (command) to MP3.
void mp3_set_volume(mp3_t *ctx, uint8_t vol_left, uint8_t vol_right)
Function set volume to MP3 click for left and right channels.
void mp3_reset(mp3_t *ctx)
Functions for reset MP3 module.
err_t mp3_data_write_32(mp3_t *ctx, uint8_t *input32)
Function Write 32 bytes ( data ) to MP3.
uint8_t mp3_is_busy(mp3_t *ctx)
Function that checks whether busy mp3.
Click configuration structure definition.
Definition mp3.h:141
spi_master_chip_select_polarity_t cs_polarity
Definition mp3.h:156
pin_name_t dcs
Definition mp3.h:151
pin_name_t sck
Definition mp3.h:145
spi_master_mode_t spi_mode
Definition mp3.h:155
pin_name_t mosi
Definition mp3.h:144
uint32_t spi_speed
Definition mp3.h:154
pin_name_t dreq
Definition mp3.h:149
pin_name_t miso
Definition mp3.h:143
pin_name_t rst
Definition mp3.h:150
pin_name_t cs
Definition mp3.h:146
Click ctx object definition.
Definition mp3.h:122
spi_master_t spi
Definition mp3.h:131
digital_in_t dreq
Definition mp3.h:128
digital_out_t rst
Definition mp3.h:124
pin_name_t chip_select
Definition mp3.h:133
digital_out_t dcs
Definition mp3.h:125