libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
daisy_petal.h
Go to the documentation of this file.
1#pragma once
2#ifndef DSY_PETAL_H
3#define DSY_PETAL_H
5#include "daisy_seed.h"
6
7namespace daisy
8{
14{
15 public:
28
40
54
64
69
71 void Init(bool boost = false);
72
77 void DelayMs(size_t del);
78
79
84
89
95
101
103 void StopAudio();
104
109
113
117 void SetAudioBlockSize(size_t size);
118
121
124
126 void StartAdc();
127
129 void StopAdc();
130
133
135 inline void ProcessAllControls()
136 {
139 }
140
141
147
150
153
155 void ClearLeds();
156
159
167 void SetRingLed(RingLed idx, float r, float g, float b);
168
174 void SetFootswitchLed(FootswitchLed idx, float bright);
175
182
186 private:
187 void SetHidUpdateRates();
188 void InitSwitches();
189 void InitEncoder();
190 void InitLeds();
191 void InitAnalogControls();
192
193 inline uint16_t* adc_ptr(const uint8_t chn) { return seed.adc.GetPtr(chn); }
194
195 LedDriverPca9685<2, true> led_driver_;
196};
197
198} // namespace daisy
199
200#endif
uint16_t * GetPtr(uint8_t chn) const
Hardware Interface for control inputs Primarily designed for ADC input controls such as potentiomet...
Definition ctrl.h:18
void(* AudioCallback)(InputBuffer in, OutputBuffer out, size_t size)
Definition audio.h:65
void(* InterleavingAudioCallback)(InterleavingInputBuffer in, InterleavingOutputBuffer out, size_t size)
Definition audio.h:83
Helpers and hardware definitions for daisy petal.
Definition daisy_petal.h:14
Knob
Definition daisy_petal.h:31
@ KNOB_4
Definition daisy_petal.h:35
@ KNOB_3
Definition daisy_petal.h:34
@ KNOB_5
Definition daisy_petal.h:36
@ KNOB_6
Definition daisy_petal.h:37
@ KNOB_1
Definition daisy_petal.h:32
@ KNOB_2
Definition daisy_petal.h:33
@ KNOB_LAST
Definition daisy_petal.h:38
Led footswitch_led[4]
Definition daisy_petal.h:184
DaisyPetal()
Definition daisy_petal.h:66
float GetKnobValue(Knob k)
void SetAudioBlockSize(size_t size)
RgbLed ring_led[8]
Definition daisy_petal.h:183
Sw
Definition daisy_petal.h:18
@ SW_2
Definition daisy_petal.h:20
@ SW_5
Definition daisy_petal.h:23
@ SW_3
Definition daisy_petal.h:21
@ SW_1
Definition daisy_petal.h:19
@ SW_4
Definition daisy_petal.h:22
@ SW_6
Definition daisy_petal.h:24
@ SW_7
Definition daisy_petal.h:25
@ SW_LAST
Definition daisy_petal.h:26
AnalogControl knob[KNOB_LAST]
Definition daisy_petal.h:179
DaisySeed seed
Definition daisy_petal.h:176
~DaisyPetal()
Definition daisy_petal.h:68
AnalogControl expression
Definition daisy_petal.h:180
Switch switches[SW_LAST]
Definition daisy_petal.h:181
void SetFootswitchLed(FootswitchLed idx, float bright)
void ChangeAudioCallback(AudioHandle::AudioCallback cb)
void StartAudio(AudioHandle::InterleavingAudioCallback cb)
void StartAudio(AudioHandle::AudioCallback cb)
RingLed
Definition daisy_petal.h:43
@ RING_LED_3
Definition daisy_petal.h:46
@ RING_LED_8
Definition daisy_petal.h:51
@ RING_LED_1
Definition daisy_petal.h:44
@ RING_LED_LAST
Definition daisy_petal.h:52
@ RING_LED_4
Definition daisy_petal.h:47
@ RING_LED_7
Definition daisy_petal.h:50
@ RING_LED_5
Definition daisy_petal.h:48
@ RING_LED_2
Definition daisy_petal.h:45
@ RING_LED_6
Definition daisy_petal.h:49
void DelayMs(size_t del)
float AudioCallbackRate()
Encoder encoder
Definition daisy_petal.h:177
void SetAudioSampleRate(SaiHandle::Config::SampleRate samplerate)
void ProcessDigitalControls()
void ChangeAudioCallback(AudioHandle::InterleavingAudioCallback cb)
void ProcessAnalogControls()
void Init(bool boost=false)
FootswitchLed
Definition daisy_petal.h:57
@ FOOTSWITCH_LED_4
Definition daisy_petal.h:61
@ FOOTSWITCH_LED_1
Definition daisy_petal.h:58
@ FOOTSWITCH_LED_2
Definition daisy_petal.h:59
@ FOOTSWITCH_LED_LAST
Definition daisy_petal.h:62
@ FOOTSWITCH_LED_3
Definition daisy_petal.h:60
void SetRingLed(RingLed idx, float r, float g, float b)
void ProcessAllControls()
Definition daisy_petal.h:135
size_t AudioBlockSize()
float AudioSampleRate()
This is the higher-level interface for the Daisy board. All basic peripheral configuration/initiali...
Definition daisy_seed.h:19
AdcHandle adc
Definition daisy_seed.h:145
Generic Class for handling Quadrature Encoders Inspired/influenced by Mutable Instruments (pichenet...
Definition encoder.h:18
Definition leddriver.h:33
LED Class providing simple Software PWM ability, etc Eventually this will work with hardware PWM,...
Definition led.h:22
Definition rgb_led.h:15
Definition switch.h:18
Hardware defines and helpers for daisy field platform.
Definition index.h:2
SampleRate
Definition sai.h:58