Skip to content

Class daisy::desktop_devkit::Hardware

ClassList > daisy > desktop_devkit > Hardware

Public Types

Type Name
typedef ShiftRegister4021< 2, 1 > ButtonSr
typedef LedDriverPca9685< 1, true > LedDriver

Public Attributes

Type Name
DigitalControl button
ButtonSr button_sr
AnalogControl cv
GateIn gate_in
LedDriver led_driver
Switch left_detect
MidiUartHandler midi
AnalogControl pot
Switch right_detect
Switch sd_detect
DaisySeed seed
TimerHandle tim5_handle
Switch tog_sw17
Switch3 tog_sw18

Public Functions

Type Name
void ClearLeds ()
Hardware ()
void Init ()
void SetDacOut (DacHandle::Channel channel, uint16_t code)
void SetLed (int idx, float brightness)
void StartLowPriorityCallback (TimerHandle::PeriodElapsedCallback cb, uint32_t target_freq, void * data=nullptr)
void StopLowPriorityCallback ()
void UpdateAllControls ()
void UpdateLeds ()

Public Types Documentation

typedef ButtonSr

using daisy::desktop_devkit::Hardware::ButtonSr =  ShiftRegister4021<2, 1>;

typedef LedDriver

using daisy::desktop_devkit::Hardware::LedDriver =  LedDriverPca9685<1, true>;

Public Attributes Documentation

variable button

DigitalControl daisy::desktop_devkit::Hardware::button[kNumButtons];

variable button_sr

ButtonSr daisy::desktop_devkit::Hardware::button_sr;

variable cv

AnalogControl daisy::desktop_devkit::Hardware::cv[kNumCVs];

variable gate_in

GateIn daisy::desktop_devkit::Hardware::gate_in[kNumGateIns];

variable led_driver

LedDriver daisy::desktop_devkit::Hardware::led_driver;

variable left_detect

Switch daisy::desktop_devkit::Hardware::left_detect;

variable midi

MidiUartHandler daisy::desktop_devkit::Hardware::midi;

variable pot

AnalogControl daisy::desktop_devkit::Hardware::pot[kNumPots];

variable right_detect

Switch daisy::desktop_devkit::Hardware::right_detect;

variable sd_detect

Switch daisy::desktop_devkit::Hardware::sd_detect;

variable seed

DaisySeed daisy::desktop_devkit::Hardware::seed;

variable tim5_handle

TimerHandle daisy::desktop_devkit::Hardware::tim5_handle;

variable tog_sw17

Switch daisy::desktop_devkit::Hardware::tog_sw17;

variable tog_sw18

Switch3 daisy::desktop_devkit::Hardware::tog_sw18;

Public Functions Documentation

function ClearLeds

void daisy::desktop_devkit::Hardware::ClearLeds () 

Reset all LEDs to their off state


function Hardware

inline daisy::desktop_devkit::Hardware::Hardware () 

function Init

void daisy::desktop_devkit::Hardware::Init () 

Initialize the hardware


function SetDacOut

void daisy::desktop_devkit::Hardware::SetDacOut (
    DacHandle::Channel channel,
    uint16_t code
) 

Write the code to the DAC output

Parameters:

  • channel DAC channel to write to
  • code the 0-4096 code to write corresponding to the output voltage

function SetLed

void daisy::desktop_devkit::Hardware::SetLed (
    int idx,
    float brightness
) 

Set the brightness for a specific LED

Parameters:

  • idx index of the LED from 0-15 corresponding to D1 to D16
  • brightness brightness level from 0-1

function StartLowPriorityCallback

void daisy::desktop_devkit::Hardware::StartLowPriorityCallback (
    TimerHandle::PeriodElapsedCallback cb,
    uint32_t target_freq,
    void * data=nullptr
) 

This starts a recurring callback at a specified interval. The callback is run on the lowest priority interrupt level. This provides a hook for non-background tasks that should interrupt low level activity like disk i/o, etc.

Parameters:

  • cb callback function to take place at the specified frequency
  • target_freq target frequency in hertz for the callback to run
  • data optional pointer to context data accessible from the callback

function StopLowPriorityCallback

void daisy::desktop_devkit::Hardware::StopLowPriorityCallback () 

Stops an ongoing low-priority callback


function UpdateAllControls

void daisy::desktop_devkit::Hardware::UpdateAllControls () 

Process all analog inputs, debounce digital inputs, and update their internally stored states.


function UpdateLeds

void daisy::desktop_devkit::Hardware::UpdateLeds () 

Flush the current LED values to the hardware. Changes to the LED brightnesses will only take effect when this method is called.



The documentation for this class was generated from the following file external-docs/libDaisy/src/desktop_devkit.h