Interval Driver

The interval driver allows you to register abilities and callbacks to execute at a given interval of time.

Type Definitions

Name Definition
ATMO_INTERVAL_Handle_t typedef uint32_t ATMO_INTERVAL_Handle_t

Enumerations

enum ATMO_INTERVAL_Status_t

Interval driver function return enumerations.

Name Value Description
ATMO_INTERVAL_Status_Success 0x00u Operation was successful
ATMO_INTERVAL_Status_Fail 0x01u Operation failed
ATMO_INTERVAL_Status_Initialized 0x02u Peripheral already initialized
ATMO_INTERVAL_Status_Invalid 0x03u Invalid operation or result
ATMO_INTERVAL_Status_NotSupported 0x04u Feature not supported by platform
ATMO_INTERVAL_Status_Unknown 0x05u Some other status not defined
ATMO_INTERVAL_Status_OutOfMemory 0x06u Device out of memory

Functions

ATMO_Status_t ATMO_INTERVAL_AddDriverInstance(const ATMO_INTERVAL_DriverInstance_t *driverInstance, ATMO_DriverInstanceData_t *driverInstanceData, ATMO_DriverInstanceHandle_t *instanceNumber)

This routine will add an instance of a driver for INTERVAL into the INTERVAL driver handler.

Parameter Direction Type
instanceNumber out ATMO_DriverInstanceHandle_t *
driverInstanceData in ATMO_DriverInstanceData_t *
driverInstance in const ATMO_INTERVAL_DriverInstance_t *
Return Type
ATMO_Status_t

ATMO_INTERVAL_Status_t ATMO_INTERVAL_Init(ATMO_DriverInstanceHandle_t instance)

This routine will initialize the interval driver instance.

Parameter Direction Type
instance in ATMO_DriverInstanceHandle_t
Return Type
ATMO_INTERVAL_Status_t

ATMO_INTERVAL_Status_t ATMO_INTERVAL_AddAbilityInterval(ATMO_DriverInstanceHandle_t instance, unsigned int abilityHandle, unsigned int interval_ms, ATMO_INTERVAL_Handle_t *intervalHandle)

This routine will add an instance for the interval handler to launch the said ability handler every given time by interval in milliseconds.

Parameter Direction Type
intervalHandle out ATMO_INTERVAL_Handle_t *
interval_ms in unsigned int
abilityHandle in unsigned int
instance in ATMO_DriverInstanceHandle_t
Return Type
ATMO_INTERVAL_Status_t

ATMO_INTERVAL_Status_t ATMO_INTERVAL_RemoveAbilityInterval(ATMO_DriverInstanceHandle_t instance, ATMO_INTERVAL_Handle_t intervalHandle)

Using the interval handler return from AddAbilityInterval this function will remove the interval from execution.

Parameter Direction Type
intervalHandle in ATMO_INTERVAL_Handle_t
instance in ATMO_DriverInstanceHandle_t
Return Type
ATMO_INTERVAL_Status_t