Miscellaneous

Miscellaneous system functions. More...

Macros

#define ZOS_RTOS_DEFINE_ISR(function)
 This macro allows for an interrupt callback to use RTOS structures such as semaphores and event flags.
 

Functions

zos_result_t zn_system_reboot (void)
 Reboot the device. More...
 
char * zn_system_get_version_str (char *version_str_buffer)
 Return the current firmware version as a string. More...
 
uint32_t zn_system_get_version_uint32 (void)
 Return the current firmware version as uint32. More...
 
void zn_system_register_irq_callback (zos_platform_irq_t irq, void(*callback)(void))
 Register an interrupt callback. More...
 
void zn_system_register_system_tick_callback (void(*callback)(void))
 Register a system tick callback. More...
 

Detailed Description

Miscellaneous system functions.

Function Documentation

char* zn_system_get_version_str ( char *  version_str_buffer)

Return the current firmware version as a string.

This returns the current firmware version as a string. See ZentriOS Command API documentation: version.

The supplied version_str_buffer should be a buffer of at least 96 bytes.

Parameters
[out]version_str_bufferBuffer to hold version string
Returns
Currnet firmware version string (this is the same pointer as the supplied version_str_buffer argument)
uint32_t zn_system_get_version_uint32 ( void  )

Return the current firmware version as uint32.

This returns the current firmware version as a uint32. See ZentriOS Command API documentation: version.

Note
This returns the version of device's product's bundle which may be different than the ZentriOS version.
Returns
Current firmware version as uint32
zos_result_t zn_system_reboot ( void  )

Reboot the device.

See ZentriOS Command API documentation: reboot.

void zn_system_register_irq_callback ( zos_platform_irq_t  irq,
void(*)(void)  callback 
)

Register an interrupt callback.

This registers an interrupt handler for the specificied interrupt vector.

The corresponding interrupt must be enabled using the appropriate MCU registers before the callback is triggered.

Note
Extreme care should be taken when registering an irq callback. The stability of the OS cannot be guaranteed with this is used.
void zn_system_register_system_tick_callback ( void(*)(void)  callback)

Register a system tick callback.

Register a callback to be called every system tick = 1 millisecond.

Note
The callback MUST be extremely simple as the system tick is used by the RTOS scheduler.