Created
August 20, 2016 14:35
-
-
Save eggman/e347936b24eb2776df28e9cc5e493370 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# i2s_api.c for AMEBA (RTL8710 and etc) | |
void i2s_init(i2s_t *obj, PinName sck, PinName ws, PinName sd) | |
{ | |
RtkI2SLoadDefault(); | |
HalI2SInit(); | |
} | |
void i2s_set_dma_buffer(i2s_t *obj, char *tx_buf, char *rx_buf, | |
uint32_t page_num, uint32_t page_size) | |
{ | |
HalI2SSetDMABufRtl8195a(); | |
} | |
void i2s_tx_irq_handler(i2s_t *obj, i2s_irq_handler handler, uint32_t id); | |
void i2s_rx_irq_handler(i2s_t *obj, i2s_irq_handler handler, uint32_t id); | |
void i2s_set_direction(i2s_t *obj, int trx_type) | |
{ | |
HalI2SSetDirectionRtl8195a(); | |
} | |
void i2s_set_param(i2s_t *obj, int channel_num, int rate, int word_len) | |
{ | |
HalI2SSetChNumRtl8195a(); | |
HalI2SSetRateRtl8195a(); | |
HalI2SSetWordLenRtl8195a(); | |
} | |
void i2s_deinit(i2s_t *obj) | |
{ | |
HalI2SDeInit(); | |
} | |
int* i2s_get_tx_page(i2s_t *obj) | |
{ | |
HalI2SGetTxPageRtl8195a(); | |
} | |
void i2s_send_page(i2s_t *obj, uint32_t *pbuf) | |
{ | |
HalI2SPageSendRtl8195a(); | |
} | |
void i2s_recv_page(i2s_t *obj); | |
{ | |
HalI2SPageRecvRtl8195a(); | |
} | |
void i2s_enable(i2s_t *obj) | |
{ | |
HalI2SEnable(); | |
} | |
void i2s_disable(i2s_t *obj) | |
{ | |
HalI2SDisable(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment