-
-
Save attie/3241b0ca5f14177559411298283c3899 to your computer and use it in GitHub Desktop.
Glasgow I2S
This file contains 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
def build(self, target, args): | |
self.mux_interface = iface = target.multiplexer.claim_interface(self, args) | |
iface.add_subtarget(AudioI2SCaptureSubtarget( | |
pads=iface.get_pads(args, pins=self.__pins), | |
in_fifo=iface.get_in_fifo(), | |
clk_edge=args.clk_edge, | |
mode=args.mode, | |
frame_size=args.frame_size, | |
)) |
This file contains 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
frame_buf_len = 4 | |
buf = [] | |
if len(buf) < frame_buf_len: | |
await iface._in_tasks.wait_one() | |
if len(iface._in_buffer) > 0: | |
buf.extend(await iface.read()) | |
if len(buf) < frame_buf_len: | |
continue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment