|
SatCat5
|
ConfigBus-controlled piezoelectric buzzer.
This class controls the HDL block defined in "cfgbus_piezo.vhd". It plays back a queue of musical notes, where each note is defined by a paired duration and frequency.
Definition at line 24 of file cfgbus_piezo.h.
#include <cfgbus_piezo.h>
Public Member Functions | |
| Piezo (satcat5::cfg::ConfigBus *cfg, unsigned devaddr, unsigned regaddr=0) | |
| Link this object to the "cfgbus_piezo" control register. | |
| void | flush () |
| Silence playback and flush internal queue. | |
| satcat5::io::Writeable * | queue () |
| Access the internal playback buffer for writing commands. More... | |
| virtual void | data_unlink (satcat5::io::Readable *src) |
| Unlink this EventListener from the designated source, because the designated Readable object is being destroyed. More... | |
| void | timer_once (unsigned msec) |
| Configure a one-time notification after X milliseconds. | |
| void | timer_every (unsigned msec) |
| Configure a repeating notification every X milliseconds. | |
| void | timer_stop () |
| Stop all future notifications. | |
| unsigned | timer_interval () const |
| Accessor for recurring timer interval, if one is set. | |
| unsigned | timer_remaining () const |
| Accessor for time to next event, if one is set. | |
Static Public Member Functions | |
| static unsigned | count_timer () |
| Count all objects of this type, including idle timers. | |
Protected Member Functions | |
| void | data_rcvd (satcat5::io::Readable *src) override |
| The data_rcvd() callback is polled whenever data is available. More... | |
| void | timer_event () override |
| Child class MUST override this method. | |
| void | wait () |
Protected Attributes | |
| satcat5::cfg::Register | m_reg |
| Base control register. | |
| satcat5::io::PacketBuffer | m_queue |
| Playback queue. | |
| u8 | m_raw [SATCAT5_PIEZO_BUFFER] |
| Raw working buffer. | |
Private Member Functions | |
| void | query (unsigned elapsed_msec) |
Private Attributes | |
| satcat5::poll::Timer * | m_next |
| unsigned | m_trem |
| unsigned | m_tnext |
|
overrideprotectedvirtual |
The data_rcvd() callback is polled whenever data is available.
A pointer is provided to assist handlers with multiple sources. Child objects of io::EventListener MUST override this method.
Implements satcat5::io::EventListener.
Definition at line 26 of file cfgbus_piezo.cc.
|
inlinevirtualinherited |
Unlink this EventListener from the designated source, because the designated Readable object is being destroyed.
Child objects of io::EventListener MAY override this method if action is required.
Reimplemented in satcat5::io::Override, satcat5::io::MuxUp, satcat5::io::MuxDown, satcat5::io::BufferedPackets, satcat5::io::BufferedStream, satcat5::io::BufferedCopy, satcat5::eth::SwitchLogReader, satcat5::eth::Dispatch, satcat5::ccsds_spp::Dispatch, satcat5::ccsds_aos::Dispatch, satcat5::ccsds_aos::Channel, satcat5::test::MockOffload::Port, and satcat5::freertos::MessageCopy.
Definition at line 54 of file io_readable.h.
|
inline |
Access the internal playback buffer for writing commands.
Each single-note command is a duration (u16, milliseconds) followed by a frequency (u32, see "cfgbus_piezo.vhd").
Definition at line 39 of file cfgbus_piezo.h.