monoZ docs
MZ_uart_example.c File Reference

Monoz UART example This example app can be used when there is a requirement for different uart specific communication User can use this app for UART protocol specific requirements. More...

#include "MZ_sys_cmsis_os2.h"
#include "MZ_uart_example.h"
#include "MZ_timer.h"
#include "MZ_print.h"
#include "MZ_uart3_instance.h"
#include "MZ_error_handler.h"
#include "MZ_uart.h"

Go to the source code of this file.

Macros

#define UART_APP_STACK_SIZE   (128)
 
#define UART_TX_TIME   (pdMS_TO_TICKS(60000))
 
#define UART_TX_SIZE   (10)
 

Functions

static void timer_cb (TimerHandle_t xTimer)
 timer callback function notifies when timer expires More...
 
static void uart_app (void *arg)
 create the timer and start when the starts if main RTOS scheduler started More...
 
mz_error_t uart_app_init (void)
 Initialize UART App and creates the uart application thread By default it will initialize the uart3. More...
 

Variables

static mz_thread_t uart_thread_id = NULL
 
static StaticTask_t uart_cb_mem
 
static StackType_t uart_stack [UART_APP_STACK_SIZE]
 
static mz_semaphore_t uart_sema_id = NULL
 
static uint8_t send_data [UART_TX_SIZE]
 

Detailed Description

Monoz UART example This example app can be used when there is a requirement for different uart specific communication User can use this app for UART protocol specific requirements.

Date
Jul 1, 2021
Author
MZ_click

Definition in file MZ_uart_example.c.

Macro Definition Documentation

◆ UART_APP_STACK_SIZE

#define UART_APP_STACK_SIZE   (128)

Stack size for the thread

Definition at line 35 of file MZ_uart_example.c.

◆ UART_TX_TIME

#define UART_TX_TIME   (pdMS_TO_TICKS(60000))

Timer expire time

Definition at line 36 of file MZ_uart_example.c.

◆ UART_TX_SIZE

#define UART_TX_SIZE   (10)

UART transmission buffer size

Definition at line 37 of file MZ_uart_example.c.

Function Documentation

◆ timer_cb()

void timer_cb ( TimerHandle_t  xTimer)
static

timer callback function notifies when timer expires

Parameters
xTimerTimerHandle_t

Definition at line 60 of file MZ_uart_example.c.

◆ uart_app()

void uart_app ( void *  arg)
static

create the timer and start when the starts if main RTOS scheduler started

Parameters
argvoid

Definition at line 81 of file MZ_uart_example.c.

◆ uart_app_init()

mz_error_t uart_app_init ( void  )

Initialize UART App and creates the uart application thread By default it will initialize the uart3.

Returns
_ret returns the uart app thread creation status
Note
creates the semaphore to lock the process when multiple processes are in run status

Definition at line 132 of file MZ_uart_example.c.

Variable Documentation

◆ uart_thread_id

mz_thread_t uart_thread_id = NULL
static

Thread id handler

Definition at line 41 of file MZ_uart_example.c.

◆ uart_cb_mem

StaticTask_t uart_cb_mem
static

Thread control block

Definition at line 42 of file MZ_uart_example.c.

◆ uart_stack

StackType_t uart_stack[UART_APP_STACK_SIZE]
static

Thread stack

Definition at line 43 of file MZ_uart_example.c.

◆ uart_sema_id

mz_semaphore_t uart_sema_id = NULL
static

Semaphore handler

Definition at line 44 of file MZ_uart_example.c.

◆ send_data

uint8_t send_data[UART_TX_SIZE]
static

UART transmission buffer

Definition at line 45 of file MZ_uart_example.c.