U.B.O.R
The [U]seless [B]ox [O]rganizing [R]obot. A FreeRTOS study project written in C which implements a multitasked control unit for a belt conveyor system with robotic sorting arms.
Data Structures | Macros | Functions | Variables
Belt Conveyer System

Module controlling the Belt Conveyer System and the dispatcher. More...

Data Structures

struct  message_t
 BCS can message structure. More...
 

Macros

#define STACKSIZE_TASK   256
 Stack size of all bcs tasks. More...
 
#define PRIORITY_TASK   2
 Priority of all bcs tasks. More...
 
#define MAX_BLOCK_COUNT   3
 Number of blocks to work with. Must be between 2 and 4. More...
 
#define SWITCH   ((volatile unsigned char*)(0x6C000400))
 

Functions

struct __attribute__ ((__packed__))
 Status message received by belt conveyer system. More...
 
void bcs_prepare_drop (enum belt_select belt)
 Prepares a block drop operation to a specific belt global. More...
 
void bcs_signal_dropped (enum belt_select belt)
 Signal that a block has been dropped on a belt global. More...
 
void bcs_signal_band_free (enum belt_select belt)
 Signal that a block has been removed from a belt and the belt is free again global. More...
 
int8_t bcs_grab (enum belt_select belt)
 Instructs the system that we want to grab a block from the bcs global. More...
 
void bcs_init ()
 Initializes the belt conveyer system and starts the belt tasks global. More...
 

Variables

 status_t
 

Detailed Description

Module controlling the Belt Conveyer System and the dispatcher.

Macro Definition Documentation

◆ MAX_BLOCK_COUNT

#define MAX_BLOCK_COUNT   3

Number of blocks to work with. Must be between 2 and 4.

Definition at line 43 of file bcs.c.

◆ PRIORITY_TASK

#define PRIORITY_TASK   2

Priority of all bcs tasks.

Definition at line 41 of file bcs.c.

◆ STACKSIZE_TASK

#define STACKSIZE_TASK   256

Stack size of all bcs tasks.

Definition at line 40 of file bcs.c.

◆ SWITCH

#define SWITCH   ((volatile unsigned char*)(0x6C000400))

Definition at line 47 of file bcs.c.

Function Documentation

◆ __attribute__()

struct __attribute__ ( (__packed__)  )

Status message received by belt conveyer system.

< error or not

< engines running or not

< light barrier status

< detection status

< block position (along moving axis)

< block location

Definition at line 62 of file bcs.c.

◆ bcs_grab()

int8_t bcs_grab ( enum belt_select  belt)

Instructs the system that we want to grab a block from the bcs global.

Parameters
[in]beltThe belt we want to grab a block from
Returns
Position of the block (relative to the center of the band)

Definition at line 276 of file bcs.c.

◆ bcs_init()

void bcs_init ( )

Initializes the belt conveyer system and starts the belt tasks global.

Returns
None

Definition at line 398 of file bcs.c.

Here is the caller graph for this function:

◆ bcs_prepare_drop()

void bcs_prepare_drop ( enum belt_select  belt)

Prepares a block drop operation to a specific belt global.

Parameters
[in]beltThe belt a block will be dropped to
Returns
None

Definition at line 178 of file bcs.c.

◆ bcs_signal_band_free()

void bcs_signal_band_free ( enum belt_select  belt)

Signal that a block has been removed from a belt and the belt is free again global.

Parameters
[in]beltThe belt that is now free
Returns
None

Definition at line 223 of file bcs.c.

◆ bcs_signal_dropped()

void bcs_signal_dropped ( enum belt_select  belt)

Signal that a block has been dropped on a belt global.

Parameters
[in]beltThe belt the block has been dropped onto
Returns
None

Definition at line 201 of file bcs.c.

Variable Documentation

◆ status_t

status_t

Definition at line 71 of file bcs.c.