mirror of https://github.com/joan2937/pigpio
V69+: BCM2711 PLLD 500->750 MHz Crystal 19.2->54M
This commit is contained in:
parent
b407ab741d
commit
f660834a7a
|
@ -515,9 +515,9 @@ static errInfo_t errInfo[]=
|
||||||
{PI_NOT_SERVO_GPIO , "GPIO is not in use for servo pulses"},
|
{PI_NOT_SERVO_GPIO , "GPIO is not in use for servo pulses"},
|
||||||
{PI_NOT_HCLK_GPIO , "GPIO has no hardware clock"},
|
{PI_NOT_HCLK_GPIO , "GPIO has no hardware clock"},
|
||||||
{PI_NOT_HPWM_GPIO , "GPIO has no hardware PWM"},
|
{PI_NOT_HPWM_GPIO , "GPIO has no hardware PWM"},
|
||||||
{PI_BAD_HPWM_FREQ , "hardware PWM frequency not 1-125M"},
|
{PI_BAD_HPWM_FREQ , "invalid hardware PWM frequency"},
|
||||||
{PI_BAD_HPWM_DUTY , "hardware PWM dutycycle not 0-1M"},
|
{PI_BAD_HPWM_DUTY , "hardware PWM dutycycle not 0-1M"},
|
||||||
{PI_BAD_HCLK_FREQ , "hardware clock frequency not 4689-250M"},
|
{PI_BAD_HCLK_FREQ , "invalid hardware clock frequency"},
|
||||||
{PI_BAD_HCLK_PASS , "need password to use hardware clock 1"},
|
{PI_BAD_HCLK_PASS , "need password to use hardware clock 1"},
|
||||||
{PI_HPWM_ILLEGAL , "illegal, PWM in use for main clock"},
|
{PI_HPWM_ILLEGAL , "illegal, PWM in use for main clock"},
|
||||||
{PI_BAD_DATABITS , "serial data bits not 1-32"},
|
{PI_BAD_DATABITS , "serial data bits not 1-32"},
|
||||||
|
|
24
pigpio.3
24
pigpio.3
|
@ -5585,7 +5585,7 @@ Frequencies above 30MHz are unlikely to work.
|
||||||
.EX
|
.EX
|
||||||
gpio: see description
|
gpio: see description
|
||||||
.br
|
.br
|
||||||
clkfreq: 0 (off) or 4689-250000000 (250M)
|
clkfreq: 0 (off) or 4689-250M (13184-375M for the BCM2711)
|
||||||
.br
|
.br
|
||||||
|
|
||||||
.EE
|
.EE
|
||||||
|
@ -5669,7 +5669,7 @@ main clock defaults to PCM but may be overridden by a call to
|
||||||
.EX
|
.EX
|
||||||
gpio: see description
|
gpio: see description
|
||||||
.br
|
.br
|
||||||
PWMfreq: 0 (off) or 1-125000000 (125M)
|
PWMfreq: 0 (off) or 1-125M (1-187.5M for the BCM2711)
|
||||||
.br
|
.br
|
||||||
PWMduty: 0 (off) to 1000000 (1M)(fully on)
|
PWMduty: 0 (off) to 1000000 (1M)(fully on)
|
||||||
.br
|
.br
|
||||||
|
@ -5726,18 +5726,18 @@ The GPIO must be one of the following.
|
||||||
|
|
||||||
.br
|
.br
|
||||||
The actual number of steps beween off and fully on is the
|
The actual number of steps beween off and fully on is the
|
||||||
integral part of 250 million divided by PWMfreq.
|
integral part of 250M/PWMfreq (375M/PWMfreq for the BCM2711).
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
|
||||||
.br
|
.br
|
||||||
The actual frequency set is 250 million / steps.
|
The actual frequency set is 250M/steps (375M/steps for the BCM2711).
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
|
||||||
.br
|
.br
|
||||||
There will only be a million steps for a PWMfreq of 250.
|
There will only be a million steps for a PWMfreq of 250 (375 for
|
||||||
Lower frequencies will have more steps and higher
|
the BCM2711). Lower frequencies will have more steps and higher
|
||||||
frequencies will have fewer steps. PWMduty is
|
frequencies will have fewer steps. PWMduty is
|
||||||
automatically scaled to take this into account.
|
automatically scaled to take this into account.
|
||||||
|
|
||||||
|
@ -7978,7 +7978,7 @@ A single character, an 8 bit quantity able to store 0-255.
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
|
||||||
.IP "\fBclkfreq\fP: 4689-250M" 0
|
.IP "\fBclkfreq\fP: 4689-250M (13184-375M for the BCM2711)" 0
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
|
||||||
|
@ -7994,6 +7994,8 @@ PI_HW_CLK_MIN_FREQ 4689
|
||||||
.br
|
.br
|
||||||
PI_HW_CLK_MAX_FREQ 250000000
|
PI_HW_CLK_MAX_FREQ 250000000
|
||||||
.br
|
.br
|
||||||
|
PI_HW_CLK_MAX_FREQ_2711 375000000
|
||||||
|
.br
|
||||||
|
|
||||||
.EE
|
.EE
|
||||||
|
|
||||||
|
@ -9057,7 +9059,7 @@ PI_HW_PWM_RANGE 1000000
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
|
||||||
.IP "\fBPWMfreq\fP: 5-250K" 0
|
.IP "\fBPWMfreq\fP: 1-125M (1-187.5M for the BCM2711)" 0
|
||||||
The hardware PWM frequency.
|
The hardware PWM frequency.
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
@ -9069,6 +9071,8 @@ PI_HW_PWM_MIN_FREQ 1
|
||||||
.br
|
.br
|
||||||
PI_HW_PWM_MAX_FREQ 125000000
|
PI_HW_PWM_MAX_FREQ 125000000
|
||||||
.br
|
.br
|
||||||
|
PI_HW_PWM_MAX_FREQ_2711 187500000
|
||||||
|
.br
|
||||||
|
|
||||||
.EE
|
.EE
|
||||||
|
|
||||||
|
@ -10263,11 +10267,11 @@ A 16-bit word value.
|
||||||
.br
|
.br
|
||||||
#define PI_NOT_HPWM_GPIO -95 // GPIO has no hardware PWM
|
#define PI_NOT_HPWM_GPIO -95 // GPIO has no hardware PWM
|
||||||
.br
|
.br
|
||||||
#define PI_BAD_HPWM_FREQ -96 // hardware PWM frequency not 1-125M
|
#define PI_BAD_HPWM_FREQ -96 // invalid hardware PWM frequency
|
||||||
.br
|
.br
|
||||||
#define PI_BAD_HPWM_DUTY -97 // hardware PWM dutycycle not 0-1M
|
#define PI_BAD_HPWM_DUTY -97 // hardware PWM dutycycle not 0-1M
|
||||||
.br
|
.br
|
||||||
#define PI_BAD_HCLK_FREQ -98 // hardware clock frequency not 4689-250M
|
#define PI_BAD_HCLK_FREQ -98 // invalid hardware clock frequency
|
||||||
.br
|
.br
|
||||||
#define PI_BAD_HCLK_PASS -99 // need password to use hardware clock 1
|
#define PI_BAD_HCLK_PASS -99 // need password to use hardware clock 1
|
||||||
.br
|
.br
|
||||||
|
|
28
pigpio.c
28
pigpio.c
|
@ -511,6 +511,7 @@ bit 0 READ_LAST_NOT_SET_ERROR
|
||||||
#define CLK_CTL_SRC_PLLD 6
|
#define CLK_CTL_SRC_PLLD 6
|
||||||
|
|
||||||
#define CLK_OSC_FREQ 19200000
|
#define CLK_OSC_FREQ 19200000
|
||||||
|
#define CLK_OSC_FREQ_2711 54000000
|
||||||
#define CLK_PLLD_FREQ 500000000
|
#define CLK_PLLD_FREQ 500000000
|
||||||
#define CLK_PLLD_FREQ_2711 750000000
|
#define CLK_PLLD_FREQ_2711 750000000
|
||||||
|
|
||||||
|
@ -1219,7 +1220,11 @@ static volatile uint32_t pi_dram_bus = 0x40000000;
|
||||||
static volatile uint32_t pi_mem_flag = 0x0C;
|
static volatile uint32_t pi_mem_flag = 0x0C;
|
||||||
static volatile uint32_t pi_ispi = 0;
|
static volatile uint32_t pi_ispi = 0;
|
||||||
static volatile uint32_t pi_is_2711 = 0;
|
static volatile uint32_t pi_is_2711 = 0;
|
||||||
|
static volatile uint32_t clk_osc_freq = CLK_OSC_FREQ;
|
||||||
static volatile uint32_t clk_plld_freq = CLK_PLLD_FREQ;
|
static volatile uint32_t clk_plld_freq = CLK_PLLD_FREQ;
|
||||||
|
static volatile uint32_t hw_pwm_max_freq = PI_HW_PWM_MAX_FREQ;
|
||||||
|
static volatile uint32_t hw_clk_min_freq = PI_HW_CLK_MIN_FREQ;
|
||||||
|
static volatile uint32_t hw_clk_max_freq = PI_HW_CLK_MAX_FREQ;
|
||||||
|
|
||||||
static int libInitialised = 0;
|
static int libInitialised = 0;
|
||||||
|
|
||||||
|
@ -12668,7 +12673,7 @@ int gpioHardwareClock(unsigned gpio, unsigned frequency)
|
||||||
int cctl[] = {CLK_GP0_CTL, CLK_GP1_CTL, CLK_GP2_CTL};
|
int cctl[] = {CLK_GP0_CTL, CLK_GP1_CTL, CLK_GP2_CTL};
|
||||||
int cdiv[] = {CLK_GP0_DIV, CLK_GP1_DIV, CLK_GP2_DIV};
|
int cdiv[] = {CLK_GP0_DIV, CLK_GP1_DIV, CLK_GP2_DIV};
|
||||||
int csrc[CLK_SRCS] = {CLK_CTL_SRC_OSC, CLK_CTL_SRC_PLLD};
|
int csrc[CLK_SRCS] = {CLK_CTL_SRC_OSC, CLK_CTL_SRC_PLLD};
|
||||||
uint32_t cfreq[CLK_SRCS]={CLK_OSC_FREQ, clk_plld_freq};
|
uint32_t cfreq[CLK_SRCS]={clk_osc_freq, clk_plld_freq};
|
||||||
unsigned clock, mode, mash;
|
unsigned clock, mode, mash;
|
||||||
int password = 0;
|
int password = 0;
|
||||||
double f;
|
double f;
|
||||||
|
@ -12688,11 +12693,12 @@ int gpioHardwareClock(unsigned gpio, unsigned frequency)
|
||||||
if (!clkDef[gpio])
|
if (!clkDef[gpio])
|
||||||
SOFT_ERROR(PI_NOT_HCLK_GPIO, "bad gpio for clock (%d)", gpio);
|
SOFT_ERROR(PI_NOT_HCLK_GPIO, "bad gpio for clock (%d)", gpio);
|
||||||
|
|
||||||
if (((frequency < PI_HW_CLK_MIN_FREQ) ||
|
if (((frequency < hw_clk_min_freq) ||
|
||||||
(frequency > PI_HW_CLK_MAX_FREQ)) &&
|
(frequency > hw_clk_max_freq)) &&
|
||||||
(frequency))
|
(frequency))
|
||||||
SOFT_ERROR(PI_BAD_HCLK_FREQ,
|
SOFT_ERROR(PI_BAD_HCLK_FREQ,
|
||||||
"bad hardware clock frequency (%d)", frequency);
|
"bad hardware clock frequency %d-%d: (%d)",
|
||||||
|
hw_clk_min_freq, hw_clk_max_freq, frequency);
|
||||||
|
|
||||||
clock = (clkDef[gpio] >> 4) & 3;
|
clock = (clkDef[gpio] >> 4) & 3;
|
||||||
|
|
||||||
|
@ -12727,7 +12733,8 @@ int gpioHardwareClock(unsigned gpio, unsigned frequency)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SOFT_ERROR(PI_BAD_HCLK_FREQ,
|
SOFT_ERROR(PI_BAD_HCLK_FREQ,
|
||||||
"bad hardware clock frequency (%d)", frequency);
|
"bad hardware clock frequency %d-%d: (%d)",
|
||||||
|
hw_clk_min_freq, hw_clk_max_freq, frequency);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -12766,10 +12773,12 @@ int gpioHardwarePWM(
|
||||||
SOFT_ERROR(PI_BAD_HPWM_DUTY, "bad PWM dutycycle (%d)", dutycycle);
|
SOFT_ERROR(PI_BAD_HPWM_DUTY, "bad PWM dutycycle (%d)", dutycycle);
|
||||||
|
|
||||||
if (((frequency < PI_HW_PWM_MIN_FREQ) ||
|
if (((frequency < PI_HW_PWM_MIN_FREQ) ||
|
||||||
(frequency > PI_HW_PWM_MAX_FREQ)) &&
|
(frequency > hw_pwm_max_freq)) &&
|
||||||
(frequency))
|
(frequency))
|
||||||
SOFT_ERROR(PI_BAD_HPWM_FREQ,
|
SOFT_ERROR(PI_BAD_HPWM_FREQ,
|
||||||
"bad hardware PWM frequency (%d)", frequency);
|
"bad hardware PWM frequency %d-%d: (%d)",
|
||||||
|
PI_HW_PWM_MIN_FREQ, hw_pwm_max_freq, frequency);
|
||||||
|
|
||||||
|
|
||||||
if (gpioCfg.clockPeriph == PI_CLOCK_PWM)
|
if (gpioCfg.clockPeriph == PI_CLOCK_PWM)
|
||||||
SOFT_ERROR(PI_HPWM_ILLEGAL, "illegal, PWM in use for main clock");
|
SOFT_ERROR(PI_HPWM_ILLEGAL, "illegal, PWM in use for main clock");
|
||||||
|
@ -13477,7 +13486,12 @@ unsigned gpioHardwareRevision(void)
|
||||||
pi_mem_flag = 0x04;
|
pi_mem_flag = 0x04;
|
||||||
pi_is_2711 = 1;
|
pi_is_2711 = 1;
|
||||||
pi_ispi = 1;
|
pi_ispi = 1;
|
||||||
|
clk_osc_freq = CLK_OSC_FREQ_2711;
|
||||||
clk_plld_freq = CLK_PLLD_FREQ_2711;
|
clk_plld_freq = CLK_PLLD_FREQ_2711;
|
||||||
|
hw_pwm_max_freq = PI_HW_PWM_MAX_FREQ_2711;
|
||||||
|
hw_clk_min_freq = PI_HW_CLK_MIN_FREQ_2711;
|
||||||
|
hw_clk_max_freq = PI_HW_CLK_MAX_FREQ_2711;
|
||||||
|
|
||||||
fclose(filp);
|
fclose(filp);
|
||||||
if (!gpioMaskSet)
|
if (!gpioMaskSet)
|
||||||
{
|
{
|
||||||
|
|
27
pigpio.h
27
pigpio.h
|
@ -30,7 +30,7 @@ For more information, please refer to <http://unlicense.org/>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
#define PIGPIO_VERSION 6906
|
#define PIGPIO_VERSION 6909
|
||||||
|
|
||||||
/*TEXT
|
/*TEXT
|
||||||
|
|
||||||
|
@ -611,12 +611,15 @@ typedef void *(gpioThreadFunc_t) (void *);
|
||||||
|
|
||||||
#define PI_HW_PWM_MIN_FREQ 1
|
#define PI_HW_PWM_MIN_FREQ 1
|
||||||
#define PI_HW_PWM_MAX_FREQ 125000000
|
#define PI_HW_PWM_MAX_FREQ 125000000
|
||||||
|
#define PI_HW_PWM_MAX_FREQ_2711 187500000
|
||||||
#define PI_HW_PWM_RANGE 1000000
|
#define PI_HW_PWM_RANGE 1000000
|
||||||
|
|
||||||
/* hardware clock */
|
/* hardware clock */
|
||||||
|
|
||||||
#define PI_HW_CLK_MIN_FREQ 4689
|
#define PI_HW_CLK_MIN_FREQ 4689
|
||||||
|
#define PI_HW_CLK_MIN_FREQ_2711 13184
|
||||||
#define PI_HW_CLK_MAX_FREQ 250000000
|
#define PI_HW_CLK_MAX_FREQ 250000000
|
||||||
|
#define PI_HW_CLK_MAX_FREQ_2711 375000000
|
||||||
|
|
||||||
#define PI_NOTIFY_SLOTS 32
|
#define PI_NOTIFY_SLOTS 32
|
||||||
|
|
||||||
|
@ -3982,7 +3985,7 @@ Frequencies above 30MHz are unlikely to work.
|
||||||
|
|
||||||
. .
|
. .
|
||||||
gpio: see description
|
gpio: see description
|
||||||
clkfreq: 0 (off) or 4689-250000000 (250M)
|
clkfreq: 0 (off) or 4689-250M (13184-375M for the BCM2711)
|
||||||
. .
|
. .
|
||||||
|
|
||||||
Returns 0 if OK, otherwise PI_BAD_GPIO, PI_NOT_HCLK_GPIO,
|
Returns 0 if OK, otherwise PI_BAD_GPIO, PI_NOT_HCLK_GPIO,
|
||||||
|
@ -4027,7 +4030,7 @@ main clock defaults to PCM but may be overridden by a call to
|
||||||
|
|
||||||
. .
|
. .
|
||||||
gpio: see description
|
gpio: see description
|
||||||
PWMfreq: 0 (off) or 1-125000000 (125M)
|
PWMfreq: 0 (off) or 1-125M (1-187.5M for the BCM2711)
|
||||||
PWMduty: 0 (off) to 1000000 (1M)(fully on)
|
PWMduty: 0 (off) to 1000000 (1M)(fully on)
|
||||||
. .
|
. .
|
||||||
|
|
||||||
|
@ -4054,12 +4057,12 @@ The GPIO must be one of the following.
|
||||||
. .
|
. .
|
||||||
|
|
||||||
The actual number of steps beween off and fully on is the
|
The actual number of steps beween off and fully on is the
|
||||||
integral part of 250 million divided by PWMfreq.
|
integral part of 250M/PWMfreq (375M/PWMfreq for the BCM2711).
|
||||||
|
|
||||||
The actual frequency set is 250 million / steps.
|
The actual frequency set is 250M/steps (375M/steps for the BCM2711).
|
||||||
|
|
||||||
There will only be a million steps for a PWMfreq of 250.
|
There will only be a million steps for a PWMfreq of 250 (375 for
|
||||||
Lower frequencies will have more steps and higher
|
the BCM2711). Lower frequencies will have more steps and higher
|
||||||
frequencies will have fewer steps. PWMduty is
|
frequencies will have fewer steps. PWMduty is
|
||||||
automatically scaled to take this into account.
|
automatically scaled to take this into account.
|
||||||
D*/
|
D*/
|
||||||
|
@ -5312,13 +5315,14 @@ char::
|
||||||
|
|
||||||
A single character, an 8 bit quantity able to store 0-255.
|
A single character, an 8 bit quantity able to store 0-255.
|
||||||
|
|
||||||
clkfreq::4689-250M
|
clkfreq::4689-250M (13184-375M for the BCM2711)
|
||||||
|
|
||||||
The hardware clock frequency.
|
The hardware clock frequency.
|
||||||
|
|
||||||
. .
|
. .
|
||||||
PI_HW_CLK_MIN_FREQ 4689
|
PI_HW_CLK_MIN_FREQ 4689
|
||||||
PI_HW_CLK_MAX_FREQ 250000000
|
PI_HW_CLK_MAX_FREQ 250000000
|
||||||
|
PI_HW_CLK_MAX_FREQ_2711 375000000
|
||||||
. .
|
. .
|
||||||
|
|
||||||
count::
|
count::
|
||||||
|
@ -5770,12 +5774,13 @@ The hardware PWM dutycycle.
|
||||||
PI_HW_PWM_RANGE 1000000
|
PI_HW_PWM_RANGE 1000000
|
||||||
. .
|
. .
|
||||||
|
|
||||||
PWMfreq::5-250K
|
PWMfreq::1-125M (1-187.5M for the BCM2711)
|
||||||
The hardware PWM frequency.
|
The hardware PWM frequency.
|
||||||
|
|
||||||
. .
|
. .
|
||||||
PI_HW_PWM_MIN_FREQ 1
|
PI_HW_PWM_MIN_FREQ 1
|
||||||
PI_HW_PWM_MAX_FREQ 125000000
|
PI_HW_PWM_MAX_FREQ 125000000
|
||||||
|
PI_HW_PWM_MAX_FREQ_2711 187500000
|
||||||
. .
|
. .
|
||||||
|
|
||||||
range::25-40000
|
range::25-40000
|
||||||
|
@ -6379,9 +6384,9 @@ after this command is issued.
|
||||||
#define PI_NOT_SERVO_GPIO -93 // GPIO is not in use for servo pulses
|
#define PI_NOT_SERVO_GPIO -93 // GPIO is not in use for servo pulses
|
||||||
#define PI_NOT_HCLK_GPIO -94 // GPIO has no hardware clock
|
#define PI_NOT_HCLK_GPIO -94 // GPIO has no hardware clock
|
||||||
#define PI_NOT_HPWM_GPIO -95 // GPIO has no hardware PWM
|
#define PI_NOT_HPWM_GPIO -95 // GPIO has no hardware PWM
|
||||||
#define PI_BAD_HPWM_FREQ -96 // hardware PWM frequency not 1-125M
|
#define PI_BAD_HPWM_FREQ -96 // invalid hardware PWM frequency
|
||||||
#define PI_BAD_HPWM_DUTY -97 // hardware PWM dutycycle not 0-1M
|
#define PI_BAD_HPWM_DUTY -97 // hardware PWM dutycycle not 0-1M
|
||||||
#define PI_BAD_HCLK_FREQ -98 // hardware clock frequency not 4689-250M
|
#define PI_BAD_HCLK_FREQ -98 // invalid hardware clock frequency
|
||||||
#define PI_BAD_HCLK_PASS -99 // need password to use hardware clock 1
|
#define PI_BAD_HCLK_PASS -99 // need password to use hardware clock 1
|
||||||
#define PI_HPWM_ILLEGAL -100 // illegal, PWM in use for main clock
|
#define PI_HPWM_ILLEGAL -100 // illegal, PWM in use for main clock
|
||||||
#define PI_BAD_DATABITS -101 // serial data bits not 1-32
|
#define PI_BAD_DATABITS -101 // serial data bits not 1-32
|
||||||
|
|
29
pigpio.py
29
pigpio.py
|
@ -300,7 +300,7 @@ import threading
|
||||||
import os
|
import os
|
||||||
import atexit
|
import atexit
|
||||||
|
|
||||||
VERSION = "1.43"
|
VERSION = "1.44"
|
||||||
|
|
||||||
exceptions = True
|
exceptions = True
|
||||||
|
|
||||||
|
@ -788,9 +788,9 @@ _errors=[
|
||||||
[PI_NOT_SERVO_GPIO , "GPIO is not in use for servo pulses"],
|
[PI_NOT_SERVO_GPIO , "GPIO is not in use for servo pulses"],
|
||||||
[PI_NOT_HCLK_GPIO , "GPIO has no hardware clock"],
|
[PI_NOT_HCLK_GPIO , "GPIO has no hardware clock"],
|
||||||
[PI_NOT_HPWM_GPIO , "GPIO has no hardware PWM"],
|
[PI_NOT_HPWM_GPIO , "GPIO has no hardware PWM"],
|
||||||
[PI_BAD_HPWM_FREQ , "hardware PWM frequency not 1-125M"],
|
[PI_BAD_HPWM_FREQ , "invalid hardware PWM frequency"],
|
||||||
[PI_BAD_HPWM_DUTY , "hardware PWM dutycycle not 0-1M"],
|
[PI_BAD_HPWM_DUTY , "hardware PWM dutycycle not 0-1M"],
|
||||||
[PI_BAD_HCLK_FREQ , "hardware clock frequency not 4689-250M"],
|
[PI_BAD_HCLK_FREQ , "invalid hardware clock frequency"],
|
||||||
[PI_BAD_HCLK_PASS , "need password to use hardware clock 1"],
|
[PI_BAD_HCLK_PASS , "need password to use hardware clock 1"],
|
||||||
[PI_HPWM_ILLEGAL , "illegal, PWM in use for main clock"],
|
[PI_HPWM_ILLEGAL , "illegal, PWM in use for main clock"],
|
||||||
[PI_BAD_DATABITS , "serial data bits not 1-32"],
|
[PI_BAD_DATABITS , "serial data bits not 1-32"],
|
||||||
|
@ -1909,7 +1909,7 @@ class pi():
|
||||||
Frequencies above 30MHz are unlikely to work.
|
Frequencies above 30MHz are unlikely to work.
|
||||||
|
|
||||||
gpio:= see description
|
gpio:= see description
|
||||||
clkfreq:= 0 (off) or 4689-250000000 (250M)
|
clkfreq:= 0 (off) or 4689-250M (13184-375M for the BCM2711)
|
||||||
|
|
||||||
|
|
||||||
Returns 0 if OK, otherwise PI_NOT_PERMITTED, PI_BAD_GPIO,
|
Returns 0 if OK, otherwise PI_NOT_PERMITTED, PI_BAD_GPIO,
|
||||||
|
@ -1959,7 +1959,7 @@ class pi():
|
||||||
pigpio daemon is started (option -t).
|
pigpio daemon is started (option -t).
|
||||||
|
|
||||||
gpio:= see descripton
|
gpio:= see descripton
|
||||||
PWMfreq:= 0 (off) or 1-125000000 (125M).
|
PWMfreq:= 0 (off) or 1-125M (1-187.5M for the BCM2711).
|
||||||
PWMduty:= 0 (off) to 1000000 (1M)(fully on).
|
PWMduty:= 0 (off) to 1000000 (1M)(fully on).
|
||||||
|
|
||||||
Returns 0 if OK, otherwise PI_NOT_PERMITTED, PI_BAD_GPIO,
|
Returns 0 if OK, otherwise PI_NOT_PERMITTED, PI_BAD_GPIO,
|
||||||
|
@ -1985,14 +1985,15 @@ class pi():
|
||||||
. .
|
. .
|
||||||
|
|
||||||
The actual number of steps beween off and fully on is the
|
The actual number of steps beween off and fully on is the
|
||||||
integral part of 250 million divided by PWMfreq.
|
integral part of 250M/PWMfreq (375M/PWMfreq for the BCM2711).
|
||||||
|
|
||||||
The actual frequency set is 250 million / steps.
|
The actual frequency set is 250M/steps (375M/steps
|
||||||
|
for the BCM2711).
|
||||||
|
|
||||||
There will only be a million steps for a PWMfreq of 250.
|
There will only be a million steps for a PWMfreq of 250
|
||||||
Lower frequencies will have more steps and higher
|
(375 for the BCM2711). Lower frequencies will have more
|
||||||
frequencies will have fewer steps. PWMduty is
|
steps and higher frequencies will have fewer steps.
|
||||||
automatically scaled to take this into account.
|
PWMduty is automatically scaled to take this into account.
|
||||||
|
|
||||||
...
|
...
|
||||||
pi.hardware_PWM(18, 800, 250000) # 800Hz 25% dutycycle
|
pi.hardware_PWM(18, 800, 250000) # 800Hz 25% dutycycle
|
||||||
|
@ -5184,7 +5185,7 @@ def xref():
|
||||||
byte_val: 0-255
|
byte_val: 0-255
|
||||||
A whole number.
|
A whole number.
|
||||||
|
|
||||||
clkfreq: 4689-250M
|
clkfreq: 4689-250M (13184-375M for the BCM2711)
|
||||||
The hardware clock frequency.
|
The hardware clock frequency.
|
||||||
|
|
||||||
connected:
|
connected:
|
||||||
|
@ -5340,6 +5341,8 @@ def xref():
|
||||||
PI_NOT_SPI_GPIO = -142
|
PI_NOT_SPI_GPIO = -142
|
||||||
PI_BAD_EVENT_ID = -143
|
PI_BAD_EVENT_ID = -143
|
||||||
PI_CMD_INTERRUPTED = -144
|
PI_CMD_INTERRUPTED = -144
|
||||||
|
PI_NOT_ON_BCM2711 = -145
|
||||||
|
PI_ONLY_ON_BCM2711 = -146
|
||||||
. .
|
. .
|
||||||
|
|
||||||
event:0-31
|
event:0-31
|
||||||
|
@ -5532,7 +5535,7 @@ def xref():
|
||||||
PWMduty: 0-1000000 (1M)
|
PWMduty: 0-1000000 (1M)
|
||||||
The hardware PWM dutycycle.
|
The hardware PWM dutycycle.
|
||||||
|
|
||||||
PWMfreq: 1-125000000 (125M)
|
PWMfreq: 1-125M (1-187.5M for the BCM2711)
|
||||||
The hardware PWM frequency.
|
The hardware PWM frequency.
|
||||||
|
|
||||||
range_: 25-40000
|
range_: 25-40000
|
||||||
|
|
|
@ -1412,7 +1412,7 @@ Frequencies above 30MHz are unlikely to work.
|
||||||
.br
|
.br
|
||||||
gpio: see description
|
gpio: see description
|
||||||
.br
|
.br
|
||||||
frequency: 0 (off) or 4689-250000000 (250M)
|
frequency: 0 (off) or 4689-250M (13184-375M for the BCM2711)
|
||||||
.br
|
.br
|
||||||
|
|
||||||
.EE
|
.EE
|
||||||
|
@ -1498,7 +1498,7 @@ daemon is started (option -t).
|
||||||
.br
|
.br
|
||||||
gpio: see descripton
|
gpio: see descripton
|
||||||
.br
|
.br
|
||||||
PWMfreq: 0 (off) or 1-125000000 (125M)
|
PWMfreq: 0 (off) or 1-125M (1-187.5M for the BCM2711)
|
||||||
.br
|
.br
|
||||||
PWMduty: 0 (off) to 1000000 (1M)(fully on)
|
PWMduty: 0 (off) to 1000000 (1M)(fully on)
|
||||||
.br
|
.br
|
||||||
|
@ -1556,18 +1556,18 @@ The GPIO must be one of the following.
|
||||||
|
|
||||||
.br
|
.br
|
||||||
The actual number of steps beween off and fully on is the
|
The actual number of steps beween off and fully on is the
|
||||||
integral part of 250 million divided by PWMfreq.
|
integral part of 250M/PWMfreq (375M/PWMfreq for the BCM2711).
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
|
||||||
.br
|
.br
|
||||||
The actual frequency set is 250 million / steps.
|
The actual frequency set is 250M/steps (375M/steps for the BCM2711).
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
|
||||||
.br
|
.br
|
||||||
There will only be a million steps for a PWMfreq of 250.
|
There will only be a million steps for a PWMfreq of 250 (375 for
|
||||||
Lower frequencies will have more steps and higher
|
the BCM2711). Lower frequencies will have more steps and higher
|
||||||
frequencies will have fewer steps. PWMduty is
|
frequencies will have fewer steps. PWMduty is
|
||||||
automatically scaled to take this into account.
|
automatically scaled to take this into account.
|
||||||
|
|
||||||
|
@ -6294,7 +6294,7 @@ A single character, an 8 bit quantity able to store 0-255.
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
|
||||||
.IP "\fBclkfreq\fP: 4689-250000000 (250M)" 0
|
.IP "\fBclkfreq\fP: 4689-250M (13184-375M for the BCM2711)" 0
|
||||||
The hardware clock frequency.
|
The hardware clock frequency.
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
@ -6972,7 +6972,7 @@ The hardware PWM dutycycle.
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
|
||||||
.IP "\fBPWMfreq\fP: 1-125000000 (125M)" 0
|
.IP "\fBPWMfreq\fP: 1-125M (1-187.5M for the BCM2711)" 0
|
||||||
The hardware PWM frequency.
|
The hardware PWM frequency.
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
@ -6984,6 +6984,8 @@ The hardware PWM frequency.
|
||||||
.br
|
.br
|
||||||
#define PI_HW_PWM_MAX_FREQ 125000000
|
#define PI_HW_PWM_MAX_FREQ 125000000
|
||||||
.br
|
.br
|
||||||
|
#define PI_HW_PWM_MAX_FREQ_2711 187500000
|
||||||
|
.br
|
||||||
|
|
||||||
.EE
|
.EE
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ OTHER DEALINGS IN THE SOFTWARE.
|
||||||
For more information, please refer to <http://unlicense.org/>
|
For more information, please refer to <http://unlicense.org/>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* PIGPIOD_IF2_VERSION 14 */
|
/* PIGPIOD_IF2_VERSION 15 */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
|
@ -30,7 +30,7 @@ For more information, please refer to <http://unlicense.org/>
|
||||||
|
|
||||||
#include "pigpio.h"
|
#include "pigpio.h"
|
||||||
|
|
||||||
#define PIGPIOD_IF2_VERSION 14
|
#define PIGPIOD_IF2_VERSION 15
|
||||||
|
|
||||||
/*TEXT
|
/*TEXT
|
||||||
|
|
||||||
|
@ -1049,7 +1049,7 @@ Frequencies above 30MHz are unlikely to work.
|
||||||
. .
|
. .
|
||||||
pi: >=0 (as returned by [*pigpio_start*]).
|
pi: >=0 (as returned by [*pigpio_start*]).
|
||||||
gpio: see description
|
gpio: see description
|
||||||
frequency: 0 (off) or 4689-250000000 (250M)
|
frequency: 0 (off) or 4689-250M (13184-375M for the BCM2711)
|
||||||
. .
|
. .
|
||||||
|
|
||||||
Returns 0 if OK, otherwise PI_NOT_PERMITTED, PI_BAD_GPIO,
|
Returns 0 if OK, otherwise PI_NOT_PERMITTED, PI_BAD_GPIO,
|
||||||
|
@ -1096,7 +1096,7 @@ daemon is started (option -t).
|
||||||
. .
|
. .
|
||||||
pi: >=0 (as returned by [*pigpio_start*]).
|
pi: >=0 (as returned by [*pigpio_start*]).
|
||||||
gpio: see descripton
|
gpio: see descripton
|
||||||
PWMfreq: 0 (off) or 1-125000000 (125M)
|
PWMfreq: 0 (off) or 1-125M (1-187.5M for the BCM2711)
|
||||||
PWMduty: 0 (off) to 1000000 (1M)(fully on)
|
PWMduty: 0 (off) to 1000000 (1M)(fully on)
|
||||||
. .
|
. .
|
||||||
|
|
||||||
|
@ -1124,12 +1124,12 @@ The GPIO must be one of the following.
|
||||||
. .
|
. .
|
||||||
|
|
||||||
The actual number of steps beween off and fully on is the
|
The actual number of steps beween off and fully on is the
|
||||||
integral part of 250 million divided by PWMfreq.
|
integral part of 250M/PWMfreq (375M/PWMfreq for the BCM2711).
|
||||||
|
|
||||||
The actual frequency set is 250 million / steps.
|
The actual frequency set is 250M/steps (375M/steps for the BCM2711).
|
||||||
|
|
||||||
There will only be a million steps for a PWMfreq of 250.
|
There will only be a million steps for a PWMfreq of 250 (375 for
|
||||||
Lower frequencies will have more steps and higher
|
the BCM2711). Lower frequencies will have more steps and higher
|
||||||
frequencies will have fewer steps. PWMduty is
|
frequencies will have fewer steps. PWMduty is
|
||||||
automatically scaled to take this into account.
|
automatically scaled to take this into account.
|
||||||
D*/
|
D*/
|
||||||
|
@ -3749,7 +3749,7 @@ typedef void (*CBFuncEx_t)
|
||||||
char::
|
char::
|
||||||
A single character, an 8 bit quantity able to store 0-255.
|
A single character, an 8 bit quantity able to store 0-255.
|
||||||
|
|
||||||
clkfreq::4689-250000000 (250M)
|
clkfreq::4689-250M (13184-375M for the BCM2711)
|
||||||
The hardware clock frequency.
|
The hardware clock frequency.
|
||||||
|
|
||||||
count::
|
count::
|
||||||
|
@ -4053,12 +4053,13 @@ The hardware PWM dutycycle.
|
||||||
#define PI_HW_PWM_RANGE 1000000
|
#define PI_HW_PWM_RANGE 1000000
|
||||||
. .
|
. .
|
||||||
|
|
||||||
PWMfreq::1-125000000 (125M)
|
PWMfreq::1-125M (1-187.5M for the BCM2711)
|
||||||
The hardware PWM frequency.
|
The hardware PWM frequency.
|
||||||
|
|
||||||
. .
|
. .
|
||||||
#define PI_HW_PWM_MIN_FREQ 1
|
#define PI_HW_PWM_MIN_FREQ 1
|
||||||
#define PI_HW_PWM_MAX_FREQ 125000000
|
#define PI_HW_PWM_MAX_FREQ 125000000
|
||||||
|
#define PI_HW_PWM_MAX_FREQ_2711 187500000
|
||||||
. .
|
. .
|
||||||
|
|
||||||
range::25-40000
|
range::25-40000
|
||||||
|
|
16
pigs.1
16
pigs.1
|
@ -1705,11 +1705,11 @@ $ pigs hp 19 100 200000 # 20% dutycycle
|
||||||
.br
|
.br
|
||||||
|
|
||||||
.br
|
.br
|
||||||
$ pigs hp 19 125000001 100000
|
$ pigs hp 19 400000000 100000
|
||||||
.br
|
.br
|
||||||
-96
|
-96
|
||||||
.br
|
.br
|
||||||
ERROR: hardware PWM frequency not 1-125M
|
ERROR: invalid hardware PWM frequency
|
||||||
.br
|
.br
|
||||||
|
|
||||||
.EE
|
.EE
|
||||||
|
@ -1745,14 +1745,14 @@ The GPIO must be one of the following.
|
||||||
|
|
||||||
.br
|
.br
|
||||||
The actual number of steps beween off and fully on is the
|
The actual number of steps beween off and fully on is the
|
||||||
integral part of 250 million divided by \fBpf\fP.
|
integral part of 250M/\fBpf\fP (375M/\fBpf\fP for the BCM2711).
|
||||||
|
|
||||||
.br
|
.br
|
||||||
The actual frequency set is 250 million / steps.
|
The actual frequency set is 250M/steps (375M/steps for the BCM2711).
|
||||||
|
|
||||||
.br
|
.br
|
||||||
There will only be a million steps for a \fBpf\fP of 250.
|
There will only be a million steps for a \fBpf\fP of 250 (375 for
|
||||||
Lower frequencies will have more steps and higher
|
the BCM2711). Lower frequencies will have more steps and higher
|
||||||
frequencies will have fewer steps. \fBpdc\fP is
|
frequencies will have fewer steps. \fBpdc\fP is
|
||||||
automatically scaled to take this into account.
|
automatically scaled to take this into account.
|
||||||
|
|
||||||
|
@ -5125,7 +5125,7 @@ The command expects a SPI channel.
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
|
||||||
.IP "\fBcf\fP - hardware clock frequency (4689-250M)" 0
|
.IP "\fBcf\fP - hardware clock frequency (4689-250M, 13184-375M for the BCM2711)" 0
|
||||||
The command expects a frequency.
|
The command expects a frequency.
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
@ -5408,7 +5408,7 @@ The command expects a dutycycle.
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
|
||||||
.IP "\fBpf\fP - hardware PWM frequency (1-125M)" 0
|
.IP "\fBpf\fP - hardware PWM frequency (1-125M, 1-187.5M for the BCM2711)" 0
|
||||||
The command expects a frequency.
|
The command expects a frequency.
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -3,7 +3,7 @@
|
||||||
from distutils.core import setup
|
from distutils.core import setup
|
||||||
|
|
||||||
setup(name='pigpio',
|
setup(name='pigpio',
|
||||||
version='1.43',
|
version='1.44',
|
||||||
author='joan',
|
author='joan',
|
||||||
author_email='joan@abyz.me.uk',
|
author_email='joan@abyz.me.uk',
|
||||||
maintainer='joan',
|
maintainer='joan',
|
||||||
|
|
Loading…
Reference in New Issue