File tree Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Original file line number Diff line number Diff line change 1+ /*
2+  * Copyright (c) 2025 Croxel Inc.
3+  *
4+  * SPDX-License-Identifier: Apache-2.0
5+  */
6+ 
7+ i2s_rxtx: &i2s0 {
8+ 	status = "okay";
9+ };
10+ 
11+ &i2c1 {
12+ 	max9867: max9867@18 {
13+ 		compatible = "adi,max9867";
14+ 		reg = <0x18>;
15+ 	};
16+ };
Original file line number Diff line number Diff line change 2121#define  I2S_TX_NODE   DT_NODELABEL(i2s_tx)
2222#endif 
2323
24+ /* Reduce echo delay when running on low ram devices */ 
25+ #if  CONFIG_SRAM_SIZE  <= 48 
26+ #define  ECHO_DELAY  30
27+ #else 
28+ #define  ECHO_DELAY  10
29+ #endif 
30+ 
2431#define  SAMPLE_FREQUENCY     44100
2532#define  SAMPLE_BIT_WIDTH     16
2633#define  BYTES_PER_SAMPLE     sizeof(int16_t)
2734#define  NUMBER_OF_CHANNELS   2
28- /* Such block length provides an echo with the delay of 100 ms.  */ 
29- #define  SAMPLES_PER_BLOCK    ((SAMPLE_FREQUENCY / 10 ) * NUMBER_OF_CHANNELS)
35+ /* Such block length provides an echo with the delay of 100ms or 33.33ms  */ 
36+ #define  SAMPLES_PER_BLOCK    ((SAMPLE_FREQUENCY / ECHO_DELAY ) * NUMBER_OF_CHANNELS)
3037#define  INITIAL_BLOCKS       2
3138#define  TIMEOUT              1000
3239
@@ -298,7 +305,15 @@ int main(void)
298305	config .word_size  =  SAMPLE_BIT_WIDTH ;
299306	config .channels  =  NUMBER_OF_CHANNELS ;
300307	config .format  =  I2S_FMT_DATA_FORMAT_I2S ;
308+ 	/* 
309+ 	 * On MAX32655FTHR, MAX9867 MCLK is connected to external 12.2880 crystal 
310+ 	 * thus using slave mode 
311+ 	 */ 
312+ #if  CONFIG_BOARD_MAX32655FTHR_MAX32655_M4 
313+ 	config .options  =  I2S_OPT_BIT_CLK_SLAVE  | I2S_OPT_FRAME_CLK_SLAVE ;
314+ #else 
301315	config .options  =  I2S_OPT_BIT_CLK_MASTER  | I2S_OPT_FRAME_CLK_MASTER ;
316+ #endif 
302317	config .frame_clk_freq  =  SAMPLE_FREQUENCY ;
303318	config .mem_slab  =  & mem_slab ;
304319	config .block_size  =  BLOCK_SIZE ;
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments