@@ -63,7 +63,7 @@ static bool _mtb_wm8960_config_default(uint8_t features)
63
63
result = mtb_wm8960_write (WM8960_REG_PWR_MGMT1, value);
64
64
if (! result)
65
65
{
66
- WM8960_LOG (" Enable VREF and set VMID=50K" );
66
+ AD_LOGD (" Enable VREF and set VMID=50K" );
67
67
return result;
68
68
}
69
69
@@ -81,7 +81,7 @@ static bool _mtb_wm8960_config_default(uint8_t features)
81
81
result = mtb_wm8960_write (WM8960_REG_PWR_MGMT2, value);
82
82
if (! result)
83
83
{
84
- WM8960_LOG (" Enable DACL, DACR, LOUT1 and ROUT1" );
84
+ AD_LOGD (" Enable DACL, DACR, LOUT1 and ROUT1" );
85
85
return result;
86
86
}
87
87
}
@@ -93,7 +93,7 @@ static bool _mtb_wm8960_config_default(uint8_t features)
93
93
result = mtb_wm8960_write (WM8960_REG_CLASS_D_CTL1, 0xF7 );
94
94
if (! result)
95
95
{
96
- WM8960_LOG (" Enable Class D" );
96
+ AD_LOGD (" Enable Class D" );
97
97
return result;
98
98
}
99
99
}
@@ -126,7 +126,7 @@ static bool _mtb_wm8960_config_default(uint8_t features)
126
126
result = mtb_wm8960_write (WM8960_REG_PWR_MGMT3, pwr_mgmt3);
127
127
if (! result)
128
128
{
129
- WM8960_LOG (" WM8960_REG_PWR_MGMT3" );
129
+ AD_LOGD (" WM8960_REG_PWR_MGMT3" );
130
130
return result;
131
131
}
132
132
@@ -197,7 +197,7 @@ static bool _mtb_wm8960_config_default(uint8_t features)
197
197
result = mtb_wm8960_write (operation.reg , operation.value );
198
198
if (! result)
199
199
{
200
- WM8960_LOG (" operation" );
200
+ AD_LOGD (" operation" );
201
201
return result;
202
202
}
203
203
}
@@ -215,7 +215,7 @@ static bool _mtb_wm8960_config_default(uint8_t features)
215
215
static bool _mtb_wm8960_setup_pll (uint32_t mclk_hz,
216
216
mtb_wm8960_adc_dac_sample_rate_t sample_rate)
217
217
{
218
- WM8960_LOG (" _mtb_wm8960_setup_pll" );
218
+ AD_LOGD (" _mtb_wm8960_setup_pll" );
219
219
bool result;
220
220
uint8_t PLLN;
221
221
uint32_t PLLK;
@@ -328,7 +328,7 @@ static bool _mtb_wm8960_adjust_volume(uint8_t volume, mtb_wm8960_reg_t left_vol_
328
328
mtb_wm8960_reg_t right_vol_reg,
329
329
uint16_t update_bit, uint16_t volume_bits_mask)
330
330
{
331
- WM8960_LOG (" _mtb_wm8960_adjust_volume" );
331
+ AD_LOGD (" _mtb_wm8960_adjust_volume" );
332
332
/* Volume adjustment is done based on documentation datasheet(rev 4.4) pg 45 */
333
333
bool result;
334
334
uint16_t data;
@@ -371,7 +371,7 @@ static bool _mtb_wm8960_adjust_volume(uint8_t volume, mtb_wm8960_reg_t left_vol_
371
371
// --------------------------------------------------------------------------------------------------
372
372
373
373
bool mtb_wm8960_set_wire (void * i2c_inst){
374
- WM8960_LOG (" mtb_wm8960_set_wire" );
374
+ AD_LOGD (" mtb_wm8960_set_wire" );
375
375
376
376
/* Assign I2C hal object */
377
377
i2c_ptr = i2c_inst;
@@ -394,7 +394,7 @@ void mtb_wm8960_set_write_retry_count(uint32_t count){
394
394
bool mtb_wm8960_init (uint8_t features)
395
395
{
396
396
// use Wire and start it
397
- WM8960_LOG (" mtb_wm8960_init" );
397
+ AD_LOGD (" mtb_wm8960_init" );
398
398
399
399
bool result = mtb_wm8960_write (WM8960_REG_RESET, 0 );
400
400
if (!result)
@@ -410,7 +410,7 @@ bool mtb_wm8960_init(uint8_t features)
410
410
{
411
411
result = _mtb_wm8960_config_default (features);
412
412
if (!result) {
413
- WM8960_LOG (" _mtb_wm8960_config_default ERROR" );
413
+ AD_LOGD (" _mtb_wm8960_config_default ERROR" );
414
414
return result;
415
415
}
416
416
}
@@ -424,7 +424,7 @@ bool mtb_wm8960_init(uint8_t features)
424
424
// --------------------------------------------------------------------------------------------------
425
425
void mtb_wm8960_free (void )
426
426
{
427
- WM8960_LOG (" mtb_wm8960_free" );
427
+ AD_LOGD (" mtb_wm8960_free" );
428
428
i2c_ptr = NULL ;
429
429
pll_enabled = false ;
430
430
enabled_features = WM8960_FEATURE_NONE;
@@ -436,7 +436,7 @@ void mtb_wm8960_free(void)
436
436
// --------------------------------------------------------------------------------------------------
437
437
bool mtb_wm8960_activate (void )
438
438
{
439
- WM8960_LOG (" mtb_wm8960_activate" );
439
+ AD_LOGD (" mtb_wm8960_activate" );
440
440
bool result;
441
441
uint16_t value;
442
442
@@ -513,7 +513,7 @@ bool mtb_wm8960_activate(void)
513
513
// --------------------------------------------------------------------------------------------------
514
514
bool mtb_wm8960_deactivate (void )
515
515
{
516
- WM8960_LOG (" mtb_wm8960_deactivate" );
516
+ AD_LOGD (" mtb_wm8960_deactivate" );
517
517
bool result;
518
518
uint16_t value = 0 ;
519
519
@@ -638,7 +638,7 @@ bool i2c_write(uint8_t address, uint8_t data[2]) {
638
638
bool mtb_wm8960_write (mtb_wm8960_reg_t enum_reg, uint16_t value){
639
639
char msg[80 ];
640
640
snprintf (msg, 80 , " mtb_wm8960_write 0x%x = 0x%x" , enum_reg, value );
641
- WM8960_LOG (msg);
641
+ AD_LOGD (msg);
642
642
bool result = false ;
643
643
uint32_t count=0 ;
644
644
while (!result){
@@ -709,7 +709,7 @@ bool mtb_wm8960_clear(mtb_wm8960_reg_t reg, uint16_t mask)
709
709
// --------------------------------------------------------------------------------------------------
710
710
bool mtb_wm8960_adjust_input_volume (uint8_t volume)
711
711
{
712
- WM8960_LOG (" mtb_wm8960_adjust_input_volume" );
712
+ AD_LOGD (" mtb_wm8960_adjust_input_volume" );
713
713
if (volume > WM8960_LEFT_RIGHT_IN_VOL_INVOL_30dB)
714
714
{
715
715
return false ;
@@ -726,7 +726,7 @@ bool mtb_wm8960_adjust_input_volume(uint8_t volume)
726
726
// --------------------------------------------------------------------------------------------------
727
727
bool mtb_wm8960_adjust_heaphone_output_volume (uint8_t volume)
728
728
{
729
- WM8960_LOG (" mtb_wm8960_adjust_heaphone_output_volume" );
729
+ AD_LOGD (" mtb_wm8960_adjust_heaphone_output_volume" );
730
730
if (volume > WM8960_LOUT1_ROUT1_VOL_OUT1VOL_6dB)
731
731
{
732
732
return false ;
@@ -742,7 +742,7 @@ bool mtb_wm8960_adjust_heaphone_output_volume(uint8_t volume)
742
742
// --------------------------------------------------------------------------------------------------
743
743
bool mtb_wm8960_adjust_speaker_output_volume (uint8_t volume)
744
744
{
745
- WM8960_LOG (" mtb_wm8960_adjust_heaphone_output_volume" );
745
+ AD_LOGD (" mtb_wm8960_adjust_heaphone_output_volume" );
746
746
if (volume > WM8960_LOUT1_ROUT1_VOL_OUT1VOL_6dB)
747
747
{
748
748
return false ;
@@ -775,7 +775,7 @@ bool mtb_wm8960_configure_clocking(uint32_t mclk_hz, bool enable_pll,
775
775
mtb_wm8960_word_length_t word_length,
776
776
mtb_wm8960_mode_t mode)
777
777
{
778
- WM8960_LOG (" mtb_wm8960_configure_clocking" );
778
+ AD_LOGD (" mtb_wm8960_configure_clocking" );
779
779
bool result;
780
780
uint16_t dac_div_mask;
781
781
uint16_t adc_div_mask;
@@ -872,17 +872,17 @@ bool mtb_wm8960_configure_clocking(uint32_t mclk_hz, bool enable_pll,
872
872
}
873
873
874
874
bool mtb_wm8960_dump (){
875
- WM8960_LOG (" mtb_wm8960_dump" );
875
+ AD_LOGD (" mtb_wm8960_dump" );
876
876
char msg[80 ];
877
877
for (int j=0x1 ;j<=0x37 ;j++){
878
878
uint16_t data;
879
879
if (!mtb_wm8960_read ((mtb_wm8960_reg_t )j, &data)){
880
- WM8960_LOG (" mtb_wm8960_dump ERROR" );
880
+ AD_LOGD (" mtb_wm8960_dump ERROR" );
881
881
return false ;
882
882
}
883
883
884
884
snprintf (msg, 80 , " %x: %x" ,j, data);
885
- WM8960_LOG (msg);
885
+ AD_LOGD (msg);
886
886
}
887
887
return true ;
888
888
}
0 commit comments