NNP STM Generic Remote Module git-main
Loading...
Searching...
No Matches
main.c File Reference

: Main program body More...

#include "main.h"
#include "eedata.h"
#include "acceltemp.h"
#include "app.h"

Go to the source code of this file.

Functions

void SystemClock_Config (void)
 System Clock Configuration.
 
void initNodeIDSerialNumber (void)
 Initializes node ID and serial number data in the object dictionary.
 
void ReadMemory (void)
 Command processor to let CE read various memory locations.
 
UNS8 ReadLocalFlashMemory (void)
 Read flash memory in CPU.
 
UNS8 ReadEEProm (void)
 used with handshake through the OD at 0x2020 to allow remote reading of values in the emulated eeprom memory
 
UNS8 WriteEEProm (void)
 used with handshake through the OD at 0x2020 to allow remote writing of a single value in the emulated eeprom memory
 
void start_callback (CO_Data *d, UNS32 id)
 Callback that runs at the beginning of timer execution.
 
int main (void)
 The application entry point.
 
void Error_Handler (void)
 This function is executed in case of error occurrence.
 

Variables

ADC_HandleTypeDef hadc1
 
DMA_HandleTypeDef hdma_adc1
 
CAN_HandleTypeDef hcan1
 
I2C_HandleTypeDef hi2c2
 
TIM_HandleTypeDef htim2
 
CAN_FilterTypeDef sFilterConfig
 
CAN_RxHeaderTypeDef RxHeader
 
CAN_TxHeaderTypeDef TxHeader
 
CAN_TxHeaderTypeDef TxHeaderSDO
 
CAN_TxHeaderTypeDef TxHeaderPDO
 
CAN_TxHeaderTypeDef TxHeaderScan
 
uint8_t RxData [8]
 
uint8_t TxData [8]
 
uint8_t TxDataSDO [8]
 
uint8_t TxDataPDO [8]
 
uint8_t TxDataScan [8]
 
uint32_t TxMailbox
 
UNS16 blink = 0
 
UNS8 lastRequestedAddress = 0
 

Detailed Description

: Main program body

Attention

Copyright (c) 2024 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file main.c.

Macro Definition Documentation

◆ CO_ENABLE_LSS

#define CO_ENABLE_LSS

Definition at line 38 of file main.c.

Function Documentation

◆ Error_Handler()

void Error_Handler ( void )

This function is executed in case of error occurrence.

Return values
None

Definition at line 673 of file main.c.

Referenced by HAL_ADC_MspInit(), HAL_I2C_MspInit(), and SystemClock_Config().

Here is the caller graph for this function:

◆ initNodeIDSerialNumber()

void initNodeIDSerialNumber ( void )

Initializes node ID and serial number data in the object dictionary.

Definition at line 110 of file main.c.

Referenced by main().

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

◆ main()

int main ( void )

The application entry point.

Return values
int

Definition at line 130 of file main.c.

Here is the call graph for this function:

◆ ReadEEProm()

UNS8 ReadEEProm ( void )

used with handshake through the OD at 0x2020 to allow remote reading of values in the emulated eeprom memory

Definition at line 617 of file main.c.

Referenced by ReadMemory().

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

◆ ReadLocalFlashMemory()

UNS8 ReadLocalFlashMemory ( void )

Read flash memory in CPU.

Parameters
none

Definition at line 587 of file main.c.

Referenced by ReadMemory().

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

◆ ReadMemory()

void ReadMemory ( void )

Command processor to let CE read various memory locations.

Parameters
none

Definition at line 566 of file main.c.

Referenced by main().

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

◆ start_callback()

void start_callback ( CO_Data * d,
UNS32 id )

Callback that runs at the beginning of timer execution.

Definition at line 102 of file main.c.

Here is the call graph for this function:

◆ SystemClock_Config()

void SystemClock_Config ( void )

System Clock Configuration.

Return values
None

Configure the main internal regulator output voltage

Initializes the RCC Oscillators according to the specified parameters in the RCC_OscInitTypeDef structure.

Initializes the CPU, AHB and APB buses clocks

Definition at line 217 of file main.c.

Referenced by main().

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

◆ WriteEEProm()

UNS8 WriteEEProm ( void )

used with handshake through the OD at 0x2020 to allow remote writing of a single value in the emulated eeprom memory

Definition at line 648 of file main.c.

Referenced by ReadMemory().

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

Variable Documentation

◆ blink

UNS16 blink = 0

Definition at line 73 of file main.c.

◆ hadc1

ADC_HandleTypeDef hadc1

Definition at line 48 of file main.c.

◆ hcan1

CAN_HandleTypeDef hcan1

Definition at line 51 of file main.c.

◆ hdma_adc1

DMA_HandleTypeDef hdma_adc1

Definition at line 49 of file main.c.

◆ hi2c2

I2C_HandleTypeDef hi2c2

Definition at line 53 of file main.c.

◆ htim2

TIM_HandleTypeDef htim2

Definition at line 55 of file main.c.

◆ lastRequestedAddress

UNS8 lastRequestedAddress = 0

Definition at line 74 of file main.c.

◆ RxData

uint8_t RxData[8]

Definition at line 65 of file main.c.

◆ RxHeader

CAN_RxHeaderTypeDef RxHeader

Definition at line 59 of file main.c.

◆ sFilterConfig

CAN_FilterTypeDef sFilterConfig

Definition at line 58 of file main.c.

◆ TxData

uint8_t TxData[8]

Definition at line 66 of file main.c.

◆ TxDataPDO

uint8_t TxDataPDO[8]

Definition at line 68 of file main.c.

◆ TxDataScan

uint8_t TxDataScan[8]

Definition at line 69 of file main.c.

◆ TxDataSDO

uint8_t TxDataSDO[8]

Definition at line 67 of file main.c.

◆ TxHeader

CAN_TxHeaderTypeDef TxHeader

Definition at line 60 of file main.c.

◆ TxHeaderPDO

CAN_TxHeaderTypeDef TxHeaderPDO

Definition at line 62 of file main.c.

◆ TxHeaderScan

CAN_TxHeaderTypeDef TxHeaderScan

Definition at line 63 of file main.c.

◆ TxHeaderSDO

CAN_TxHeaderTypeDef TxHeaderSDO

Definition at line 61 of file main.c.

◆ TxMailbox

uint32_t TxMailbox

Definition at line 71 of file main.c.