Zephyr Project API 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Maxim MAX31790 6-channel I2C-bus PWM controller. More...

Files

file  max31790.h
 Header file for MAX31790 PWM driver.
 

Macros

#define PWM_MAX31790_FLAG_SPIN_UP   (1 << PWM_MAX31790_FLAG_SPIN_UP_POS)
 Activate spin up for fan.
 

Custom PWM flags for MAX31790

These flags can be used with the PWM API in the upper 8 bits of pwm_flags_t They allow the usage of the RPM mode, which will cause the MAX31790 to measure the actual speed of the fan and automatically control it to the desired speed.

#define PWM_MAX31790_FLAG_RPM_MODE   (1 << PWM_MAX31790_FLAG_RPM_MODE_POS)
 RPM mode.
 

Speed range of fan

This represents a multiplier for the TACH count and should be chosen depending on the nominal RPM of the fan.

A detailed table on how to choose a proper value can be found in the datasheet of the MAX31790.

#define PWM_MAX31790_FLAG_SPEED_RANGE_1   (0 << PWM_MAX31790_FLAG_SPEED_RANGE_POS)
 1 TACH period (best for low-speed fans).
 
#define PWM_MAX31790_FLAG_SPEED_RANGE_2   (1 << PWM_MAX31790_FLAG_SPEED_RANGE_POS)
 2 TACH periods
 
#define PWM_MAX31790_FLAG_SPEED_RANGE_4   (2 << PWM_MAX31790_FLAG_SPEED_RANGE_POS)
 4 TACH periods
 
#define PWM_MAX31790_FLAG_SPEED_RANGE_8   (3 << PWM_MAX31790_FLAG_SPEED_RANGE_POS)
 8 TACH periods
 
#define PWM_MAX31790_FLAG_SPEED_RANGE_16   (4 << PWM_MAX31790_FLAG_SPEED_RANGE_POS)
 16 TACH periods
 
#define PWM_MAX31790_FLAG_SPEED_RANGE_32   (5 << PWM_MAX31790_FLAG_SPEED_RANGE_POS)
 32 TACH periods (best for high-speed fans).
 

PWM rate of change

Configures the internal control loop of the fan.

Details about these values can be found in the datasheet of the MAX31790.

#define PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_0   (0 << PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_POS)
 Fastest rate of change (0ms per step in PWM mode).
 
#define PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_1   (1 << PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_POS)
 Fast rate of change (1.953125 ms per step).
 
#define PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_2   (2 << PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_POS)
 Medium-fast rate of change (3.90625 ms per step).
 
#define PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_3   (3 << PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_POS)
 Medium rate of change (7.8125 ms per step).
 
#define PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_4   (4 << PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_POS)
 Medium-slow rate of change (15.625 ms per step).
 
#define PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_5   (5 << PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_POS)
 Slow rate of change (31.25 ms per step).
 
#define PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_6   (6 << PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_POS)
 Very slow rate of change (62.5 ms per step).
 
#define PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_7   (7 << PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_POS)
 Ultra-slow rate of change (125 ms per step).
 

Detailed Description

Maxim MAX31790 6-channel I2C-bus PWM controller.

Macro Definition Documentation

◆ PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_0

#define PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_0   (0 << PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_POS)

#include <include/zephyr/drivers/pwm/max31790.h>

Fastest rate of change (0ms per step in PWM mode).

◆ PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_1

#define PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_1   (1 << PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_POS)

#include <include/zephyr/drivers/pwm/max31790.h>

Fast rate of change (1.953125 ms per step).

◆ PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_2

#define PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_2   (2 << PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_POS)

#include <include/zephyr/drivers/pwm/max31790.h>

Medium-fast rate of change (3.90625 ms per step).

◆ PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_3

#define PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_3   (3 << PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_POS)

#include <include/zephyr/drivers/pwm/max31790.h>

Medium rate of change (7.8125 ms per step).

◆ PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_4

#define PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_4   (4 << PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_POS)

#include <include/zephyr/drivers/pwm/max31790.h>

Medium-slow rate of change (15.625 ms per step).

◆ PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_5

#define PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_5   (5 << PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_POS)

#include <include/zephyr/drivers/pwm/max31790.h>

Slow rate of change (31.25 ms per step).

◆ PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_6

#define PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_6   (6 << PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_POS)

#include <include/zephyr/drivers/pwm/max31790.h>

Very slow rate of change (62.5 ms per step).

◆ PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_7

#define PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_7   (7 << PWM_MAX31790_FLAG_PWM_RATE_OF_CHANGE_POS)

#include <include/zephyr/drivers/pwm/max31790.h>

Ultra-slow rate of change (125 ms per step).

◆ PWM_MAX31790_FLAG_RPM_MODE

#define PWM_MAX31790_FLAG_RPM_MODE   (1 << PWM_MAX31790_FLAG_RPM_MODE_POS)

#include <include/zephyr/drivers/pwm/max31790.h>

RPM mode.

Activating the RPM mode will cause the parameter pulse of pwm_set_cycles to be interpreted as TACH target count. This basically is the number of internal pulses which occur during each TACH period. Hence, a bigger value means a slower rotation of the fan. The details about the TACH target count has to be calculated can be taken from the datasheet of the MAX31790.

◆ PWM_MAX31790_FLAG_SPEED_RANGE_1

#define PWM_MAX31790_FLAG_SPEED_RANGE_1   (0 << PWM_MAX31790_FLAG_SPEED_RANGE_POS)

#include <include/zephyr/drivers/pwm/max31790.h>

1 TACH period (best for low-speed fans).

◆ PWM_MAX31790_FLAG_SPEED_RANGE_16

#define PWM_MAX31790_FLAG_SPEED_RANGE_16   (4 << PWM_MAX31790_FLAG_SPEED_RANGE_POS)

#include <include/zephyr/drivers/pwm/max31790.h>

16 TACH periods

◆ PWM_MAX31790_FLAG_SPEED_RANGE_2

#define PWM_MAX31790_FLAG_SPEED_RANGE_2   (1 << PWM_MAX31790_FLAG_SPEED_RANGE_POS)

#include <include/zephyr/drivers/pwm/max31790.h>

2 TACH periods

◆ PWM_MAX31790_FLAG_SPEED_RANGE_32

#define PWM_MAX31790_FLAG_SPEED_RANGE_32   (5 << PWM_MAX31790_FLAG_SPEED_RANGE_POS)

#include <include/zephyr/drivers/pwm/max31790.h>

32 TACH periods (best for high-speed fans).

◆ PWM_MAX31790_FLAG_SPEED_RANGE_4

#define PWM_MAX31790_FLAG_SPEED_RANGE_4   (2 << PWM_MAX31790_FLAG_SPEED_RANGE_POS)

#include <include/zephyr/drivers/pwm/max31790.h>

4 TACH periods

◆ PWM_MAX31790_FLAG_SPEED_RANGE_8

#define PWM_MAX31790_FLAG_SPEED_RANGE_8   (3 << PWM_MAX31790_FLAG_SPEED_RANGE_POS)

#include <include/zephyr/drivers/pwm/max31790.h>

8 TACH periods

◆ PWM_MAX31790_FLAG_SPIN_UP

#define PWM_MAX31790_FLAG_SPIN_UP   (1 << PWM_MAX31790_FLAG_SPIN_UP_POS)

#include <include/zephyr/drivers/pwm/max31790.h>

Activate spin up for fan.

This activates the spin up of the fan, which means that the controller will force the fan to maximum speed for a startup from a completely stopped state.