FreeRTOS: Common I/O
AWS IoT Common I/O library
Return to main page ↑
Reset HAL APIs

Macros

#define IOT_RESET_SUCCESS   ( 0 )
 
#define IOT_RESET_FUNCTION_NOT_SUPPORTED   ( 1 )
 
#define IOT_RESET_INVALID_VALUE   ( 2 )
 

Enumerations

enum  IotResetReason_t {
  eResetPowerOnBoot, eResetWarmBoot, eResetColdBoot, eResetWatchdog,
  eResetBusTimeout, eResetPmic, eResetBrownOut, eResetOther
}
 
enum  IotResetBootFlag_t { eResetWarmBootFlag, eResetColdBootFlag }
 

Functions

void iot_reset_reboot (IotResetBootFlag_t xResetBootFlag)
 iot_reset_reboot is used to reboot the device. More...
 
int32_t iot_reset_shutdown ()
 iot_reset_shutdown is used to shutdown the device. If the target does not support shutdown of the device, IOT_RESET_FUNCTION_NOT_SUPPORTED is returned to the user. More...
 
int32_t iot_get_reset_reason (IotResetReason_t *xResetReason)
 iot_get_reset_reason is used to get the last reset reason. If the underlying HW does not support the feature of persisting the reset reason, then this API will return IOT_RESET_FUNCTION_NOT_SUPPORTED error with the value in out as don't care. More...
 

Detailed Description

Macro Definition Documentation

◆ IOT_RESET_SUCCESS

#define IOT_RESET_SUCCESS   ( 0 )

Return values used by reset driverReset operation completed successfully.

◆ IOT_RESET_FUNCTION_NOT_SUPPORTED

#define IOT_RESET_FUNCTION_NOT_SUPPORTED   ( 1 )

Reset function not supported.

◆ IOT_RESET_INVALID_VALUE

#define IOT_RESET_INVALID_VALUE   ( 2 )

At least one parameter is invalid.

Enumeration Type Documentation

◆ IotResetReason_t

Enumerator
eResetPowerOnBoot 

Normal power on Boot, when the power is applied to the device.

eResetWarmBoot 

Last reset triggered due to warm Reset. for ex: iot_reset_reboot(0) was called to reset the device

eResetColdBoot 

Last reset triggered due to cold Reset. for ex: iot_reset_reboot(1)

eResetWatchdog 

Last reset triggered due to watchdog expiration

eResetBusTimeout 

Last reset triggered due to internal bus timeout on the SoC

eResetPmic 

Last reset caused by power management IC

eResetBrownOut 

Last reset caused by power brown out

eResetOther 

Last reset caused by other reasons specific to the underlying hardware

◆ IotResetBootFlag_t

Enumerator
eResetWarmBootFlag 

Perform warm-reset

eResetColdBootFlag 

Perform cold-reset

Function Documentation

◆ iot_reset_reboot()

void iot_reset_reboot ( IotResetBootFlag_t  xResetBootFlag)

iot_reset_reboot is used to reboot the device.

Parameters
[in]xResetBootFlagflag to determine either to do cold-reset or warm-reset. cold-reset means the device is restarted and does not keep any blocks of the SOC powered on i.e. device is shutdown and rebooted), and warm-reset means the device is restarted while keeping some of the SoC blocks powered on through the reboot process. For example warm-boot may keep the RAM contents valid after reset by keeping the power on for RAM banks, while cold-boot will wipe off the contents. One of the IotResetBootFlag_t value.

◆ iot_reset_shutdown()

int32_t iot_reset_shutdown ( )

iot_reset_shutdown is used to shutdown the device. If the target does not support shutdown of the device, IOT_RESET_FUNCTION_NOT_SUPPORTED is returned to the user.

Returns
  • does not return and device shutdown on success
  • IOT_RESET_FUNCTION_NOT_SUPPORTED if shutdown not supported.

◆ iot_get_reset_reason()

int32_t iot_get_reset_reason ( IotResetReason_t xResetReason)

iot_get_reset_reason is used to get the last reset reason. If the underlying HW does not support the feature of persisting the reset reason, then this API will return IOT_RESET_FUNCTION_NOT_SUPPORTED error with the value in out as don't care.

Parameters
[out]xResetReasonOne of the reset reasons specified in IotResetReason_t types
Returns
  • IOT_RESET_SUCCESS on success.
  • IOT_RESET_FUNCTION_NOT_SUPPORTED if not supported.
  • IOT_RESET_INVALID_VALUE if xREsetReason == NULL