le_ulpm API Reference

Files

file  le_ulpm_common.h
 
file  le_ulpm_interface.h
 

Macros

#define LE_ULPM_MAX_VERS_LEN   8
 

Typedefs

typedef void(* le_ulpm_DisconnectHandler_t) (void *)
 

Enumerations

enum  le_ulpm_GpioState_t {
  LE_ULPM_GPIO_LOW = 0, LE_ULPM_GPIO_HIGH = 1, LE_ULPM_GPIO_RISING = 2, LE_ULPM_GPIO_FALLING = 3,
  LE_ULPM_GPIO_BOTH = 4, LE_ULPM_GPIO_OFF = 5
}
 
enum  le_ulpm_ULPSConfiguration_t {
  LE_ULPM_DISABLE_PSM = 0, LE_ULPM_PSM_WITH_ULPM_FALLBACK = 1, LE_ULPM_POWER_OFF = 2, LE_ULPM_NO_REQUEST = 4,
  LE_ULPM_PSM_ONLY = 5, LE_ULPM_ULPM_ONLY = 6
}
 

Functions

void le_ulpm_ConnectService (void)
 
le_result_t le_ulpm_TryConnectService (void)
 
LE_FULL_API void le_ulpm_SetServerDisconnectHandler (le_ulpm_DisconnectHandler_t disconnectHandler, void *contextPtr)
 
void le_ulpm_DisconnectService (void)
 
le_result_t le_ulpm_BootOnGpio (uint32_t gpioNum, le_ulpm_GpioState_t state)
 
le_result_t le_ulpm_BootOnTimer (uint32_t expiryVal)
 
le_result_t le_ulpm_BootOnAdc (uint32_t adcNum, uint32_t pollIntervalInMs, double bootAboveAdcReading, double bootBelowAdcReading)
 
le_result_t le_ulpm_GetFirmwareVersion (char *version, size_t versionSize)
 
le_result_t le_ulpm_ShutDown (void)
 
le_result_t le_ulpm_Reboot (void)
 
le_result_t le_ulpm_SetShutDownStrategy (le_ulpm_ULPSConfiguration_t ulpsConfig)
 

Detailed Description

Macro Definition Documentation

◆ LE_ULPM_MAX_VERS_LEN

#define LE_ULPM_MAX_VERS_LEN   8

Maximum version length of mcu firmware.

Typedef Documentation

◆ le_ulpm_DisconnectHandler_t

typedef void(* le_ulpm_DisconnectHandler_t) (void *)

Type for handler called when a server disconnects.

Enumeration Type Documentation

◆ le_ulpm_GpioState_t

State of gpio pin. This state will be used to exit from low power state.

Enumerator
LE_ULPM_GPIO_LOW 

Gpio voltage level low.

LE_ULPM_GPIO_HIGH 

Gpio voltage level high.

LE_ULPM_GPIO_RISING 

Gpio edge rising.

LE_ULPM_GPIO_FALLING 

Gpio edge falling.

LE_ULPM_GPIO_BOTH 

Gpio edge either rising or falling.

LE_ULPM_GPIO_OFF 

Gpio off.

◆ le_ulpm_ULPSConfiguration_t

Possible ULPS (Ultra Low Power State) configurations to select before shutdown.

Value 3 is skipped as it should not be used according to swimcu_pm documentation.

Enumerator
LE_ULPM_DISABLE_PSM 

Resquest to disable PSM.

LE_ULPM_PSM_WITH_ULPM_FALLBACK 

Request enable PSM with ULPM fallback.

LE_ULPM_POWER_OFF 

Request power off module.

LE_ULPM_NO_REQUEST 

No request (Default value)

LE_ULPM_PSM_ONLY 

Request enable PSM only.

LE_ULPM_ULPM_ONLY 

Request enable ULPM only.

Function Documentation

◆ le_ulpm_BootOnAdc()

le_result_t le_ulpm_BootOnAdc ( uint32_t  adcNum,
uint32_t  pollIntervalInMs,
double  bootAboveAdcReading,
double  bootBelowAdcReading 
)

Configure and enable an ADC as a boot source.

It is possible to specify a single range of operation or two ranges of operation with a non-operational range in between. When bootAboveAdcReading is less than bootBelowAdcReading, then a single range bootAboveReading to bootBelowReading is the configured operational range. However if bootAboveAdcReading is greater than bootBelowAdcReading, then there are two operational ranges. The first is any reading less than bootBelowAdcReading and the second is any reading greater than bootAboveAdcReading.

Returns
  • LE_OK on success
  • LE_NOT_PERMITTED if the process lacks sufficient permissions to configure the adc as a boot source.
  • LE_OVERFLOW if the provided bootAboveAdcReading or bootBelowAdcReading are too large to convert to fit in the internal string buffer.
  • LE_BAD_PARAMETER if the pollIntervalInMs, bootAboveAdcReading or bootBelowAdcReading parameter were rejected.
  • LE_UNSUPPORTED if the device does not support using the given adc as a boot source.
  • LE_FAULT if there is a non-specific failure.
Parameters
[in]adcNumNumber of the ADC to configure
[in]pollIntervalInMsHow frequently to poll the ADC while sleeping
[in]bootAboveAdcReadingReading above which the system should boot
[in]bootBelowAdcReadingReading below which the system should boot

◆ le_ulpm_BootOnGpio()

le_result_t le_ulpm_BootOnGpio ( uint32_t  gpioNum,
le_ulpm_GpioState_t  state 
)

State of gpio pin. This state will be used to exit from low power state. Possible ULPS (Ultra Low Power State) configurations to select before shutdown.

Value 3 is skipped as it should not be used according to swimcu_pm documentation. Configure the system to boot based on a state change of a given GPIO.

Returns
  • LE_OK if specified gpio is configured as boot source.
  • LE_NOT_PERMITTED if the process lacks sufficient permissions to configure the GPIO as a boot source.
  • LE_UNSUPPORTED if the device lacks the ability to boot based on the given GPIO.
  • LE_BAD_PARAMETER if the state parameter was rejected.
  • LE_FAULT if there is a non-specific failure.
Parameters
[in]gpioNumGpio number to boot.
[in]stateState which should cause boot.

◆ le_ulpm_BootOnTimer()

le_result_t le_ulpm_BootOnTimer ( uint32_t  expiryVal)

Boot after expiration of timer interval.

Returns
  • LE_OK if timer is configured as boot source.
  • LE_NOT_PERMITTED if the process lacks sufficient permissions to configure the timer as a boot source.
  • LE_UNSUPPORTED if the device lacks the ability to boot based on a timer.
  • LE_BAD_PARAMETER if the state parameter was rejected.
  • LE_FAULT if there is a non-specific failure.
Parameters
[in]expiryValExpiration time(in second) to boot. This is relative time from modem/app processor shutdown.

◆ le_ulpm_ConnectService()

void le_ulpm_ConnectService ( void  )

Connect the current client thread to the service providing this API. Block until the service is available.

For each thread that wants to use this API, either ConnectService or TryConnectService must be called before any other functions in this API. Normally, ConnectService is automatically called for the main thread, but not for any other thread. For details, see Client Specific Functions.

This function is created automatically.

◆ le_ulpm_DisconnectService()

void le_ulpm_DisconnectService ( void  )

Disconnect the current client thread from the service providing this API.

Normally, this function doesn't need to be called. After this function is called, there's no longer a connection to the service, and the functions in this API can't be used. For details, see Client Specific Functions.

This function is created automatically.

◆ le_ulpm_GetFirmwareVersion()

le_result_t le_ulpm_GetFirmwareVersion ( char *  version,
size_t  versionSize 
)

Get the ultra low power manager firmware version.

Returns
  • LE_OK on success
  • LE_OVERFLOW if version string to big to fit in provided buffer
  • LE_FAULT for any other errors
Parameters
[out]versionFirmware version string
[in]versionSize

◆ le_ulpm_Reboot()

le_result_t le_ulpm_Reboot ( void  )

Initiate reboot of app processor/modem etc.

Returns
  • LE_OK if reboot initiates properly.
  • LE_UNAVAILABLE if rebooting is not possible now. Try again.
  • LE_NOT_PERMITTED if the process lacks sufficient permissions to perform a reboot.
  • LE_UNSUPPORTED if the device lacks the ability to reboot via ULPM.
  • LE_FAULT if there is a non-specific failure.

◆ le_ulpm_SetServerDisconnectHandler()

LE_FULL_API void le_ulpm_SetServerDisconnectHandler ( le_ulpm_DisconnectHandler_t  disconnectHandler,
void *  contextPtr 
)

Set handler called when server disconnection is detected.

When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants to continue without exiting, it should call longjmp() from inside the handler.

◆ le_ulpm_SetShutDownStrategy()

le_result_t le_ulpm_SetShutDownStrategy ( le_ulpm_ULPSConfiguration_t  ulpsConfig)

Set the Low Power Mode configuration to apply when le_ulpm_ShutDown is called.

Returns
  • LE_OK on success
  • LE_BAD_PARAMETER if the value of a parameter is invalid
  • LE_UNSUPPORTED if not supported
  • LE_FAULT for any other errors
Parameters
[in]ulpsConfigValue used to configure ULPS.

◆ le_ulpm_ShutDown()

le_result_t le_ulpm_ShutDown ( void  )

Initiate shutting down of app processor/modem etc.

Returns
  • LE_OK if entry to ultra low power mode initiates properly.
  • LE_UNAVAILABLE if shutting is not possible now. Try again.
  • LE_NOT_PERMITTED if the process lacks sufficient permissions to perform a shutdown.
  • LE_UNSUPPORTED if the device lacks the ability to shutdown via ULPM.
  • LE_FAULT if there is a non-specific failure.

◆ le_ulpm_TryConnectService()

le_result_t le_ulpm_TryConnectService ( void  )

Try to connect the current client thread to the service providing this API. Return with an error if the service is not available.

For each thread that wants to use this API, either ConnectService or TryConnectService must be called before any other functions in this API. Normally, ConnectService is automatically called for the main thread, but not for any other thread. For details, see Client Specific Functions.

This function is created automatically.

Returns
  • LE_OK if the client connected successfully to the service.
  • LE_UNAVAILABLE if the server is not currently offering the service to which the client is bound.
  • LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
  • LE_COMM_ERROR if the Service Directory cannot be reached.