Interface for PHY drivers.
More...
Interface for PHY drivers.
A driver embeds a struct pbl_phy in its instance, sets it up with PBL_PHY_STATE_DEFINE() and PBL_PHY_INIT(), and implements the struct pbl_phy_ops the class calls.
◆ pbl_phy_state
◆ pbl_phy
◆ PBL_PHY_INIT
| #define PBL_PHY_INIT |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_parent, |
|
|
|
_ops |
|
) |
| |
Value: { \
.ops = (_ops), \
.state = &sym##_phy_state, \
}
#define PBL_DEVICE_INIT_CLASS(sym, _name, _init, _parent, _cls)
Initializer for the struct pbl_device of device instance sym, in class _cls.
Definition device.h:153
Initialize a struct pbl_phy.
- Parameters
-
| sym | Symbol of the instance, as passed to PBL_PHY_STATE_DEFINE(). |
| _name | Device name. |
| _parent | Parent device, or NULL. |
| _ops | Driver operations. |
◆ PBL_PHY_STATE_DEFINE
| #define PBL_PHY_STATE_DEFINE |
( |
|
sym | ) |
|
Value:
#define PBL_DEVICE_STATE_DEFINE(sym)
Define the runtime state of device instance sym.
Definition device.h:132
struct pbl_mutex lock
Device lock.
Definition driver.h:37
PHY runtime state.
Definition driver.h:35
#define PBL_MUTEX_INITIALIZER
Static initializer for an unlocked mutex.
Definition mutex.h:50
Define the runtime state of a PHY.
- Parameters
-
| sym | Symbol of the instance. |
◆ pbl_phy_report_vbus_changed()
| void pbl_phy_report_vbus_changed |
( |
const struct pbl_phy * |
phy | ) |
|
Report VBUS coming or going to the listeners, from thread context.
- Parameters
-