smi(3)

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

Function Documentation

  int bcm2835_smi_begin (void ) [extern]
Start SMI operations. Forces RPi SMI pins P1-19 (MOSI), P1-21 (MISO), P1-23 (CLK), P1-24 (CE0) and P1-26 (CE1) to alternate function ALT1, which enables those pins for SMI interface. You should call bcm2835_smi_end() when all SMI functions are complete to return the pins to their default functions. Only address bits SA0 to SA3 are available as RPi uses GPIO0 (SA5) and GPIO1 (SA4) for I2C HAT identification EEPROM access

See also
    bcm2835_smi_end()

Returns
    1 if successful, 0 otherwise (perhaps because you are not running as root)

  void bcm2835_smi_end (void ) [extern]
End SMI operations. 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.

  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 (0 to 3)
    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 There are four SMI channels for read operation and four channels for write operation Cycles are expressed as multiple of 8ns Note that Pace cycles are not used (no effect on hardware) but they are required for configuration. It is recommended to set this value to 1 (and not 0) to have the smallest cycle in case the hardware would recognize it

Parameters
    smichannel SMI configuration slot to setup (0 to 3)
    readchannel Set to 1 to configure the read channel (0 = configure write channel)
    setupcycles Time between address assertion on bus and OE/WR signal assertion
    strobecycles Duration of OE/WR signal assertion
    holdcycles Time after OE/WR deassertion before address is deasserted
    pacecycles 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 (0 to 3)
    data The data byte to write
    address The address to write to

See also
    bcm2835_smi_writenb()

Author

Generated automatically by Doxygen for bcm2835 from the source code.