This demo (temperatureSensorDemo directory) shows how to communicate with the on-board EMC1413 temperature module on Ti375C529. The demo prints out the temperature of the device every few seconds and alerts user if the temperature exceeds the high-temperature limit. Also, you can enable an extended range of temperature measurements to measure the temperature from -64°C to +191°C. Additonally, you can configure the high or low-temperature limit.
For more detail of the driver, refer to Temperature Sensor Driver
By default, newlib-nano is used for this demo.
The following parameters allow the user to configure the temperature sensor behavior in userDef.h:
Extended Range
| Macro | Default | Description |
|---|---|---|
| EXTENDED_RANGE_ENABLED | 0 | 0 = Standard range (0°C to +127°C) 1 = Extended range (-64°C to +191°C) |
Temperature Limit Configuration
| Macro | Default | Description |
|---|---|---|
| HIGH_TEMPERATURE_LIMIT_VALUE_INT | 85 | High temperature limit for internal sensor (EMC1413 itself) |
| LOW_TEMPERATURE_LIMIT_VALUE_INT | 0 | Low temperature limit for internal sensor (EMC1413 itself) |
| HIGH_TEMPERATURE_LIMIT_VALUE_EXT1 | 85 | High temperature limit for external sensor 1 |
| LOW_TEMPERATURE_LIMIT_VALUE_EXT1 | 0 | Low temperature limit for external sensor 1 |
| HIGH_TEMPERATURE_LIMIT_VALUE_EXT2 | 85 | High temperature limit for external sensor 2 |
| LOW_TEMPERATURE_LIMIT_VALUE_EXT2 | 0 | Low temperature limit for external sensor 2 |
The active debug mode is configured in userDef.h.
By default, this demo enables logging for main.c, system, and interrupt request modules based on DEBUG_Const, with ACTIVE_MIN_LVL set to DBG_LVL_ALL.
Debug Mode
| Macro | Default | Description |
|---|---|---|
| DEBUG_MODE | 1 | 0 = Asserts OFF, logs removed 1 = Asserts ON, logs filtered |
Active Debug Module
Set ACTIVE_DEBUG_MOD to one or more of the following (combine with |):
Please refer to DEBUG_Const for more detail on Debug Modules.
Active Minimum Log Level
Set ACTIVE_MIN_LVL to filter the minimum log severity shown:
| Value | Level | Description |
|---|---|---|
| DBG_LVL_ALL | 0 | Show Info, Warn, and Error |
| DBG_LVL_WARN | 1 | Show Warn and Error only |
| DBG_LVL_ERR | 2 | Show Error only |
| DBG_LVL_NONE | 3 | Silence all logs |
Below are the userDef.h:
In userDef.h, the available Temperature Sensor driver are defined as follows:
To switch the Temperature Sensor driver, modify ACTIVE_TEMP_SENSOR_TYPE to the desired type.
Each selection automatically maps to the corresponding TEMP_SENSOR_CTRL(I2C address) and TEMP_SENSOR_DRIVER(Driver implementation).
| ACTIVE_RTC_TYPE | Driver | Description |
|---|---|---|
| SENSOR_TYPE_EMC1413 | EMC1413 | Default on-board (Ti375C529) |
| SENSOR_TYPE_CUSTOM | User-defined | Custom |
To integrate a custom Temperature Sensor driver into the framework, follow these steps:
Step 1 — Align custom driver to the Temperature Sensor framework
Ensure custom driver implements the temp_sensor_api_t interface for seamless integration.
Step 2 — Register custom driver in userDef.h
Uncomment and update the custom driver section:
Step 3 — Select the custom driver
The following shows the expected execution sequence: