mirror of
https://github.com/halleysfifthinc/AVCLAN-Mockingboard.git
synced 2026-08-07 01:13:18 +00:00
Decouple hardware specific code from generic, agnostic code
This commit is contained in:
+12
-14
@@ -16,27 +16,25 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Media-control actuator: emulates play/pause and skip button presses on the
|
||||
// audio source by toggling MIC_CONTROL (PB1/WO1) with TCA0 in FRQ mode.
|
||||
// Media-control: route/handle head-unit button presses to the audio source.
|
||||
|
||||
#ifndef MEDIACONTROL_H
|
||||
#define MEDIACONTROL_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
// One-time hardware bring-up for the mic/button-press driver (TCA0 + PB1).
|
||||
// Actions list
|
||||
typedef enum : uint8_t {
|
||||
MEDIA_PLAY_PAUSE = 0,
|
||||
MEDIA_SKIP_FORWARD,
|
||||
MEDIA_SKIP_BACKWARD,
|
||||
} AVCLAN_media_fn_t;
|
||||
|
||||
// One-time hardware bring-up for the media driver.
|
||||
void mediacontrol_init();
|
||||
|
||||
// Emulate a single play/pause button press on the source device.
|
||||
void AVCLAN_micPlayPause();
|
||||
// Emulate skip-forward/backward button presses
|
||||
void AVCLAN_micSkipForward();
|
||||
void AVCLAN_micSkipBackward();
|
||||
|
||||
// Keep the press waveform roughly in sync while a bus transaction has masked
|
||||
// interrupts. MUST be called with interrupts disabled (e.g. from within the
|
||||
// frame layer's AVCLAN_stopEvent ATOMIC_BLOCK).
|
||||
void mediacontrol_syncDuringMask();
|
||||
// Emulate a button press on the source device.
|
||||
void AVCLAN_mediaFunction(AVCLAN_media_fn_t fn);
|
||||
|
||||
#ifndef NDEBUG
|
||||
bool AVCLAN_micToggle();
|
||||
|
||||
Reference in New Issue
Block a user