#define _API_OS_H
#define _API_OS_H

#include "include.h"

/**************************************************
 *  0 <= priority <= 18
 *  But can't set to 0, 6, 12, 18
 *  Because:   Timer -> 0
 *             BT    -> 6
 *             Main  -> 12
 *             IDLE  -> 18
**************************************************/

/* This struct is used in lib. Don't modified it! */
typedef struct {
    char *thread_name;                  // name
    u8 msg_size;                        // Byte Size
    u8 msg_max_num;                     // MSG number limit
    u16 stack_size;                     // Thread stack size
    u8 priority;                        // Priority
    void (* enter_func)(void *param);   // Thread entry func
    u8 index;                           // Thread index, output parameter
} thread_tbl_typedef;

bool user_thread_create(thread_tbl_typedef *thread_tbl);
void user_thread_msg_dequeue(u8 thread_idx, u8 *msg, u8 msg_size);
void user_thread_msg_enqueue(u8 thread_idx, u8 *msg, u8 msg_size);

#define _API_OS_H
