iPXE
Main Page
Related Pages
Modules
+
Data Structures
Data Structures
Data Structure Index
+
Data Fields
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
b
d
i
p
s
t
u
v
x
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
+
Files
File List
+
Globals
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
Enumerations
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
include
ipxe
spi_bit.h
Go to the documentation of this file.
1
#ifndef _IPXE_SPI_BIT_H
2
#define _IPXE_SPI_BIT_H
3
4
/** @file
5
*
6
* SPI bit-bashing interface
7
*
8
*/
9
10
FILE_LICENCE
( GPL2_OR_LATER_OR_UBDL );
11
12
#include <
ipxe/spi.h
>
13
#include <
ipxe/bitbash.h
>
14
15
/** A bit-bashing SPI bus */
16
struct
spi_bit_basher
{
17
/** SPI bus */
18
struct
spi_bus
bus
;
19
/** Bit-bashing interface */
20
struct
bit_basher
basher
;
21
/** Endianness of data
22
*
23
* SPI commands and addresses are always big-endian (i.e. MSB
24
* transmitted first on the wire), but some cards
25
* (e.g. natsemi) choose to regard the data stored in the
26
* EEPROM as little-endian (i.e. LSB transmitted first on the
27
* wire).
28
*/
29
int
endianness
;
30
};
31
32
/** Bit indices used for SPI bit-bashing interface */
33
enum
{
34
/** Serial clock */
35
SPI_BIT_SCLK
= 0,
36
/** Master Out Slave In */
37
SPI_BIT_MOSI
,
38
/** Master In Slave Out */
39
SPI_BIT_MISO
,
40
/** Slave 0 select */
41
SPI_BIT_SS0
,
42
};
43
44
/**
45
* Determine bit index for a particular slave
46
*
47
* @v slave Slave number
48
* @ret index Bit index (i.e. SPI_BIT_SSN, where N=slave)
49
*/
50
#define SPI_BIT_SS( slave ) ( SPI_BIT_SS0 + (slave) )
51
52
/** Delay between SCLK transitions */
53
#define SPI_BIT_UDELAY 1
54
55
/** SPI bit basher treats data as big-endian */
56
#define SPI_BIT_BIG_ENDIAN 0
57
58
/** SPI bit basher treats data as little-endian */
59
#define SPI_BIT_LITTLE_ENDIAN 1
60
61
extern
void
init_spi_bit_basher
(
struct
spi_bit_basher
*spibit );
62
63
#endif
/* _IPXE_SPI_BIT_H */
spi_bit_basher::basher
struct bit_basher basher
Bit-bashing interface.
Definition:
spi_bit.h:20
spi_bus
An SPI bus.
Definition:
spi.h:126
spi.h
SPI interface.
SPI_BIT_SCLK
Serial clock.
Definition:
spi_bit.h:35
bitbash.h
Bit-bashing interfaces.
spi_bit_basher
A bit-bashing SPI bus.
Definition:
spi_bit.h:16
bit_basher
A bit-bashing interface.
Definition:
bitbash.h:55
SPI_BIT_SS0
Slave 0 select.
Definition:
spi_bit.h:41
spi_bit_basher::bus
struct spi_bus bus
SPI bus.
Definition:
spi_bit.h:18
SPI_BIT_MOSI
Master Out Slave In.
Definition:
spi_bit.h:37
FILE_LICENCE
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
init_spi_bit_basher
void init_spi_bit_basher(struct spi_bit_basher *spibit)
Initialise SPI bit-bashing interface.
Definition:
spi_bit.c:235
SPI_BIT_MISO
Master In Slave Out.
Definition:
spi_bit.h:39
spi_bit_basher::endianness
int endianness
Endianness of data.
Definition:
spi_bit.h:29
Generated by
1.8.15