Zepto Elements is a collection or toolbox of Embedded System Infrastructure modules. These modules have been developed for Planet 1's embedded system designs, they have been written by experienced embedded system engineers for embedded system engineers encompassing the limitations and good practices required for developing reliable, efficient and high performance embedded systems. Zepto Elements is provided as a complete set, you use only the modules you require for your product. |
OverviewThese modules have common features required for high performance small embedded systems:
|
z_evt - Event SchedulerReplaces a traditional RTOS or basic Super-Loop with a light and fast Event Scheduler which is designed specifically for bare-metal embedded systems. The event scheduler organises tasks and events and only executes a non-blocking task when it has an event pending. Events can be signalled from any task or ISR. Why use this Event Scheduler instead of an RTOS? Most Embedded System are not hard real-time and do not warrant the complexities involved in an RTOS based system. Why make your product more expensive and time consuming to develop, more prone to bugs, more difficult to debug and requiring a more expensive microcontroller? With an RTOS your number of tasks will be limited because each task requires its own stack space and so it will require a larger and more expensive microcontroller to perform the same functionality. As tasks are premptable by other tasks every shared resource and data must be protected by mutexes, semaphores or critical sections - any omissions will cause a bug which may not occur very often, making it very hard to debug and so take a long time - costing money and reputation. Are you confident your system will be reliable? With this Event Scheduler tasks are synchronous and are only preempted by interrupts, if you need real time response then service it in an interrupt service routine. For instance when receiving data from a serial port or sampling data from an ADC port then perform this in an interrupt service routine (ISR), add the data to a queue (z_que, see below), signal your receive event, exit the ISR then process the data in the task signalled by the event. This keeps the ISR blocking time very short and decouples the data processing from the ISR. This event scheduler uses a simple user configuration file and compile time tool to define the events, tasks and which tasks should receive which events - this saves precious RAM and ROM/flash space. All the LUTs are ROMable and takes no RAM space. Features
|
z_tmr - Generic TimersThe z_tmr module provides a simple and elegant timer system using only one hardware timer. It is independent of any operating system and can be used standalone, with a simple super-loop scheduler, virtually any OS/RTOS and Zepto z_evt Event Scheduler. The user can set as many timers as required using globally or statically declared z_tmr_t structures, one for each required timer. This structure holds all the timer information. Features
|
z_que - Queue ContainerA queue is a way of containing data or data structures in a linearly ordered First In First Out (FIFO) queue. The queue has little overhead compared to a linked list, but lacks the linked list flexibility, see z_lst container. Use this queue with a event to create a data stream, for instance serial port USART receive buffer. The queue data is an array of data or data structures with management data. The data has zero overhead per element and a fixed additional size per queue for the management data stored in z_que_t. Data Queue DiagramWrite and +--+--+--+--+--+--+--+--+--+--+--+--+--+--+ Read and Features
|
z_lst - Circular Double Way Linked List ContainerA linked list is a way of containing and ordering data structures. The size of a list changes as data structures are added or removed, the list size is only limited by the memory available. Unlike an array the data structures can be in any order and at any address in memory. Data structure are easily and quickly inserted or removed from the list by only updating the link pointers. The disadvantage compared to an array is that every data structure must contain the double way link pointers and so this method becomes inefficient in terms of memory space if the data being contained is small, for example a queue of characters received from or transmitted to a serial port (where the data is 1 byte and the link pointers are 4 bytes). In this case the z_que Queue Container is better suited. Linear Double Way Linked List Diagram+------+ +-+------+-+ +-+------+-+ +-+------+-+ Many functions are implemented as macros or inline functions. again for efficiency reasons. Features
|
z_flg - Prioritised Flag ManagementA flag can be used to represent something that has happened (i.e. an event), in a similar way that an interrupt is a flag. Flags may represents error codes, system inputs and outputs, inter-process communication, tasks ready to run, etc. These flag management functions store each flag as a single bit in a bit array. The flags are prioritised and can be disabled or masked off. Features
|
z_bit - Bit Manipulation FunctionsBit manipulation functions optimised for the supported CPU architectures. Some architectures provide specific instructions to efficiently perform the following functions, others do not. These routines provide the desired CPU instruction or high optimised alternatives where no CPU support is provided. Current Functionsz_bit_cnt(word) - Count the number of set bits in word. Features
|
z_atm - Atomic PrimitivesThis header file defines the atomic primitives that enable critical sections of code to run atomically (without interruption) and for more advanced CPU architectures allow defines primitives to simulate critical sections without disabling interrupts. |