SAM I2S - Inter-IC Sound Controller.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
Data Structures | |
struct | i2s_clock_config |
Configure for I2S clock (SCK). More... | |
struct | i2s_clock_unit_config |
Configure for I2S clock unit. More... | |
struct | i2s_frame_config |
Configure for I2S frame. More... | |
struct | i2s_frame_sync_config |
Configure for I2S frame sync (FS). More... | |
struct | i2s_module |
I2S Software Module instance struct. More... | |
struct | i2s_pin_config |
Configure for I2S pin. More... | |
struct | i2s_serializer_config |
Configure for I2S Serializer. More... | |
struct | i2s_serializer_module |
I2S Serializer instance struct. More... | |
Macros | |
Module Status Flags | |
I2S status flags, returned by i2s_get_status() and cleared by i2s_clear_status(). | |
#define | I2S_STATUS_TRANSMIT_UNDERRUN(x) (1u << ((x)+0)) |
Module Serializer x (0~1) Transmit Underrun. More... | |
#define | I2S_STATUS_TRANSMIT_READY(x) (1u << ((x)+2)) |
Module Serializer x (0~1) is ready to accept new data to be transmitted. More... | |
#define | I2S_STATUS_RECEIVE_OVERRUN(x) (1u << ((x)+4)) |
Module Serializer x (0~1) Receive Overrun. More... | |
#define | I2S_STATUS_RECEIVE_READY(x) (1u << ((x)+6)) |
Module Serializer x (0~1) has received a new data. More... | |
#define | I2S_STATUS_SYNC_BUSY (1u << 8) |
Module is busy on synchronization. More... | |
Typedefs | |
typedef void(* | i2s_serializer_callback_t )(struct i2s_module *const module) |
Type of the callback functions. More... | |
Functions | |
static bool | i2s_is_syncing (const struct i2s_module *const module_inst) |
Determines if the hardware module(s) are currently synchronizing to the bus. More... | |
Driver Initialization | |
enum status_code | i2s_init (struct i2s_module *const module_inst, I2s *hw) |
Initializes a hardware I2S module instance. More... | |
Enable/Disable/Reset | |
static void | i2s_enable (const struct i2s_module *const module_inst) |
Enable the I2S module. More... | |
static void | i2s_disable (const struct i2s_module *const module_inst) |
Disables the I2S module. More... | |
static void | i2s_reset (const struct i2s_module *const module_inst) |
Resets the I2S module. More... | |
Clock Unit Initialization and Configuration | |
static void | i2s_clock_unit_get_config_defaults (struct i2s_clock_unit_config *const config) |
Initializes config with predefined default values for I2S clock unit. More... | |
enum status_code | i2s_clock_unit_set_config (struct i2s_module *const module_inst, const enum i2s_clock_unit clock_unit, const struct i2s_clock_unit_config *config) |
Configure specified I2S clock unit. More... | |
Clock Unit Enable/Disable | |
static void | i2s_clock_unit_enable (const struct i2s_module *const module_inst, const enum i2s_clock_unit clock_unit) |
Enable the Specified Clock Unit of I2S module. More... | |
static void | i2s_clock_unit_disable (const struct i2s_module *const module_inst, const enum i2s_clock_unit clock_unit) |
Disable the Specified Clock Unit of I2S module. More... | |
Serializer Initialization and Configuration | |
static void | i2s_serializer_get_config_defaults (struct i2s_serializer_config *const config) |
Initializes config with predefined default values for I2S Serializer. More... | |
enum status_code | i2s_serializer_set_config (struct i2s_module *const module_inst, const enum i2s_serializer serializer, const struct i2s_serializer_config *config) |
Configure specified I2S serializer. More... | |
Serializer Enable/Disable | |
static void | i2s_serializer_enable (const struct i2s_module *const module_inst, const enum i2s_serializer serializer) |
Enable the Specified Serializer of I2S module. More... | |
static void | i2s_serializer_disable (const struct i2s_module *const module_inst, const enum i2s_serializer serializer) |
Disable the Specified Serializer of I2S module. More... | |
Status Management | |
uint32_t | i2s_get_status (const struct i2s_module *const module_inst) |
Retrieves the current module status. More... | |
void | i2s_clear_status (const struct i2s_module *const module_inst, uint32_t status) |
Clears a module status flags. More... | |
enum status_code | i2s_enable_status_interrupt (struct i2s_module *const module_inst, uint32_t status) |
Enable interrupts on status set. More... | |
void | i2s_disable_status_interrupt (struct i2s_module *const module_inst, uint32_t status) |
Disable interrupts on status set. More... | |
Data Read/Write | |
static void | i2s_serializer_write_wait (const struct i2s_module *const module_inst, enum i2s_serializer serializer, uint32_t data) |
Write a data word to the specified Serializer of I2S module. More... | |
static uint32_t | i2s_serializer_read_wait (const struct i2s_module *const module_inst, enum i2s_serializer serializer) |
Read a data word from the specified Serializer of I2S module. More... | |
enum status_code | i2s_serializer_write_buffer_wait (const struct i2s_module *const module_inst, enum i2s_serializer serializer, void *buffer, uint32_t size) |
Write buffer to the specified Serializer of I2S module. More... | |
enum status_code | i2s_serializer_read_buffer_wait (const struct i2s_module *const module_inst, enum i2s_serializer serializer, void *buffer, uint32_t size) |
Read from the specified Serializer of I2S module to a buffer. More... | |