HyperBus controllers.
More...
HyperBus controllers.
A controller drives one HyperBus memory, which it maps for reads and writes. The driver of the memory, which knows its registers and what it needs of the bus, uses the controller through this interface without knowing which one it is.
Register addresses are HyperBus word addresses in the register space, and values are as the memory documents them. Times are given as the memory specifies them, for the controller to turn into what its clock makes of them.
◆ pbl_hyperbus_config
| struct pbl_hyperbus_config |
What a HyperBus memory needs of the bus.
| Data Fields |
|
uint16_t |
cs_high_min_ns |
Shortest time CS stays high between accesses, in nanoseconds. |
|
uint32_t |
cs_low_max_ns |
Longest time CS may stay low, in nanoseconds. |
|
uint8_t |
latency |
Latency, in clocks. |
|
uint16_t |
read_recovery_ns |
Shortest time between a read and the next access, in nanoseconds. |
◆ pbl_hyperbus
◆ PBL_HYPERBUS_INIT
| #define PBL_HYPERBUS_INIT |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_parent, |
|
|
|
_ops |
|
) |
| |
Value: { \
.ops = (_ops), \
}
#define PBL_DEVICE_INIT_CLASS(sym, _name, _init, _parent, _deps, _cls)
Initializer for the struct pbl_device of device instance sym, in class _cls.
Definition device.h:145
const struct pbl_device_class pbl_hyperbus_class
Initializer for the struct pbl_hyperbus of controller sym.
- Parameters
-
| sym | Symbol of the controller instance, with its state defined by PBL_DEVICE_STATE_DEFINE(). |
| _name | Name. |
| _parent | Parent device, or NULL. |
| _ops | Driver operations. |
◆ pbl_hyperbus_configure()
Set the bus up for the memory and map the memory.
- Parameters
-
| bus | Controller, enabled. |
| cfg | What the memory needs of the bus. |
| [out] | base | CPU address of the memory. |
- Returns
- 0 or a negative errno.
References pbl_hyperbus_ops::configure, and pbl_hyperbus::ops.
◆ pbl_hyperbus_disable()
| static void pbl_hyperbus_disable |
( |
const struct pbl_hyperbus * |
bus | ) |
|
|
inlinestatic |
◆ pbl_hyperbus_enable()
| static int pbl_hyperbus_enable |
( |
const struct pbl_hyperbus * |
bus | ) |
|
|
inlinestatic |
◆ pbl_hyperbus_get_rate()
| static int pbl_hyperbus_get_rate |
( |
const struct pbl_hyperbus * |
bus, |
|
|
uint32_t * |
rate_hz |
|
) |
| |
|
inlinestatic |
◆ pbl_hyperbus_read_reg()
| static int pbl_hyperbus_read_reg |
( |
const struct pbl_hyperbus * |
bus, |
|
|
uint32_t |
addr, |
|
|
uint16_t * |
val |
|
) |
| |
|
inlinestatic |
Read a register of the memory.
Callable with interrupts disabled.
- Parameters
-
| bus | Controller, configured. |
| addr | Word address in the register space. |
| [out] | val | Value. |
- Returns
- 0 or a negative errno.
References pbl_hyperbus::ops, and pbl_hyperbus_ops::read_reg.
◆ pbl_hyperbus_wake()
| static int pbl_hyperbus_wake |
( |
const struct pbl_hyperbus * |
bus | ) |
|
|
inlinestatic |
◆ pbl_hyperbus_write_reg()
| static int pbl_hyperbus_write_reg |
( |
const struct pbl_hyperbus * |
bus, |
|
|
uint32_t |
addr, |
|
|
uint16_t |
val |
|
) |
| |
|
inlinestatic |
Write a register of the memory.
Callable with interrupts disabled.
- Parameters
-
| bus | Controller, enabled. |
| addr | Word address in the register space. |
| val | Value. |
- Returns
- 0 or a negative errno.
References pbl_hyperbus::ops, and pbl_hyperbus_ops::write_reg.
◆ pbl_hyperbus_class