Miscellaneous#
This module includes platform abstractions for miscellaneous behaviors.
Enumerations#
Enumeration of possible reset reason codes.
Enumeration of micro-controller's power states.
Functions#
This function performs a software reset on the platform, if supported.
This function returns the reason for the last platform reset.
This function provides a platform specific implementation for assert.
This function performs a platform specific operation to wake the host MCU.
This function sets the desired MCU power state.
This function gets the current desired MCU power state.
Enumeration Documentation#
otPlatResetReason#
otPlatResetReason
Enumeration of possible reset reason codes.
These are in the same order as the Spinel reset reason codes.
Enumerator | |
---|---|
OT_PLAT_RESET_REASON_POWER_ON | |
OT_PLAT_RESET_REASON_EXTERNAL | |
OT_PLAT_RESET_REASON_SOFTWARE | |
OT_PLAT_RESET_REASON_FAULT | |
OT_PLAT_RESET_REASON_CRASH | |
OT_PLAT_RESET_REASON_ASSERT | |
OT_PLAT_RESET_REASON_OTHER | |
OT_PLAT_RESET_REASON_UNKNOWN | |
OT_PLAT_RESET_REASON_WATCHDOG | |
OT_PLAT_RESET_REASON_COUNT |
otPlatMcuPowerState#
otPlatMcuPowerState
Enumeration of micro-controller's power states.
These values are used for NCP configuration when OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL
is enabled.
The power state specifies the desired power state of NCP's micro-controller (MCU) when the underlying platform's operating system enters idle mode (i.e., all active tasks/events are processed and the MCU can potentially enter a energy-saving power state).
The power state primarily determines how the host should interact with the NCP and whether the host needs an external trigger (a "poke") to NCP before it can communicate with the NCP or not.
After a reset, the MCU power state MUST be OT_PLAT_POWER_STATE_ON
.
Enumerator | |
---|---|
OT_PLAT_MCU_POWER_STATE_ON | NCP's MCU stays on and active all the time. |
OT_PLAT_MCU_POWER_STATE_LOW_POWER | NCP's MCU can enter low-power (energy-saving) state. |
OT_PLAT_MCU_POWER_STATE_OFF | NCP is fully off. |
Function Documentation#
otPlatReset#
void otPlatReset (otInstance * aInstance)
This function performs a software reset on the platform, if supported.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | The OpenThread instance structure. |
otPlatGetResetReason#
otPlatResetReason otPlatGetResetReason (otInstance * aInstance)
This function returns the reason for the last platform reset.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | The OpenThread instance structure. |
otPlatAssertFail#
void otPlatAssertFail (const char * aFilename, int aLineNumber)
This function provides a platform specific implementation for assert.
Type | Direction | Argument Name | Description |
---|---|---|---|
const char * | [in] | aFilename | The name of the file where the assert occurred. |
int | [in] | aLineNumber | The line number in the file where the assert occurred. |
otPlatWakeHost#
void otPlatWakeHost (void )
This function performs a platform specific operation to wake the host MCU.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
This is used only for NCP configurations.
otPlatSetMcuPowerState#
otError otPlatSetMcuPowerState (otInstance * aInstance, otPlatMcuPowerState aState)
This function sets the desired MCU power state.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to OpenThread instance. |
otPlatMcuPowerState | [in] | aState | The new MCU power state. |
This is only applicable and used for NCP configuration when OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL
is enabled.
otPlatGetMcuPowerState#
otPlatMcuPowerState otPlatGetMcuPowerState (otInstance * aInstance)
This function gets the current desired MCU power state.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to OpenThread instance. |
This is only applicable and used for NCP configuration when OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL
is enabled.
After a reset, the power state MUST return OT_PLAT_POWER_STATE_ON
. During operation, power state SHOULD only change through an explicit successful call to otPlatSetMcuPowerState()
.
Returns
The current power state.