[GH-ISSUE #683] Ability to read register, apply logical operation (specifically OR) and write Register #606

Closed
opened 2026-02-26 00:33:06 +03:00 by kerem · 2 comments
Owner

Originally created by @SirLugash on GitHub (May 11, 2019).
Original GitHub issue: https://github.com/hirschmann/nbfc/issues/683

Is your feature request related to a problem? Please describe.
I'm about to create a config for my Asus Eee PC 1015PN as it's fan would always run at max speed. I was able to figure out the relevant registers. However the EC has automatic firmware control over the fan unless a flag in a certain register is set. Switching the flag allows to change the fan speed target which allows the fan to run at lower speeds. Since it's only a single bit that needs to be changed, the read value needs an OR operation to set the right flag without changing any other flags of which I don't know what they do.

Describe the solution you'd like
Implementation of a special sequence that realizes the above. Let user set the register to be read, the logical operation and the value to use in that operation.
Example for my config:

  • Register: D3 (211)
  • Logical Operation: OR
  • Bit mask: 0x02
    The operation would make sure that the second bit of the register is set to 1, thereby enabling manual mode, without interfering with any other flag in that register.

Additionally, allow the register/flag to be read with every poll or another period of time in case the EC resets the flag for some reason. Read value, check if the flag is set. If not, calculate new value and write register.

Additional context
Currently, in order to use Notebook FanControl on my Eee PC, I have to enable manual mode by hand every time I'm booting Windows. This could potentially be reduced to a script automatically running at startup, however having that feature built into NBFC would mean I could have all relevant things in this one application and wouldn't need a second one.

Originally created by @SirLugash on GitHub (May 11, 2019). Original GitHub issue: https://github.com/hirschmann/nbfc/issues/683 **Is your feature request related to a problem? Please describe.** I'm about to create a config for my Asus Eee PC 1015PN as it's fan would always run at max speed. I was able to figure out the relevant registers. However the EC has automatic firmware control over the fan unless a flag in a certain register is set. Switching the flag allows to change the fan speed target which allows the fan to run at lower speeds. Since it's only a single bit that needs to be changed, the read value needs an OR operation to set the right flag without changing any other flags of which I don't know what they do. **Describe the solution you'd like** Implementation of a special sequence that realizes the above. Let user set the register to be read, the logical operation and the value to use in that operation. Example for my config: - Register: D3 (211) - Logical Operation: OR - Bit mask: 0x02 The operation would make sure that the second bit of the register is set to 1, thereby enabling manual mode, without interfering with any other flag in that register. Additionally, allow the register/flag to be read with every poll or another period of time in case the EC resets the flag for some reason. Read value, check if the flag is set. If not, calculate new value and write register. **Additional context** Currently, in order to use Notebook FanControl on my Eee PC, I have to enable manual mode by hand every time I'm booting Windows. This could potentially be reduced to a script automatically running at startup, however having that feature built into NBFC would mean I could have all relevant things in this one application and wouldn't need a second one.
kerem closed this issue 2026-02-26 00:33:06 +03:00
Author
Owner

@hirschmann commented on GitHub (May 12, 2019):

NBFc already supports setting bit flags as explained here: https://github.com/hirschmann/nbfc/wiki/Register-write-configuration

In your case the settings could look like this:

<RegisterWriteConfiguration>
  <Description>Enable manual control mode</Description>
  <WriteOccasion>OnInitialization</WriteOccasion>
  <WriteMode>Or</WriteMode>  
  <Register>211</Register>
  <Value>2</Value>
  <ResetRequired>true</ResetRequired>
  <ResetWriteMode>And</ResetWriteMode>
  <ResetValue>253</ResetValue>
</RegisterWriteConfiguration>

WriteMode is marked as deprecated because I want to implement an easier way of setting bit flags, which will look like this:

<RegisterWriteConfiguration>
  <Description>Enable manual control mode</Description>
  <WriteOccasion>OnInitialization</WriteOccasion>
  <Register>211</Register>
  <Value>0b------1-</Value>
  <ResetRequired>true</ResetRequired>
  <ResetValue>0b------0-</ResetValue>
</RegisterWriteConfiguration>

This way, you can set a value to a specific bit and mark all bits which should be left unchanged with - ("don't care").

<!-- gh-comment-id:491589677 --> @hirschmann commented on GitHub (May 12, 2019): NBFc already supports setting bit flags as explained here: https://github.com/hirschmann/nbfc/wiki/Register-write-configuration In your case the settings could look like this: ```xml <RegisterWriteConfiguration> <Description>Enable manual control mode</Description> <WriteOccasion>OnInitialization</WriteOccasion> <WriteMode>Or</WriteMode> <Register>211</Register> <Value>2</Value> <ResetRequired>true</ResetRequired> <ResetWriteMode>And</ResetWriteMode> <ResetValue>253</ResetValue> </RegisterWriteConfiguration> ``` WriteMode is marked as deprecated because I want to implement an easier way of setting bit flags, which will look like this: ```xml <RegisterWriteConfiguration> <Description>Enable manual control mode</Description> <WriteOccasion>OnInitialization</WriteOccasion> <Register>211</Register> <Value>0b------1-</Value> <ResetRequired>true</ResetRequired> <ResetValue>0b------0-</ResetValue> </RegisterWriteConfiguration> ``` This way, you can set a value to a specific bit and mark all bits which should be left unchanged with `-` ("don't care").
Author
Owner

@SirLugash commented on GitHub (May 15, 2019):

Thank you so much for your reply, it works almost perfectly. A little issue I noticed is that whenever I open the updated config, the ResetWriteMode will be changed to Set rather than And and it appears that closing the application also doesn't reset the control mode (the fan would go to max speed again). Either way this works for me, thank you!

<!-- gh-comment-id:492711751 --> @SirLugash commented on GitHub (May 15, 2019): Thank you so much for your reply, it works almost perfectly. A little issue I noticed is that whenever I open the updated config, the ResetWriteMode will be changed to Set rather than And and it appears that closing the application also doesn't reset the control mode (the fan would go to max speed again). Either way this works for me, thank you!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nbfc-hirschmann#606
No description provided.