Skip to content

Commit

Permalink
Temperature calculations adjusted
Browse files Browse the repository at this point in the history
  • Loading branch information
r0tary committed Dec 17, 2023
1 parent e38e98b commit 3a7ec8a
Show file tree
Hide file tree
Showing 34 changed files with 123,676 additions and 123,455 deletions.
4 changes: 2 additions & 2 deletions IO_MODULE_proj/.settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1666481217191618902" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1419205138182410580" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand All @@ -16,7 +16,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1666481217191618902" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1419205138182410580" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
4 changes: 2 additions & 2 deletions IO_MODULE_proj/.settings/stm32cubeide.project.prefs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
2F62501ED4689FB349E356AB974DBE57=5ADD93A9A92B674B1523BA06E89AD69D
2F62501ED4689FB349E356AB974DBE57=A4FA43B19EA50DBC8DDA532EBCC08E40
635E684B79701B039C64EA45C3F84D30=0D148C9AC6D14B970CBDDD0C52173A7B
66BE74F758C12D739921AEA421D593D3=3
8DF89ED150041C4CBC7CB9A9CAA90856=5ADD93A9A92B674B1523BA06E89AD69D
8DF89ED150041C4CBC7CB9A9CAA90856=A4FA43B19EA50DBC8DDA532EBCC08E40
DC22A860405A8BF2F2C095E5B6529F12=33A644C3FEE93B7A0A5922549BCA4F17
eclipse.preferences.version=1
30 changes: 30 additions & 0 deletions IO_MODULE_proj/Core/Inc/PID0_private.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Academic License - for use in teaching, academic research, and meeting
* course requirements at degree granting institutions only. Not for
* government, commercial, or other organizational use.
*
* File: PID0_private.h
*
* Code generated for Simulink model 'PID0'.
*
* Model version : 1.49
* Simulink Coder version : 23.2 (R2023b) 01-Aug-2023
* C/C++ source code generated on : Sat Dec 9 12:00:31 2023
*
* Target selection: ert.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
* Code generation objectives: Unspecified
* Validation result: Not run
*/

#ifndef RTW_HEADER_PID0_private_h_
#define RTW_HEADER_PID0_private_h_
#include "rtwtypes.h"
#include "PID0_types.h"
#endif /* RTW_HEADER_PID0_private_h_ */

/*
* File trailer for generated code.
*
* [EOF]
*/
31 changes: 31 additions & 0 deletions IO_MODULE_proj/Core/Inc/PID0_types.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Academic License - for use in teaching, academic research, and meeting
* course requirements at degree granting institutions only. Not for
* government, commercial, or other organizational use.
*
* File: PID0_types.h
*
* Code generated for Simulink model 'PID0'.
*
* Model version : 1.49
* Simulink Coder version : 23.2 (R2023b) 01-Aug-2023
* C/C++ source code generated on : Sat Dec 9 12:00:31 2023
*
* Target selection: ert.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
* Code generation objectives: Unspecified
* Validation result: Not run
*/

#ifndef RTW_HEADER_PID0_types_h_
#define RTW_HEADER_PID0_types_h_
/* Forward declaration for rtModel */
typedef struct tag_RTM_PID0_T RT_MODEL_PID0_T;

#endif /* RTW_HEADER_PID0_types_h_ */

/*
* File trailer for generated code.
*
* [EOF]
*/
24 changes: 4 additions & 20 deletions IO_MODULE_proj/Core/Inc/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,10 @@ extern "C" {
void Error_Handler(void);

/* USER CODE BEGIN EFP */
//Holding registers - can be written and read from
static uint16_t Holding_Registers_Database[10]={
0, 0, 0, 0, 0, 0, 0, 0, 0, 296
};

//Input Registers - can only be read
static uint16_t Input_Register_Database[10] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};

//Coil database - 1bit registers, can be written and read from
static uint16_t Holding_Coils_Database[3]={
0b0000000000000000
};

//Input coil database - 1bit registers, can only be read
static uint16_t Input_Coils_Database[3]={
0b0000000000000000, 0b0000000000000000
};

extern uint16_t Holding_Registers_Database[10];
extern uint16_t Input_Registers_Database[10];
extern uint16_t Holding_Coils_Database[3];
extern uint16_t Input_Coils_Database[3];

/* USER CODE END EFP */

Expand Down
160 changes: 160 additions & 0 deletions IO_MODULE_proj/Core/Inc/rtwtypes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
/*
* Academic License - for use in teaching, academic research, and meeting
* course requirements at degree granting institutions only. Not for
* government, commercial, or other organizational use.
*
* File: rtwtypes.h
*
* Code generated for Simulink model 'PID0'.
*
* Model version : 1.49
* Simulink Coder version : 23.2 (R2023b) 01-Aug-2023
* C/C++ source code generated on : Sat Dec 9 12:00:31 2023
*
* Target selection: ert.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
* Code generation objectives: Unspecified
* Validation result: Not run
*/

#ifndef RTWTYPES_H
#define RTWTYPES_H

/* Logical type definitions */
#if (!defined(__cplusplus))
#ifndef false
#define false (0U)
#endif

#ifndef true
#define true (1U)
#endif
#endif

/*=======================================================================*
* Target hardware information
* Device type: Intel->x86-64 (Windows64)
* Number of bits: char: 8 short: 16 int: 32
* long: 32
* native word size: 64
* Byte ordering: LittleEndian
* Signed integer division rounds to: Zero
* Shift right on a signed integer as arithmetic shift: on
*=======================================================================*/

/*=======================================================================*
* Fixed width word size data types: *
* int8_T, int16_T, int32_T - signed 8, 16, or 32 bit integers *
* uint8_T, uint16_T, uint32_T - unsigned 8, 16, or 32 bit integers *
* real32_T, real64_T - 32 and 64 bit floating point numbers *
*=======================================================================*/
typedef signed char int8_T;
typedef unsigned char uint8_T;
typedef short int16_T;
typedef unsigned short uint16_T;
typedef int int32_T;
typedef unsigned int uint32_T;
typedef float real32_T;
typedef double real64_T;

/*===========================================================================*
* Generic type definitions: boolean_T, char_T, byte_T, int_T, uint_T, *
* real_T, time_T, ulong_T. *
*===========================================================================*/
typedef double real_T;
typedef double time_T;
typedef unsigned char boolean_T;
typedef int int_T;
typedef unsigned int uint_T;
typedef unsigned long ulong_T;
typedef char char_T;
typedef unsigned char uchar_T;
typedef char_T byte_T;

/*===========================================================================*
* Complex number type definitions *
*===========================================================================*/
#define CREAL_T

typedef struct {
real32_T re;
real32_T im;
} creal32_T;

typedef struct {
real64_T re;
real64_T im;
} creal64_T;

typedef struct {
real_T re;
real_T im;
} creal_T;

#define CINT8_T

typedef struct {
int8_T re;
int8_T im;
} cint8_T;

#define CUINT8_T

typedef struct {
uint8_T re;
uint8_T im;
} cuint8_T;

#define CINT16_T

typedef struct {
int16_T re;
int16_T im;
} cint16_T;

#define CUINT16_T

typedef struct {
uint16_T re;
uint16_T im;
} cuint16_T;

#define CINT32_T

typedef struct {
int32_T re;
int32_T im;
} cint32_T;

#define CUINT32_T

typedef struct {
uint32_T re;
uint32_T im;
} cuint32_T;

/*=======================================================================*
* Min and Max: *
* int8_T, int16_T, int32_T - signed 8, 16, or 32 bit integers *
* uint8_T, uint16_T, uint32_T - unsigned 8, 16, or 32 bit integers *
*=======================================================================*/
#define MAX_int8_T ((int8_T)(127))
#define MIN_int8_T ((int8_T)(-128))
#define MAX_uint8_T ((uint8_T)(255U))
#define MAX_int16_T ((int16_T)(32767))
#define MIN_int16_T ((int16_T)(-32768))
#define MAX_uint16_T ((uint16_T)(65535U))
#define MAX_int32_T ((int32_T)(2147483647))
#define MIN_int32_T ((int32_T)(-2147483647-1))
#define MAX_uint32_T ((uint32_T)(0xFFFFFFFFU))

/* Block D-Work pointer type */
typedef void * pointer_T;

#endif /* RTWTYPES_H */

/*
* File trailer for generated code.
*
* [EOF]
*/
69 changes: 69 additions & 0 deletions IO_MODULE_proj/Core/Inc/ssd1306_conf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/**
* Private configuration file for the SSD1306 library.
* This example is configured for STM32F0, I2C and including all fonts.
*/

#ifndef __SSD1306_CONF_H__
#define __SSD1306_CONF_H__

// Choose a microcontroller family

#define STM32WB

//#define STM32F0
//#define STM32F1
//#define STM32F4
//#define STM32L0
//#define STM32L1
//#define STM32L4
//#define STM32F3
//#define STM32H7
//#define STM32F7
//#define STM32G0

// Choose a bus
#define SSD1306_USE_I2C
//#define SSD1306_USE_SPI

// I2C Configuration
#define SSD1306_I2C_PORT hi2c1
#define SSD1306_I2C_ADDR (0x3C << 1)

// SPI Configuration
//#define SSD1306_SPI_PORT hspi1
//#define SSD1306_CS_Port OLED_CS_GPIO_Port
//#define SSD1306_CS_Pin OLED_CS_Pin
//#define SSD1306_DC_Port OLED_DC_GPIO_Port
//#define SSD1306_DC_Pin OLED_DC_Pin
//#define SSD1306_Reset_Port OLED_Res_GPIO_Port
//#define SSD1306_Reset_Pin OLED_Res_Pin

// Mirror the screen if needed
// #define SSD1306_MIRROR_VERT
// #define SSD1306_MIRROR_HORIZ

// Set inverse color if needed
// # define SSD1306_INVERSE_COLOR

// Include only needed fonts
#define SSD1306_INCLUDE_FONT_6x8
#define SSD1306_INCLUDE_FONT_7x10
#define SSD1306_INCLUDE_FONT_11x18
#define SSD1306_INCLUDE_FONT_16x26

#define SSD1306_INCLUDE_FONT_16x24

// The width of the screen can be set using this
// define. The default value is 128.
// #define SSD1306_WIDTH 64

// If your screen horizontal axis does not start
// in column 0 you can use this define to
// adjust the horizontal offset
// #define SSD1306_X_OFFSET

// The height can be changed as well if necessary.
// It can be 32, 64 or 128. The default value is 64.
// #define SSD1306_HEIGHT 64

#endif /* __SSD1306_CONF_H__ */
2 changes: 1 addition & 1 deletion IO_MODULE_proj/Core/Src/PID0.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ real_T kD = 0.0;
float rtb_Sum = 0;
real_T PID0_step(io_module_t *IO)
{
uint16_t SetPoint = IO->u16regsHR[SET_POINT_TEMP];
real_T SetPoint = IO->u16regsHR[SET_POINT_TEMP] + 273.15;

real_T Input = SetPoint - (IO->TempRoom + 273.15);
real_T rtb_FilterCoefficient;
Expand Down
Loading

0 comments on commit 3a7ec8a

Please sign in to comment.