|
iPXE
|
Bit-bashing interfaces. More...
Go to the source code of this file.
Data Structures | |
| struct | bit_basher_operations |
| Bit-bashing operations. More... | |
| struct | bit_basher |
| A bit-bashing interface. More... | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| static void | open_bit (struct bit_basher *basher) |
| Open bit-bashing interface. More... | |
| static void | close_bit (struct bit_basher *basher) |
| Close bit-bashing interface. More... | |
| void | write_bit (struct bit_basher *basher, unsigned int bit_id, unsigned long data) |
| Set/clear output bit. More... | |
| int | read_bit (struct bit_basher *basher, unsigned int bit_id) |
| Read input bit. More... | |
Bit-bashing interfaces.
Definition in file bitbash.h.
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
inlinestatic |
Open bit-bashing interface.
| basher | Bit-bashing interface |
Definition at line 65 of file bitbash.h.
References bit_basher::op, and bit_basher_operations::open.
Referenced by i2c_bit_read(), i2c_bit_write(), i2c_reset(), and spi_bit_rw().
|
inlinestatic |
Close bit-bashing interface.
| basher | Bit-bashing interface |
Definition at line 75 of file bitbash.h.
References bit_basher_operations::close, and bit_basher::op.
Referenced by i2c_bit_read(), i2c_bit_write(), i2c_reset(), and spi_bit_rw().
| void write_bit | ( | struct bit_basher * | basher, |
| unsigned int | bit_id, | ||
| unsigned long | data | ||
| ) |
Set/clear output bit.
| basher | Bit-bashing interface |
| bit_id | Bit number |
| data | Value to write |
If data is 0, a logic 0 will be written. If data is non-zero, a logic 1 will be written.
Definition at line 44 of file bitbash.c.
References data, bit_basher::op, and bit_basher_operations::write.
Referenced by mii_bit_rw(), mii_bit_xfer(), setscl(), setsda(), spi_bit_rw(), spi_bit_set_slave_select(), and spi_bit_transfer().
| int read_bit | ( | struct bit_basher * | basher, |
| unsigned int | bit_id | ||
| ) |
Read input bit.
| basher | Bit-bashing interface |
| bit_id | Bit number |
| data | Value read |
data will always be either 0 or -1UL. The idea is that the caller can simply binary-AND the returned value with whatever mask it needs to apply.
Definition at line 60 of file bitbash.c.
References bit_basher::op, and bit_basher_operations::read.
Referenced by getsda(), mii_bit_xfer(), and spi_bit_transfer().
1.8.15