obj
I2S.swift:27This declaration is gated by at least one @_spi attribute.
let obj: UnsafeMutableRawPointer
This declaration is gated by at least one @_spi attribute.
let obj: UnsafeMutableRawPointer
import SwiftIO
The SwiftIO library allows you to access and control the hardware in an easy way.
final class I2S
I2S (inter-integrated circuit sound) is a serial communication protocol that is designed specifically for digital audio data.
@frozen struct UnsafeMutableRawPointer
A raw pointer for accessing and manipulating untyped data.
init(_ idName: Id, rate: Int = 16_000, bits: Int = 16, mode: Mode = .philips, timeout: Int = Int(SWIFT_FOREVER))
Initializes an I2S interface with the specified sample rate and sample bits.
let supportedSampleBits: Set
The sample bits for the I2S data transmission, which refers to the number of bits used to represent each sample.
let supportedSampleRate: Set
The sample rate for the audio data, which defines how many times the signal is sampled in one second.
@discardableResult func setSampleProperty(rate: Int, bits: Int) -> Result<(), Errno>
Set audio sample rate and bit.
@discardableResult func write(_ data: [UInt8], count: Int? = nil) -> Result<Int, Errno>
Write an array of data to audio device.
@discardableResult func write<Element>(_ data: [Element], count: Int? = nil) -> Result<Int, Errno> where Element : BinaryInteger
Write an array of binary integers to audio device.
struct ConfigOptions
struct DataFormat
enum Direction
enum Mode
The Mode enum inludes the ways that determine when the data is transmitted.
enum State
enum Trigger