IIS driver for SAM.
This file defines a useful set of functions for the IIS on SAM devices.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
Functions | |
static enum status_code | _iis_set_config (struct iis_dev_inst *const dev_inst) |
void | iis_clear_status (struct iis_dev_inst *dev_inst, iis_interrupt_source_t source) |
Clear the IIS status value. More... | |
void | iis_disable (struct iis_dev_inst *const dev_inst) |
Disable the IIS module. More... | |
void | iis_disable_interrupt (struct iis_dev_inst *const dev_inst, iis_interrupt_source_t source) |
Disable the specified interrput sources. More... | |
void | iis_enable (struct iis_dev_inst *const dev_inst) |
Enable the IIS module. More... | |
void | iis_enable_interrupt (struct iis_dev_inst *const dev_inst, iis_interrupt_source_t source) |
Enable the specified interrput sources. More... | |
enum status_code | iis_init (struct iis_dev_inst *const dev_inst, Iisc *iisc, struct iis_config *const cfg) |
Initialize and configure the IIS module. More... | |
static void | iis_interrupt_handler (void) |
Internal interrupt handler for IIS. More... | |
enum status_code | iis_read (struct iis_dev_inst *const dev_inst, uint32_t *data) |
Read a single message of data. More... | |
void | iis_set_callback (struct iis_dev_inst *const dev_inst, iis_interrupt_source_t source, iis_callback_t callback, uint8_t irq_level) |
Set callback for IIS. More... | |
enum status_code | iis_write (struct iis_dev_inst *const dev_inst, uint32_t data) |
Write a single message of data. More... | |
void | IISC_Handler (void) |
Interrupt handler for IIS. More... | |
Variables | |
struct iis_dev_inst * | _iis_instance |
iis_callback_t | iis_callback_pointer [_IIS_INTERRUPT_SOURCE_NUM] |
IIS callback function pointer array. More... | |
|
static |
Set configurations to module.
dev_inst | Pointer to device instance structure. |
References Assert, iis_dev_inst::cfg, iis_config::data_format, iis_config::fs_ratio, iis_dev_inst::hw_dev, IIS_CHANNEL_MONO, IIS_DATE_16BIT, IIS_DATE_32BIT, IIS_ONE_DMA_CHANNEL_FOR_ONE_CHANNEL, IIS_SLOT_LENGTH_24BIT, iis_config::loopback, iis_config::master, iis_config::rx_channels, iis_config::rx_dma, iis_config::slot_length, STATUS_OK, iis_config::tx_channels, and iis_config::tx_dma.
Referenced by iis_init().
|
static |
Internal interrupt handler for IIS.
References iis_callback_pointer, iis_get_interrupt_mask(), iis_get_status(), IIS_INTERRUPT_RXOR, IIS_INTERRUPT_RXRDY, IIS_INTERRUPT_TXRDY, IIS_INTERRUPT_TXUR, and status.
Referenced by IISC_Handler().
void IISC_Handler | ( | void | ) |
Interrupt handler for IIS.
References iis_interrupt_handler().
struct iis_dev_inst* _iis_instance |
iis_callback_t iis_callback_pointer[_IIS_INTERRUPT_SOURCE_NUM] |
IIS callback function pointer array.
Referenced by iis_interrupt_handler(), and iis_set_callback().