You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
900 B
44 lines
900 B
#ifndef __IIS_H___
|
|
#define __IIS_H___
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
#include <stdint.h>
|
|
#include "config.h"
|
|
|
|
typedef struct iis_descr *iis_t;
|
|
|
|
#define IIS_STD_PHILIP ((uint16_t)0x0000)
|
|
#define IIS_STD_MSB ((uint16_t)0x0010)
|
|
#define IIS_STD_LSB ((uint16_t)0x0020)
|
|
#define IIS_STD_PCM16 ((uint16_t)0x0030)
|
|
#define IIS_STD_PCM24 ((uint16_t)0x00B0)
|
|
|
|
int iis_setup(iis_t tag, uint16_t standard, uint32_t freq);
|
|
|
|
void iis_start_tx(iis_t tag);
|
|
|
|
void iis_stop_tx(iis_t tag);
|
|
|
|
size_t iis_send(iis_t tag, const void* ptr, size_t num_bytes);
|
|
|
|
size_t iis_send_blocking(iis_t tag, const void* _data, size_t num_bytes);
|
|
|
|
void iis_set_tx_completion(iis_t tag, void (*callback)(iis_t, void *), void *user);
|
|
|
|
#if (TARGET_HAS_I2S0)
|
|
|
|
#ifndef TARGET_I2S0_TX_BUFFER_SIZE
|
|
#define TARGET_I2S0_TX_BUFFER_SIZE 256
|
|
#endif
|
|
|
|
extern struct iis_descr i2s0;
|
|
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
|