queue01

queuexx - fifo queue

Author Joep Suijs, Copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4i

Description

this library provides a (one) byte fifo queue. 
This queue is interrupt-safe in the sense that you can write to the queue from the interrupt and
read from the main program or vice versa without special precautions.
Reading (or writing) from both interrupt and main program might not work properly.



The basic interface is pseudo var:
queue01 = x -- put x into queue; block if queue is full
x = queue01 -- read x from queue; block if queue is empty



non-blocking access to the same queue is provided by
queue01_nb_put()
and
queue01_nb_get()



other methods:
queue01_clear() -- clear queue (makes queue empty)
queue01_empty() -- returns true if queue is emtpy


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions

  • queue01_nb_put(byte in v) return bit

    queue01_nb_put - put one byte into queue (non-blocking)
    
    return:  true  when the byte is put into the queue
             false when the queue is full (byte is not put in queue)
    
    

  • queue01'get() return byte

    queue01'get - get one byte from queue
    
    returns byte from queue.
    When the queue is empty, it waits until a byte is put into the queue.
    
    

  • queue01_nb'get() return byte

    queue01_nb'get - get one byte from queue (non-blocking)
    
    returns byte from queue, 0 if queue empty
    
    

  • queue01_empty() return bit

    No documentation found

  • queue01_nb_get(byte out v) return bit

    queue01_nb_get - get one byte from queue (non-blocking)
    
    The byte read is put into v (calling param)
    
    returns: true  when we read a byte from the queue              
             false when the queue is empty (byte is not read from queue)
    
    


Related samples

Here are the list of samples which use this library:

16f877a16f877a_i2c_hw_slave_eeprom_simulator.jal
16f8816f88_i2c_hw_slave_eeprom_simulator.jal