bcm2835_rd_fifo_count(9)
π bcm2835_rd_fifo_count
ok so bestie, welcome to the Kernel API Manual β section 9, kernel-space girlies only, no cap. today's main character is bcm2835_rd_fifo_count, and she's giving "just grab the bytes and don't ask questions" energy. π
β¨ NAME β¨
bcm2835_rd_fifo_count β blindly read exactly @count bytes from RX FIFO π¦
like⦠blindly. she does not check. she does not verify. she trusts you. that's the vibe.
πΈ SYNOPSIS πΈ
void bcm2835_rd_fifo_count (struct bcm2835_spi *bs , int count );
that's it. that's the whole function. two args, no return, no drama (well, the drama is on YOU, the caller β more on that in a sec π).
π«Ά ARGUMENTS π«Ά
bsβ the BCM2835 SPI controller, aka the whole reason we're here πcountβ how many bytes to read from the RX FIFO, like literally the number of bytes, exactly that many, no more no less β¨
π DESCRIPTION π
ok so before you even think about calling this, there is a whole checklist and the caller (that's you, bestie) is responsible for every single item on it. no cap. this function is not doing the vibes check for you:
- you MUST ensure that
bs->rx_lenis greater than or equal tocountβ like, greater than or equal, not "close enough" π - you MUST ensure the RX FIFO actually contains at least
countbytes. yes, at least. if it doesn't, that's a you problem π - you MUST ensure that the DMA Enable flag in the CS register is set, so that a read from the FIFO register receives 32-bit instead of just 8-bit π (this one matters, it's the whole difference between the fancy wide read and the sad little 8-bit one)
- and, not to be that girl, but
bs->rx_bufmust not beNULL. like at all. ever. π₯
so yeah, "blindly" in the NAME is doing a LOT of heavy lifting here. she reads exactly count bytes and trusts that the universe (you) set everything up perfectly. the setup is the whole assignment. π
π SEE ALSO π
- Kernel file
./drivers/spi/spi-bcm2835.cπ struct bcm2835_spi(9)struct bcm2835_spidev(9)bcm2835_wr_fifo_count(9)bcm2835_wait_tx_fifo_empty(9)bcm2835_rd_fifo_blind(9)bcm2835_wr_fifo_blind(9)bcm2835_spi_transfer_prologue(9)bcm2835_spi_undo_prologue(9)bcm2835_spi_dma_rx_done(9)bcm2835_spi_dma_tx_done(9)bcm2835_spi_prepare_sg(9)bcm2835_spi_transfer_one_dma(9)
the whole friend group fr fr, go say hi π§π
and that's the page, bestie!! π this lil gem lives over in ./drivers/spi, dated October 2026, and it's page bcm2835_rd_fifo_count(9) of the Kernel API Manual. mwah, go read your FIFO responsibly πβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms