Adds the specified task to the task list.
uint8_t sched_add( const sched_task * task )
Busy waits a specified duration of time.
void sched_busy_wait( sched_time duration )
The type of fields containing sets of bit flags that correspond to task categories.
typedef uint16_t sched_catflags
The scheduler iteration time delta.
extern sched_time sched_delta
Queries the task list.
sched_task *sched_find( uint8_t st_mask, uint8_t st_val, uint8_t start_i )
Accesses the task list by index.
sched_task *sched_get_at( uint8_t i )
Gets a scheduler timestamp corresponding to the current time.
sched_time sched_get_timestamp( void )
Initializes the task scheduler.
void sched_init( void )
Invokes a matching task on the task list.
uint8_t sched_invoke( uint8_t st_mask, uint8_t st_val, uint8_t start_i )
Invokes all matching tasks on the task list.
void sched_invoke_all( uint8_t st_mask, uint8_t st_val )
This is the ISR-Task Category Wakeup Word (I-TCWW), a variable that contains bit flags representing a set of task categories that should be notified at the start of the next scheduler iteration.
extern volatile sched_catflags sched_isr_tcww
Current size of the task list.
extern uint8_t sched_list_size
Queries the task list.
sched_task *sched_ptr_query( uint8_t st_mask, uint8_t st_val, uint8_t start_i, uint8_t * task_i_p )
Queries the task list.
uint8_t sched_query( uint8_t st_mask, uint8_t st_val, uint8_t start_i )
Marks a matching task on the task list for removal.
uint8_t sched_remove( uint8_t st_mask, uint8_t st_val, uint8_t start_i )
Marks all matching tasks on the task list for removal.
void sched_remove_all( uint8_t st_mask, uint8_t st_val )
Enters the main loop of the task scheduler.
void sched_run( void ) __attribute__ ((noreturn))
Represents an instance of a task that can be scheduled for execution.
typedef struct sched_task
The type of pointers to functions that implement a task handler procedure.
typedef void ( * sched_task_handler )(struct sched_task *task)
This is the Task-Task Category Wakeup Word (T-TCWW), a variable that contains bit flags representing a set of task categories that should be notified at the start of the next scheduler iteration.
extern sched_catflags sched_task_tcww
High bytes (“bigticks”) of the scheduling clock’s tick count.
extern volatile uint16_t sched_tick_count_h
The scheduler iteration timestamp.
extern sched_time sched_ticks
Represents either a duration or a scheduler timestamp.
typedef struct sched_time
Adds sched_time b to sched_time a.
sched_time sched_time_add( sched_time a, sched_time b )
Tests whether sched_time a contains a greater integer value than b.
uint8_t sched_time_gt( sched_time a, sched_time b )
Tests whether sched_time a contains a greater-or-equal integer value than b.
uint8_t sched_time_gte( sched_time a, sched_time b )
Tests whether a sched_time contains a zero value.
uint8_t sched_time_is_zero( sched_time t )
Tests whether sched_time a contains a lesser integer value than b.
uint8_t sched_time_lt( sched_time a, sched_time b )
Tests whether sched_time a contains a lesser-or-equal integer value than b.
uint8_t sched_time_lte( sched_time a, sched_time b )
Subtracts sched_time b from sched_time a.
sched_time sched_time_sub( sched_time a, sched_time b )
Awakens and optionally notifies a matching task on the task list.
uint8_t sched_wake( uint8_t st_mask, uint8_t st_val, uint8_t start_i, uint8_t notify )
Awakens and optionally notifies all matching tasks on the task list.
void sched_wake_all( uint8_t st_mask, uint8_t st_val, uint8_t notify )
Size in bytes of the memory location to monitor.
uint8_t size
Contains a state code representing the current state of the SPI module.
extern volatile spi_state spi_request_state
The type of state and result codes for the SPI module.
typedef uint8_t spi_state
Tasks in the categories indicated by this sched_catflags value will be notified by the SPI module’s ISR when a request operation finishes (either successfully or with an error).
extern volatile sched_catflags spi_task_cats
Configures the SPI module for Master mode and sets task categories for notifications.
void spihelper_async_mstr_init( uint8_t ss_b, uint8_t ss_c, uint8_t ss_d, uint8_t ctrl, sched_catflags task_cats )
Synchronously exchanges a single pair of bytes via the SPI peripheral.
uint8_t spihelper_exchange_bytes( uint8_t data_out )
Configures the SPI module for either Master or Slave mode, depending on the value of the Master/Slave Select (MSTR) bit in the ctrl argument.
void spihelper_init( uint8_t ctrl )
Configures the SPI module for Master mode.
void spihelper_mstr_init( uint8_t ss_b, uint8_t ss_c, uint8_t ss_d, uint8_t ctrl )
Initiates an SPI request operation consisting of a transmit phase followed by a receive phase.
spi_state spihelper_request( uint8_t n_out, volatile const uint8_t * bfr_out, uint8_t n_in, uint8_t offset_in, volatile uint8_t * bfr_in )
Disables the SPI module.
void spihelper_shutdown( void )
INM address of the source node.
uint8_t srcadr
Task control and status byte (TCSB) of the task instance.
uint8_t st