bcm2835 1.75
|
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) |
Allows access to SMI bus
int bcm2835_smi_begin | ( | void | ) |
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
void bcm2835_smi_end | ( | void | ) |
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 | ||
) |
Reads one byte from SMI bus. Uses polled transfer as described in BCM 2835 ARM Peripherals manual
[in] | smichannel | SMI configuration slot to use (0 to 3) |
[in] | address | The address to read from |
void bcm2835_smi_set_timing | ( | uint32_t | smichannel, |
uint32_t | readchannel, | ||
uint32_t | setupcycles, | ||
uint32_t | strobecycles, | ||
uint32_t | holdcycles, | ||
uint32_t | pacecycles | ||
) |
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
[in] | smichannel | SMI configuration slot to setup (0 to 3) |
[in] | readchannel | Set to 1 to configure the read channel (0 = configure write channel) |
[in] | setupcycles | Time between address assertion on bus and OE/WR signal assertion |
[in] | strobecycles | Duration of OE/WR signal assertion |
[in] | holdcycles | Time after OE/WR deassertion before address is deasserted |
[in] | pacecycles | Time before next SMI bus cycle |
void bcm2835_smi_write | ( | uint32_t | smichannel, |
uint8_t | data, | ||
uint32_t | address | ||
) |
Transfers one byte to SMI bus. Uses polled transfer as described in BCM 2835 ARM Peripherals manual
[in] | timingslot | SMI configuration slot to use (0 to 3) |
[in] | data | The data byte to write |
[in] | address | The address to write to |