rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
shared_params.h
Go to the documentation of this file.
1/************************************************************************************//**
2* \file Demo/ARMCM4_STM32F4_Nucleo_F429ZI_GCC/Prog/shared_params.h
3* \brief Shared RAM parameters header file.
4* \ingroup Prog_ARMCM4_STM32F4_Nucleo_F429ZI_GCC
5* \internal
6*----------------------------------------------------------------------------------------
7* C O P Y R I G H T
8*----------------------------------------------------------------------------------------
9* Copyright (c) 2021 by Feaser http://www.feaser.com All rights reserved
10*
11*----------------------------------------------------------------------------------------
12* L I C E N S E
13*----------------------------------------------------------------------------------------
14* This file is part of OpenBLT. OpenBLT is free software: you can redistribute it and/or
15* modify it under the terms of the GNU General Public License as published by the Free
16* Software Foundation, either version 3 of the License, or (at your option) any later
17* version.
18*
19* OpenBLT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
20* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
21* PURPOSE. See the GNU General Public License for more details.
22*
23* You have received a copy of the GNU General Public License along with OpenBLT. It
24* should be located in ".\Doc\license.html". If not, contact Feaser to obtain a copy.
25*
26* \endinternal
27****************************************************************************************/
28#ifndef SHARED_PARAMS_H
29#define SHARED_PARAMS_H
30
31/****************************************************************************************
32* Include files
33****************************************************************************************/
34#include <stdint.h> /* Standard integer types. */
35#include <stdbool.h> /* Standard boolean types. */
36
37
38/****************************************************************************************
39* Configuration macros
40****************************************************************************************/
41/** \brief Configuration macro for specifying the size of the data inside the parameter
42 * buffer. This is the length in bytes of the actual parameter data, so
43 * excluding the bufferId and checksum.
44 */
45#define SHARED_PARAMS_CFG_BUFFER_DATA_LEN (16 - 4 - 2)
46
47/* TODO: add enum with shared parameters idx/offset to avoid magic numbers in Read/Write calls */
48
49
50/****************************************************************************************
51* Function prototypes
52****************************************************************************************/
53void SharedParamsInit(void);
54bool SharedParamsReadByIndex(uint32_t idx, uint8_t * value);
55bool SharedParamsWriteByIndex(uint32_t idx, uint8_t value);
56
57
58#endif /* SHARED_PARAMS_H */
59/*********************************** end of shared_params.h ****************************/
bool SharedParamsWriteByIndex(uint32_t idx, uint8_t value)
Writes a data byte to the shared parameter buffer at the specified index.
void SharedParamsInit(void)
Initializes the shared RAM parameters module.
bool SharedParamsReadByIndex(uint32_t idx, uint8_t *value)
Reads a data byte from the shared parameter buffer at the specified index.