Skip to content

Add MAX11609 voltage monitoring support to RTM Lamp#228

Merged
joao-victor-s merged 1 commit intomasterfrom
rtm-lamp-voltage-mon
Apr 23, 2025
Merged

Add MAX11609 voltage monitoring support to RTM Lamp#228
joao-victor-s merged 1 commit intomasterfrom
rtm-lamp-voltage-mon

Conversation

@joao-victor-s
Copy link

This commit adds voltage monitoring capability to the RTM Lamp by introducing the MODULE_MAX11609 module, which integrates with the max116xx driver.

A new task, vTaskMAX11609, was created to iterate through the SDR table and measure sensor voltages for entries associated with the MAX11609. The task identifies relevant sensors by comparing their task_handle to its own and updates their readout_value field accordingly.

Comment on lines +646 to +656
.nominal_reading = (12000 >> 6), /* Nominal reading [(M * x + B * 10^(B_exp)) * 10^(R_exp)] = 12.032 V */
.normal_max = (13000 >> 6), /* Normal maximum = 12.544 V */
.normal_min = (11000 >> 6), /* Normal minimum = 11.456 V */
.sensor_max_reading = 0xFF, /* Sensor Maximum reading */
.sensor_min_reading = 0x00, /* Sensor Minimum reading */
.upper_nonrecover_thr = (16000 >> 6), /* Upper non-recoverable Threshold = 13.056 V */
.upper_critical_thr = (15000 >> 6), /* Upper critical Threshold = 12.608 V */
.upper_noncritical_thr = (14000 >> 6), /* Upper non critical Threshold = 12.48 V */
.lower_nonrecover_thr = (8000 >> 6), /* Lower non-recoverable Threshold = 11.008 V */
.lower_critical_thr = (9000 >> 6), /* Lower critical Threshold = 11.392 V */
.lower_noncritical_thr = (10000 >> 6), /* Lower non-critical Threshold = 11.52 V */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the comments to reflect the threshold values.

#define tskMAX6642SENSOR_PRIORITY (tskIDLE_PRIORITY+3)
#define tskINA220SENSOR_PRIORITY (tskIDLE_PRIORITY+3)
#define tskINA3221SENSOR_PRIORITY (tskIDLE_PRIORITY+3)
#define tskMAX11609SENSOR_PRIORITY (tskIDLE_PRIORITY+3)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: remove extra space to maintain alignment.

Comment on lines +24 to +31
/**
* @brief Monitoring task for LM75 sensor
*
* This task unblocks after every #LM75_UPDATE_RATE ms and updates the read from all the LM75 sensors listed in this module's SDR table
*
* @param Parameters Pointer to parameter list passed to task upon initialization (not used here)
*/
void vTaskMAX11609();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the comment here. Also, add a parameter void * param to the list of arguments (even if it is not used).

/**
* @brief Rate at which the MAX11609 sensors are read (in ms)
*/
#define MAX11609_UPDATE_RATE 2000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this delay to 200 ms. Technically this is not an 'update rate' but an update period (this should be fixed in other sensor reading tasks in the future).

@joao-victor-s joao-victor-s force-pushed the rtm-lamp-voltage-mon branch 3 times, most recently from b57169b to f5e9370 Compare April 23, 2025 13:44
This commit adds voltage monitoring capability to the RTM Lamp by
introducing the MODULE_MAX11609 module, which integrates with the
max116xx driver.

A new task, vTaskMAX11609, was created to iterate through the SDR table
and measure sensor voltages for entries associated with the MAX11609.
The task identifies relevant sensors by comparing their task_handle to
its own and updates their readout_value field accordingly.
@joao-victor-s joao-victor-s merged commit 001e99e into master Apr 23, 2025
7 checks passed
@joao-victor-s joao-victor-s deleted the rtm-lamp-voltage-mon branch April 23, 2025 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants