miniFOC 1.0.3
This open-source project aims to accomplish a FOC(Field Oriented Control) scheme that is operatable with minimum costs in China.
Functions | Variables
system.c File Reference

system basic function source file More...

#include "gd32f1x0.h"
#include "system.h"

Go to the source code of this file.

Functions

void systick_config (void)
 initialize systick timer to implementation delay function More...
 
void delayms (unsigned long count)
 millisecond delay function, any time time. More...
 
void delay_decrement (void)
 delay counter decrement function, called by systick handler More...
 
void user_memset (void *buf, unsigned char data, unsigned char num)
 format buffer array to fixed value, replace memset function More...
 
unsigned int float_to_int32 (float data0)
 convert floating point numbers to int32 type data More...
 
float int32_to_float (unsigned int data0)
 convert int32 to floating point numbers type data More...
 

Variables

static volatile unsigned long delayms_counter = 1
 millisecond delay function count variable More...
 

Detailed Description

system basic function source file

Author
Lao·Zhu
Version
V1.0.2
Date
29. October 2021

Definition in file system.c.

Function Documentation

◆ delay_decrement()

void delay_decrement ( void  )

delay counter decrement function, called by systick handler

Definition at line 38 of file system.c.

References delayms_counter.

Referenced by SysTick_Handler().

◆ delayms()

void delayms ( unsigned long  count)

millisecond delay function, any time time.

Parameters
[in]counttime to delay (in milliseconds)

Definition at line 30 of file system.c.

References delayms_counter.

Referenced by encoder_zeroing(), foc_calibrate_phase(), main(), and report_local_variable().

◆ float_to_int32()

unsigned int float_to_int32 ( float  data0)

convert floating point numbers to int32 type data

Parameters
[in]data0floating point type data to be converted
Return values
convertedint32 type data

Definition at line 60 of file system.c.

Referenced by flash_write_parameters(), report_angle_speed(), and report_local_variable().

◆ int32_to_float()

float int32_to_float ( unsigned int  data0)

convert int32 to floating point numbers type data

Parameters
[in]data0int32 type data to be converted
Return values
convertedfloating point type data

Definition at line 70 of file system.c.

Referenced by flash_read_parameters(), and mdtp_callback_handler().

◆ systick_config()

void systick_config ( void  )

initialize systick timer to implementation delay function

Definition at line 20 of file system.c.

Referenced by main().

◆ user_memset()

void user_memset ( void *  buf,
unsigned char  data,
unsigned char  num 
)

format buffer array to fixed value, replace memset function

Parameters
[in,out]bufarray to format
[in]datavalue to be formatted as
[in]numnumber of elements to format

Definition at line 49 of file system.c.

Referenced by filter_coefficient_config(), mdtp_receive_handler(), and pid_config().

Variable Documentation

◆ delayms_counter

volatile unsigned long delayms_counter = 1
static

millisecond delay function count variable

Definition at line 15 of file system.c.

Referenced by delay_decrement(), and delayms().