smi(3)
π smi(3) β SMI bus support π
okay bestie, gather round, because we're talking about the smi page from the Library Functions Manual and it's literally all about letting you touch the SMI bus π¦ no cap.
β¨ NAME β¨
smi β SMI bus support
πΈ SYNOPSIS πΈ
Functions
int bcm2835_smi_begin (void)
void bcm2835_smi_end (void)
void bcm2835_smi_set_timing (uint32_t smichannel, uint32_t readchannel,
uint32_t setupcycles, uint32_t strobecycles, uint32_t holdcycles,
uint32_t pacecycles)
void bcm2835_smi_write (uint32_t smichannel, uint8_t data, uint32_t
address)
uint32_t bcm2835_smi_read (uint32_t smichannel, uint32_t address)
π Detailed Description π
Allows access to SMI bus. that's it, that's the whole vibe. short. iconic. π
π Function Documentation π
π«Ά int bcm2835_smi_begin (void) [extern]
Start SMI operations. this one forces the RPi SMI pins P1-19 (MOSI), P1-21 (MISO), P1-23 (CLK), P1-24 (CE0) and P1-26 (CE1) into alternate function ALT1, which is what enables those pins for the SMI interface. slay. β¨
bestie you should call bcm2835_smi_end() when all your SMI functions are complete, so the pins go back to their default functions. don't leave them hanging fr fr π
also, heads up: only address bits SA0 to SA3 are available as RPi uses GPIO0 (SA5) and GPIO1 (SA4) for I2C HAT identification EEPROM access. iykyk.
See also
bcm2835_smi_end()
Returns
1if successful,0otherwise (perhaps because you are not running as root) π
π void bcm2835_smi_end (void) [extern]
End SMI operations. the SMI pins P1-19 (MOSI), P1-21 (MISO), P1-23 (CLK), P1-24 (CE0) and P1-26 (CE1) are returned to their default INPUT behaviour. clean exit, main character energy π
β uint32_t bcm2835_smi_read (uint32_t smichannel, uint32_t address) [extern]
Reads one byte from SMI bus. uses polled transfer as described in BCM 2835 ARM Peripherals manual π
Parameters
smichannelβ SMI configuration slot to use (0to3)addressβ The address to read from
Returns
- value read from SMI bus π
See also
bcm2835_smi_readnb()
π§ void bcm2835_smi_set_timing (uint32_t smichannel, uint32_t readchannel, uint32_t setupcycles, uint32_t strobecycles, uint32_t holdcycles, uint32_t pacecycles) [extern]
Setup SMI bus cycle timing parameters. okay so there are four SMI channels for read operation and four channels for write operation. cycles are expressed as multiple of 8ns β±οΈ
not me having to say this: Pace cycles are not used (no effect on hardware) but they are required for configuration. it is recommended to set this value to1(and not0) to have the smallest cycle in case the hardware would recognize it. so likeβ¦ set it, bestie π
Parameters
smichannelβ SMI configuration slot to setup (0to3)readchannelβ Set to1to configure the read channel (0= configure write channel)setupcyclesβ Time between address assertion on bus and OE/WR signal assertionstrobecyclesβ Duration of OE/WR signal assertionholdcyclesβ Time after OE/WR deassertion before address is deassertedpacecyclesβ Time before next SMI bus cycle
π void bcm2835_smi_write (uint32_t smichannel, uint8_t data, uint32_t address) [extern]
Transfers one byte to SMI bus. uses polled transfer as described in BCM 2835 ARM Peripherals manual π₯
Parameters
timingslotβ SMI configuration slot to use (0to3)dataβ The data byte to writeaddressβ The address to write to
See also
bcm2835_smi_writenb()
π Author π
Generated automatically by Doxygen for bcm2835 from the source code. it wrote itself, honestly, we're just here for the vibes π
and that's the whole page, bestie!! this beauty lives in bcm2835, Version 1.75 β so if you ever need to cite it, that's the version and that's the source, mwah π periodt β¨
π¦ where this page comes from
- debian trixie: libbcm2835-dev 1.75+ds-1 Β· GPL-3.0-only
- ubuntu noble: libbcm2835-dev 1.75+ds-1 Β· GPL-3.0-only
- ubuntu questing: libbcm2835-dev 1.75+ds-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms