monoZ docs
MZ_spi_example.c File Reference

This is an example application for spi. User can use this app for spi protocol specific requirements. More...

#include "MZ_sys_cmsis_os2.h"
#include "MZ_spi_example.h"
#include "MZ_timer.h"
#include "MZ_print.h"
#include "MZ_spi2_instance.h"
#include "MZ_error_handler.h"
#include "MZ_spi.h"
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include "stm32l4xx_hal_spi.h"

Go to the source code of this file.

Macros

#define SPI_APP_STACK_SIZE   (1024)
 
#define SPI_TX_TIME   (pdMS_TO_TICKS(60000))
 
#define SPI_TX_SIZE   (10)
 

Functions

static void timer_cb (TimerHandle_t xTimer)
 Timer callback function for transmission of the data. More...
 
static void spi_app (void *arg)
 create the timer and starts if main RTOS scheduler started More...
 
mz_error_t spi_app_init (void)
 

Variables

static mz_thread_t spi_thread_id = NULL
 
static StaticTask_t spi_cb_mem
 
static StackType_t spi_stack [SPI_APP_STACK_SIZE]
 
static mz_semaphore_t spi_sema_id = NULL
 
static mzUint8 send_data [SPI_TX_SIZE]
 

Detailed Description

This is an example application for spi. User can use this app for spi protocol specific requirements.

Date
Jul 14, 2021
Author
Mahendra & Kafeel

Definition in file MZ_spi_example.c.

Macro Definition Documentation

◆ SPI_APP_STACK_SIZE

#define SPI_APP_STACK_SIZE   (1024)

Definition at line 40 of file MZ_spi_example.c.

◆ SPI_TX_TIME

#define SPI_TX_TIME   (pdMS_TO_TICKS(60000))

Definition at line 41 of file MZ_spi_example.c.

◆ SPI_TX_SIZE

#define SPI_TX_SIZE   (10)

Definition at line 42 of file MZ_spi_example.c.

Function Documentation

◆ timer_cb()

void timer_cb ( TimerHandle_t  xTimer)
static

Timer callback function for transmission of the data.

Note
This function will notifies the user when timer expires

Definition at line 56 of file MZ_spi_example.c.

◆ spi_app()

void spi_app ( void *  arg)
static

create the timer and starts if main RTOS scheduler started

Parameters
argvoid
Note
User can write the code for process the read data from SPI

Definition at line 69 of file MZ_spi_example.c.

◆ spi_app_init()

mz_error_t spi_app_init ( void  )

Definition at line 115 of file MZ_spi_example.c.

Variable Documentation

◆ spi_thread_id

mz_thread_t spi_thread_id = NULL
static

Definition at line 44 of file MZ_spi_example.c.

◆ spi_cb_mem

StaticTask_t spi_cb_mem
static

Definition at line 45 of file MZ_spi_example.c.

◆ spi_stack

StackType_t spi_stack[SPI_APP_STACK_SIZE]
static

Definition at line 46 of file MZ_spi_example.c.

◆ spi_sema_id

mz_semaphore_t spi_sema_id = NULL
static

Definition at line 47 of file MZ_spi_example.c.

◆ send_data

mzUint8 send_data[SPI_TX_SIZE]
static

Definition at line 48 of file MZ_spi_example.c.