bcm2835_rd_fifo_count(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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_len is greater than or equal to count β€” like, greater than or equal, not "close enough" πŸ™ˆ
  • you MUST ensure the RX FIFO actually contains at least count bytes. 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_buf must not be NULL. 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 🌈

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