162#ifndef _SWADGE_MODE_H_
163#define _SWADGE_MODE_H_
174#include "crashwrap.h"
223#define EXIT_TIME_US 1000000
225#define DEFAULT_FRAME_RATE_US (1000000 / 40)
274 void (*fnEnterMode)(void);
279 void (*fnExitMode)(void);
287 void (*fnMainLoop)(int64_t elapsedUs);
296 void (*fnAudioCallback)(uint16_t* samples, uint32_t sampleCnt);
308 void (*fnBackgroundDrawCallback)(int16_t x, int16_t y, int16_t w, int16_t h, int16_t up, int16_t upNum);
318 void (*fnEspNowRecvCb)(
const esp_now_recv_info_t* esp_now_info,
const uint8_t* data, uint8_t len, int8_t rssi);
327 void (*fnEspNowSendCb)(
const uint8_t* mac_addr, esp_now_send_status_t status);
339 int16_t (*fnAdvancedUSB)(uint8_t* buffer, uint16_t length, uint8_t isGet);
void(* fnDacCallback_t)(uint8_t *samples, int16_t len)
A callback which requests DAC samples from the application.
Definition hdw-dac.h:94
wifiMode_t
The different WiFi modes.
Definition hdw-esp-now.h:99
A struct of all the function pointers necessary for a swadge mode. If a mode does not need a particul...
Definition swadge2024.h:233
wifiMode_t wifiMode
This is a setting, not a function pointer. Set it to NO_WIFI to save power by not using WiFi at all....
Definition swadge2024.h:244
const char * modeName
This swadge mode's name, used in menus. This is not a function pointer.
Definition swadge2024.h:237
fnDacCallback_t fnDacCb
This function is called to fill sample buffers for the DAC. If this is NULL, then globalMidiPlayerFil...
Definition swadge2024.h:345
bool overrideSelectBtn
If this is false, then PB_SELECT events will only be used to return to the main menu or open the quic...
Definition swadge2024.h:269
bool overrideUsb
If this is false, then the default TinyUSB driver will be installed (HID gamepad)....
Definition swadge2024.h:250
bool usesThermometer
If this is false, the thermometer will not be initialized and readTemperatureSensor() will not work....
Definition swadge2024.h:262
bool usesAccelerometer
If this is false, the accelerometer will not be initialized and accelGetAccelVec() will not work....
Definition swadge2024.h:256
void setFrameRateUs(uint32_t newFrameRateUs)
Set the framerate, in microseconds.
Definition swadge2024.c:792
void softSwitchToPendingSwadge(void)
Switch to the pending Swadge mode without restarting the system.
Definition swadge2024.c:699
bool checkButtonQueueWrapper(buttonEvt_t *evt)
Service the queue of button events that caused interrupts This only returns a single event,...
Definition swadge2024.c:740
void switchToMicrophone(void)
Enable the microphone and disable the speaker (and battery monitor)
Definition swadge2024.c:850
void deinitSystem(void)
Deinitialize all components in the system.
Definition swadge2024.c:596
void switchToSwadgeMode(swadgeMode_t *mode)
Definition swadge2024.c:688
uint32_t getFrameRateUs(void)
Get the current framerate, in microseconds.
Definition swadge2024.c:802
void switchToSpeaker(void)
Enable the speaker (and battery monitor) and disable the microphone.
Definition swadge2024.c:831
void openQuickSettings(void)
Definition swadge2024.c:779