monoZ docs
MZ_gpio_example.c File Reference

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

#include "MZ_sys_cmsis_os2.h"
#include "MZ_gpio_example.h"
#include "MZ_timer.h"
#include "MZ_print.h"
#include "MZ_gpio_instance.h"
#include "MZ_error_handler.h"
#include "MZ_gpio.h"

Go to the source code of this file.

Macros

#define GPIO_APP_STACK_SIZE   (128)
 
#define GPIO_TX_TIME   (pdMS_TO_TICKS(5000))
 
#define GPIO_TX_SIZE   (10)
 

Functions

static void timer_cb (TimerHandle_t xTimer)
 timer callback function notifies when timer expires More...
 
static void gpio_app (void *arg)
 create the timer and start when the starts if main RTOS scheduler started More...
 
mz_error_t gpio_app_init (void)
 Initialize GPIO App and creates the gpio application thread By default it will initialize the gpio3. More...
 

Variables

static mz_thread_t gpio_thread_id = NULL
 
static StaticTask_t gpio_cb_mem
 
static StackType_t gpio_stack [GPIO_APP_STACK_SIZE]
 
static mz_semaphore_t gpio_sema_id = NULL
 

Detailed Description

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

Date
Jul 1, 2021
Author
MZ_click

Definition in file MZ_gpio_example.c.

Macro Definition Documentation

◆ GPIO_APP_STACK_SIZE

#define GPIO_APP_STACK_SIZE   (128)

Stack size for the thread

Definition at line 42 of file MZ_gpio_example.c.

◆ GPIO_TX_TIME

#define GPIO_TX_TIME   (pdMS_TO_TICKS(5000))

Timer expire time

Definition at line 43 of file MZ_gpio_example.c.

◆ GPIO_TX_SIZE

#define GPIO_TX_SIZE   (10)

GPIO transmission buffer size

Definition at line 44 of file MZ_gpio_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 67 of file MZ_gpio_example.c.

◆ gpio_app()

void gpio_app ( void *  arg)
static

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

Parameters
argvoid

Definition at line 90 of file MZ_gpio_example.c.

◆ gpio_app_init()

mz_error_t gpio_app_init ( void  )

Initialize GPIO App and creates the gpio application thread By default it will initialize the gpio3.

Initialize GPIO App and creates the gpio application thread By default it will initialize the GPIO.

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

Definition at line 161 of file MZ_gpio_example.c.

Variable Documentation

◆ gpio_thread_id

mz_thread_t gpio_thread_id = NULL
static

Thread id handler

Definition at line 48 of file MZ_gpio_example.c.

◆ gpio_cb_mem

StaticTask_t gpio_cb_mem
static

Thread control block

Definition at line 49 of file MZ_gpio_example.c.

◆ gpio_stack

StackType_t gpio_stack[GPIO_APP_STACK_SIZE]
static

Thread stack

Definition at line 50 of file MZ_gpio_example.c.

◆ gpio_sema_id

mz_semaphore_t gpio_sema_id = NULL
static

Semaphore handler

Definition at line 51 of file MZ_gpio_example.c.