System.c File Reference

STM32F103C8T6 system initialisation. More...

#include "stm32f1xx_hal.h"
#include "System.h"
Include dependency graph for System.c:

Go to the source code of this file.

Functions

static void System_GPIO_Init (void)
 GPIO Initialisation Function.
 
static int System_TIM1_Init (void)
 Timer 1 Initialisation Function. More...
 
static int System_ADC1_Init (void)
 ADC 1 Initialisation Function. More...
 
static int System_I2C2_Init (void)
 I²C 2 Initialisation Function. More...
 
static int System_SPI1_Init (void)
 SPI 1 Initialisation Function. More...
 
static int System_RTC_Init (void)
 RTC Initialisation Function. More...
 
void HAL_TIM_PeriodElapsedCallback (TIM_HandleTypeDef *htim)
 Period elapsed callback in non blocking mode. More...
 
int System_Init (void)
 System Initialisation Function. More...
 
void HAL_TIM_MspPostInit (TIM_HandleTypeDef *htim)
 TIM MSP Post-Initialisation. More...
 
void HAL_MspInit (void)
 Initialis the Global MSP.
 
void HAL_ADC_MspInit (ADC_HandleTypeDef *hadc)
 ADC MSP Initialisation. More...
 
void HAL_ADC_MspDeInit (ADC_HandleTypeDef *hadc)
 ADC MSP De-Initialisation. More...
 
void HAL_I2C_MspInit (I2C_HandleTypeDef *hi2c)
 I2C MSP Initialisation. More...
 
void HAL_I2C_MspDeInit (I2C_HandleTypeDef *hi2c)
 I2C MSP De-Initialisation. More...
 
void HAL_SPI_MspInit (SPI_HandleTypeDef *hspi)
 SPI MSP Initialisation. More...
 
void HAL_SPI_MspDeInit (SPI_HandleTypeDef *hspi)
 SPI MSP De-Initialisation. More...
 
void HAL_TIM_Base_MspInit (TIM_HandleTypeDef *htim_base)
 TIM_Base MSP Initialisation. More...
 
void HAL_TIM_Base_MspDeInit (TIM_HandleTypeDef *htim_base)
 TIM_Base MSP De-Initialisation. More...
 
void HAL_RTC_MspInit (RTC_HandleTypeDef *hrtc)
 RTC MSP Initialisation. More...
 
void HAL_RTC_MspDeInit (RTC_HandleTypeDef *hrtc)
 RTC MSP De-Initialisation. More...
 
HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority)
 This function configures the TIM4 as a time base source. The time source is configured to have 1ms time base with a dedicated Tick interrupt priority. More...
 
void HAL_SuspendTick (void)
 Suspend Tick increment. More...
 
void HAL_ResumeTick (void)
 Resume Tick increment. More...
 
void NMI_Handler (void)
 Non-maskable interrupt handler.
 
void HardFault_Handler (void)
 Hard fault handler.
 
void MemManage_Handler (void)
 Memory management fault handler.
 
void BusFault_Handler (void)
 Prefetch fault, memory access fault handler.
 
void UsageFault_Handler (void)
 Undefined instruction or illegal state handler.
 
void DebugMon_Handler (void)
 Debug monitor handler.
 
void ADC1_2_IRQHandler (void)
 ADC1 and ADC2 global interrupt handler.
 
void TIM4_IRQHandler (void)
 TIM4 global interrupt handler.
 
void I2C2_EV_IRQHandler (void)
 I2C2 event interrupt handler.
 
void I2C2_ER_IRQHandler (void)
 I2C2 error interrupt handler.
 
void SPI1_IRQHandler (void)
 SPI1 global interrupt handler.
 
void RTC_IRQHandler (void)
 This function handles RTC global interrupt.
 

Variables

ADC_HandleTypeDef hadc1
 ADC 1 handle.
 
I2C_HandleTypeDef hi2c2
 I²C 2 handle.
 
SPI_HandleTypeDef hspi1
 SPI 1 handle.
 
RTC_HandleTypeDef hrtc
 RTC handle.
 
TIM_HandleTypeDef htim1
 Timer 1 handle.
 
TIM_HandleTypeDef htim4
 Timer 4 handle (Sys-Tick)
 

Detailed Description

STM32F103C8T6 system initialisation.

Definition in file System.c.

Function Documentation

◆ HAL_ADC_MspDeInit()

void HAL_ADC_MspDeInit ( ADC_HandleTypeDef *  hadc)

ADC MSP De-Initialisation.

Parameters
hadcADC handle pointer

Definition at line 499 of file System.c.

◆ HAL_ADC_MspInit()

void HAL_ADC_MspInit ( ADC_HandleTypeDef *  hadc)

ADC MSP Initialisation.

Parameters
hadcADC handle pointer

Definition at line 469 of file System.c.

◆ HAL_I2C_MspDeInit()

void HAL_I2C_MspDeInit ( I2C_HandleTypeDef *  hi2c)

I2C MSP De-Initialisation.

Parameters
hi2cI2C handle pointer

Definition at line 554 of file System.c.

◆ HAL_I2C_MspInit()

void HAL_I2C_MspInit ( I2C_HandleTypeDef *  hi2c)

I2C MSP Initialisation.

Parameters
hi2cI2C handle pointer

Definition at line 522 of file System.c.

◆ HAL_InitTick()

HAL_StatusTypeDef HAL_InitTick ( uint32_t  TickPriority)

This function configures the TIM4 as a time base source. The time source is configured to have 1ms time base with a dedicated Tick interrupt priority.

Note
This function is called automatically at the beginning of program after reset by HAL_Init() or at any time when clock is configured, by HAL_RCC_ClockConfig().
Parameters
TickPriorityTick interrupt priority.
Return values
HALstatus

Definition at line 731 of file System.c.

◆ HAL_ResumeTick()

void HAL_ResumeTick ( void  )

Resume Tick increment.

Note
Enable the tick increment by Enabling TIM4 update interrupt.

Definition at line 797 of file System.c.

◆ HAL_RTC_MspDeInit()

void HAL_RTC_MspDeInit ( RTC_HandleTypeDef *  hrtc)

RTC MSP De-Initialisation.

Parameters
hrtcRTC handle pointer

Definition at line 709 of file System.c.

◆ HAL_RTC_MspInit()

void HAL_RTC_MspInit ( RTC_HandleTypeDef *  hrtc)

RTC MSP Initialisation.

Parameters
hrtcRTC handle pointer

Definition at line 687 of file System.c.

◆ HAL_SPI_MspDeInit()

void HAL_SPI_MspDeInit ( SPI_HandleTypeDef *  hspi)

SPI MSP De-Initialisation.

Parameters
hspiSPI handle pointer

Definition at line 615 of file System.c.

◆ HAL_SPI_MspInit()

void HAL_SPI_MspInit ( SPI_HandleTypeDef *  hspi)

SPI MSP Initialisation.

Parameters
hspiSPI handle pointer

Definition at line 578 of file System.c.

◆ HAL_SuspendTick()

void HAL_SuspendTick ( void  )

Suspend Tick increment.

Note
Disable the tick increment by disabling TIM4 update interrupt.

Definition at line 787 of file System.c.

◆ HAL_TIM_Base_MspDeInit()

void HAL_TIM_Base_MspDeInit ( TIM_HandleTypeDef *  htim_base)

TIM_Base MSP De-Initialisation.

Parameters
htim_baseTIM_Base handle pointer

Definition at line 674 of file System.c.

◆ HAL_TIM_Base_MspInit()

void HAL_TIM_Base_MspInit ( TIM_HandleTypeDef *  htim_base)

TIM_Base MSP Initialisation.

Parameters
htim_baseTIM_Base handle pointer

Definition at line 639 of file System.c.

◆ HAL_TIM_MspPostInit()

void HAL_TIM_MspPostInit ( TIM_HandleTypeDef *  htim)

TIM MSP Post-Initialisation.

Parameters
htimTIM handle pointer

Definition at line 652 of file System.c.

Here is the caller graph for this function:

◆ HAL_TIM_PeriodElapsedCallback()

void HAL_TIM_PeriodElapsedCallback ( TIM_HandleTypeDef *  htim)

Period elapsed callback in non blocking mode.

Note
This function is called when TIM4 interrupt took place, inside HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment a global variable "uwTick" used as application time base.
Parameters
htim: TIM handle
Return values
None

Definition at line 68 of file System.c.

◆ System_ADC1_Init()

static int System_ADC1_Init ( void  )
static

ADC 1 Initialisation Function.

Returns
Error code
Return values
0OK
-1Error

Definition at line 289 of file System.c.

Here is the caller graph for this function:

◆ System_I2C2_Init()

static int System_I2C2_Init ( void  )
static

I²C 2 Initialisation Function.

Returns
Error code
Return values
0OK
-1Error

Definition at line 352 of file System.c.

Here is the caller graph for this function:

◆ System_Init()

int System_Init ( void  )

System Initialisation Function.

Returns
Error code
Return values
0OK
-1Error

Initialises the CPU, AHB and APB busses clocks

Definition at line 82 of file System.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ System_RTC_Init()

static int System_RTC_Init ( void  )
static

RTC Initialisation Function.

Returns
Error code
Return values
0OK
-1Error

Definition at line 408 of file System.c.

Here is the caller graph for this function:

◆ System_SPI1_Init()

static int System_SPI1_Init ( void  )
static

SPI 1 Initialisation Function.

Returns
Error code
Return values
0OK
-1Error

Definition at line 378 of file System.c.

Here is the caller graph for this function:

◆ System_TIM1_Init()

static int System_TIM1_Init ( void  )
static

Timer 1 Initialisation Function.

Returns
Error code
Return values
0OK
-1Error

Definition at line 210 of file System.c.

Here is the call graph for this function:
Here is the caller graph for this function: