23#ifndef __DC_MAPLE_SIP_H
24#define __DC_MAPLE_SIP_H
67typedef struct sip_state {
89#define SIP_SUBCOMMAND_GET_SAMPLES 0x01
96#define SIP_SUBCOMMAND_BASIC_CTRL 0x02
99#define SIP_MIN_GAIN 0x00
102#define SIP_DEFAULT_GAIN 0x0F
105#define SIP_MAX_GAIN 0x1F
129#define SIP_SAMPLE_16BIT_SIGNED 0x00
132#define SIP_SAMPLE_8BIT_ULAW 0x01
153#define SIP_SAMPLE_11KHZ 0x00
156#define SIP_SAMPLE_8KHZ 0x01
209void sip_shutdown(
void);
Various common macros used throughout the codebase.
int sip_set_frequency(maple_device_t *dev, unsigned int freq)
Set the sample frequency to be recorded by the microphone.
int sip_start_sampling(maple_device_t *dev, sip_sample_cb cb, bool block)
Start sampling on a microphone.
int sip_stop_sampling(maple_device_t *dev, bool block)
Stop sampling on a microphone.
void(* sip_sample_cb)(maple_device_t *dev, uint8_t *samples, size_t len)
Type for a microphone sample callback.
Definition sip.h:55
int sip_set_gain(maple_device_t *dev, unsigned int g)
Set the microphone's gain value.
int sip_set_sample_type(maple_device_t *dev, unsigned int type)
Set the sample type to be recorded by the microphone.
Maple Bus driver interface.
static uint8_t block[4096]
Definition mke2fs.c:45
One maple device.
Definition maple.h:273
SIP status structure.
Definition sip.h:67
sip_sample_cb callback
Sampling callback.
Definition sip.h:81
int sample_type
The type of samples that are being recorded.
Definition sip.h:72
bool is_sampling
Is the mic currently sampling?
Definition sip.h:78
int frequency
What frequency are we sampling at?
Definition sip.h:75
int amp_gain
The gain value for the microphone amp.
Definition sip.h:69