@@ -24,97 +24,97 @@ struct Daisy{{ name|capitalize }} {
2424 /* * Initializes the board according to the JSON board description
2525 * \param boost boosts the clock speed from 400 to 480 MHz
2626 */
27- void Init (bool boost=true )
27+ void Init (bool boost=true )
2828 {
2929 {% if som == ' seed' %}
3030 som.Configure ();
3131 som.Init (boost);
3232 {% else %}
3333 som.Init ();
3434 {% endif %}
35- {% if init != ' ' %}
35+ {% if init != ' ' %}
3636
37- {{init}}
37+ {{init}}
3838 {% endif %}
3939 {% if i2c != ' ' %}
4040
4141 // i2c
42- {{ i2c }}
42+ {{ i2c }}
4343 {% endif %}
44- {% if PCA9685 != ' ' %}
44+ {% if PCA9685 != ' ' %}
4545
4646 // LED Drivers
47- {{ PCA9685 }}
47+ {{ PCA9685 }}
4848 {% endif %}
49- {% if Switch != ' ' %}
49+ {% if Switch != ' ' %}
5050
5151 // Switches
52- {{ Switch }}
52+ {{ Switch }}
5353 {% endif %}
5454 {% if Switch3 != ' ' %}
5555
5656 // SPDT Switches
57- {{ Switch3 }}
57+ {{ Switch3 }}
5858 {% endif %}
59- {% if CD4021 != ' ' %}
59+ {% if CD4021 != ' ' %}
6060
6161 // Muxes
62- {{ CD4021 }}
62+ {{ CD4021 }}
6363 {% endif %}
64- {% if GateIn != ' ' %}
64+ {% if GateIn != ' ' %}
6565
6666 // Gate ins
67- {{ GateIn }}
67+ {{ GateIn }}
6868 {% endif %}
69- {% if Encoder != ' ' %}
69+ {% if Encoder != ' ' %}
7070
7171 // Rotary encoders
72- {{ Encoder }}
72+ {{ Encoder }}
7373 {% endif %}
74- {% if init_single != ' ' %}
74+ {% if init_single != ' ' %}
7575
7676 // Single channel ADC initialization
77- {{ init_single }}
77+ {{ init_single }}
7878 {% endif %}
7979 {% if som == ' seed' %}
8080 {% if analogcount > 0 %}
8181 som.adc .Init (cfg, ANALOG_COUNT );
8282 {% endif %}
8383 {% endif %}
84- {% if ctrl_init != ' ' %}
84+ {% if ctrl_init != ' ' %}
8585
8686 // AnalogControl objects
87- {{ ctrl_init }}
87+ {{ ctrl_init }}
8888 {% endif %}
89- {% if CD4051AnalogControl != ' ' %}
89+ {% if CD4051AnalogControl != ' ' %}
9090
9191 // Multiplexed AnlogControl objects
92- {{ CD4051AnalogControl }}
92+ {{ CD4051AnalogControl }}
9393 {% endif %}
94- {% if Led != ' ' %}
94+ {% if Led != ' ' %}
9595
9696 // LEDs
97- {{ Led }}
97+ {{ Led }}
9898 {% endif %}
9999 {% if RgbLed != ' ' %}
100100
101- // RBG LEDs
102- {{ RgbLed }}
101+ // RBG LEDs
102+ {{ RgbLed }}
103103 {% endif %}
104- {% if GateOut != ' ' %}
104+ {% if GateOut != ' ' %}
105105
106106 // Gate outs
107- {{ GateOut }}
107+ {{ GateOut }}
108108 {% endif %}
109109 {% if CVOuts != ' ' %}
110110
111- // DAC
112- {{ CVOuts }}
111+ // DAC
112+ {{ CVOuts }}
113113 {% endif %}
114114 {% if display != ' ' %}
115115
116116 // Display
117- {{ display }}
117+ {{ display }}
118118 {% endif %}
119119 {% if MotorShield != ' ' %}
120120
@@ -204,11 +204,11 @@ struct Daisy{{ name|capitalize }} {
204204 sai_config[0 ].b_sync = daisy::SaiHandle::Config::Sync::SLAVE ;
205205 sai_config[0 ].a_dir = daisy::SaiHandle::Config::Direction::TRANSMIT ;
206206 sai_config[0 ].b_dir = daisy::SaiHandle::Config::Direction::RECEIVE ;
207- sai_config[0 ].pin_config .fs = { DSY_GPIOE , 4 } ;
208- sai_config[0 ].pin_config .mclk = { DSY_GPIOE , 2 } ;
209- sai_config[0 ].pin_config .sck = { DSY_GPIOE , 5 } ;
210- sai_config[0 ].pin_config .sa = { DSY_GPIOE , 6 } ;
211- sai_config[0 ].pin_config .sb = { DSY_GPIOE , 3 } ;
207+ sai_config[0 ].pin_config .fs = daisy::Pin (daisy:: PORTE , 4 ) ;
208+ sai_config[0 ].pin_config .mclk = daisy::Pin (daisy:: PORTE , 2 ) ;
209+ sai_config[0 ].pin_config .sck = daisy::Pin (daisy:: PORTE , 5 ) ;
210+ sai_config[0 ].pin_config .sa = daisy::Pin (daisy:: PORTE , 6 ) ;
211+ sai_config[0 ].pin_config .sb = daisy::Pin (daisy:: PORTE , 3 ) ;
212212
213213 {% for codec in external_codecs %}
214214 sai_config[{{loop.index }}].periph = daisy::SaiHandle::Config::Peripheral::{{codec.periph }};
@@ -231,15 +231,16 @@ struct Daisy{{ name|capitalize }} {
231231 sai_handle[{{loop.index }}].Init (sai_config[{{loop.index }}]);
232232 {% endfor %}
233233
234- dsy_gpio_pin codec_reset_pin = som.GetPin (29 );
235- daisy::Ak4556::Init (codec_reset_pin);
234+ daisy::Pin codec_reset_pin = som.GetPin (29 );
235+ daisy::Ak4556 codec;
236+ codec.Init (codec_reset_pin);
236237
237238 daisy::AudioHandle::Config cfg;
238239 cfg.blocksize = 48 ;
239240 cfg.samplerate = daisy::SaiHandle::Config::SampleRate::SAI_48KHZ ;
240241 cfg.postgain = 0 .5f ;
241242 som.audio_handle .Init (
242- cfg,
243+ cfg,
243244 sai_handle[0 ]
244245 {% for codec in external_codecs %}
245246 ,sai_handle[{{loop.index }}]
@@ -255,20 +256,20 @@ struct Daisy{{ name|capitalize }} {
255256 }
256257
257258 /* * Handles all the controls processing that needs to occur at the block rate
258- *
259+ *
259260 */
260- void ProcessAllControls ()
261+ void ProcessAllControls ()
261262 {
262- {% if process != ' ' %}
263- {{ process }}
263+ {% if process != ' ' %}
264+ {{ process }}
264265 {% endif %}
265266 {% if som != ' seed' %}
266267 som.ProcessAllControls ();
267268 {% endif %}
268269 }
269270
270271 /* * Handles all the maintenance processing. This should be run last within the audio callback.
271- *
272+ *
272273 */
273274 void PostProcess ()
274275 {
@@ -279,7 +280,7 @@ struct Daisy{{ name|capitalize }} {
279280 }
280281
281282 /* * Handles processing that shouldn't occur in the audio block, such as blocking transfers
282- *
283+ *
283284 */
284285 void LoopProcess ()
285286 {
@@ -289,7 +290,7 @@ struct Daisy{{ name|capitalize }} {
289290 /* * Sets the audio sample rate
290291 * \param sample_rate the new sample rate in Hz
291292 */
292- void SetAudioSampleRate (size_t sample_rate)
293+ void SetAudioSampleRate (size_t sample_rate)
293294 {
294295 {% if som == ' seed' or som == ' petal_125b_sm' %}
295296 daisy::SaiHandle::Config::SampleRate enum_rate;
@@ -313,13 +314,13 @@ struct Daisy{{ name|capitalize }} {
313314 /* * Sets the audio block size
314315 * \param block_size the new block size in words
315316 */
316- inline void SetAudioBlockSize (size_t block_size)
317+ inline void SetAudioBlockSize (size_t block_size)
317318 {
318319 som.SetAudioBlockSize (block_size);
319320 }
320321
321322 /* * Starts up the audio callback process with the given callback
322- *
323+ *
323324 */
324325 inline void StartAudio (daisy::AudioHandle::AudioCallback cb)
325326 {
0 commit comments