Skip to content

Commit b0d0d76

Browse files
committed
Use template addCfgValset
1 parent fb4c1d6 commit b0d0d76

File tree

3 files changed

+30
-30
lines changed

3 files changed

+30
-30
lines changed

examples/Basics/Example23_TimePulseParameters/Example23_TimePulse_BulletTime/Example23_TimePulse_BulletTime.ino

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ void setup()
6363
// Let's say that we want our pulse-per-second to be as accurate as possible. So, let's tell the module
6464
// to generate no signal while it is _locking_ to GNSS time. We want the signal to start only when the module is
6565
// _locked_ to GNSS time.
66-
myGNSS.addCfgValset32(UBLOX_CFG_TP_PERIOD_TP1, 0); // Set the period to zero
67-
myGNSS.addCfgValset32(UBLOX_CFG_TP_LEN_TP1, 0); // Set the pulse length to zero
66+
myGNSS.addCfgValset(UBLOX_CFG_TP_PERIOD_TP1, 0); // Set the period to zero
67+
myGNSS.addCfgValset(UBLOX_CFG_TP_LEN_TP1, 0); // Set the pulse length to zero
6868

6969
// When the module is _locked_ to GNSS time, make it generate a 0.1 second pulse once per second
70-
myGNSS.addCfgValset32(UBLOX_CFG_TP_PERIOD_LOCK_TP1, 1000000); // Set the period to 1,000,000 us
71-
myGNSS.addCfgValset32(UBLOX_CFG_TP_LEN_LOCK_TP1, 100000); // Set the pulse length to 0.1s (100,000 us)
72-
myGNSS.addCfgValset8(UBLOX_CFG_TP_POL_TP1, 1); // Set the polarity to "1" (high for 0.1s, low for 0.9s, rising edge at top of second)
70+
myGNSS.addCfgValset(UBLOX_CFG_TP_PERIOD_LOCK_TP1, 1000000); // Set the period to 1,000,000 us
71+
myGNSS.addCfgValset(UBLOX_CFG_TP_LEN_LOCK_TP1, 100000); // Set the pulse length to 0.1s (100,000 us)
72+
myGNSS.addCfgValset(UBLOX_CFG_TP_POL_TP1, 1); // Set the polarity to "1" (high for 0.1s, low for 0.9s, rising edge at top of second)
7373

7474
// We can use CFG_TP_USER_DELAY to delay the pulse for each camera. The delay needs to be negative for this example.
7575
// We can delay the pulse by +/- 2^31 nanoseconds (+/- 2.147 seconds).
@@ -85,12 +85,12 @@ void setup()
8585
//converter32.signed32 = -700000000; // Camera 8: delay the pulse by 0.7s (700,000,000 ns)
8686
//converter32.signed32 = -800000000; // Camera 9: delay the pulse by 0.8s (800,000,000 ns)
8787
//converter32.signed32 = -900000000; // Camera 10: delay the pulse by 0.9s (900,000,000 ns)
88-
myGNSS.addCfgValset32(UBLOX_CFG_TP_USER_DELAY_TP1, converter32.unsigned32); // Avoid any ambiguity by using converter32 to convert from signed to unsigned
88+
myGNSS.addCfgValset(UBLOX_CFG_TP_USER_DELAY_TP1, converter32.unsigned32); // Avoid any ambiguity by using converter32 to convert from signed to unsigned
8989

90-
myGNSS.addCfgValset8(UBLOX_CFG_TP_TP1_ENA, 1); // Make sure the enable flag is set to enable the time pulse. (Set to 0 to disable.)
91-
myGNSS.addCfgValset8(UBLOX_CFG_TP_USE_LOCKED_TP1, 1); // Tell the module to use PERIOD while locking and PERIOD_LOCK when locked to GNSS time
92-
myGNSS.addCfgValset8(UBLOX_CFG_TP_PULSE_DEF, 0); // Tell the module that we want to set the period (not the frequency). PERIOD = 0. FREQ = 1.
93-
myGNSS.addCfgValset8(UBLOX_CFG_TP_PULSE_LENGTH_DEF, 1); // Tell the module to set the pulse length (not the pulse ratio / duty). RATIO = 0. LENGTH = 1.
90+
myGNSS.addCfgValset(UBLOX_CFG_TP_TP1_ENA, 1); // Make sure the enable flag is set to enable the time pulse. (Set to 0 to disable.)
91+
myGNSS.addCfgValset(UBLOX_CFG_TP_USE_LOCKED_TP1, 1); // Tell the module to use PERIOD while locking and PERIOD_LOCK when locked to GNSS time
92+
myGNSS.addCfgValset(UBLOX_CFG_TP_PULSE_DEF, 0); // Tell the module that we want to set the period (not the frequency). PERIOD = 0. FREQ = 1.
93+
myGNSS.addCfgValset(UBLOX_CFG_TP_PULSE_LENGTH_DEF, 1); // Tell the module to set the pulse length (not the pulse ratio / duty). RATIO = 0. LENGTH = 1.
9494

9595
// Now set the time pulse parameters
9696
if (myGNSS.sendCfgValset() == false)

examples/Basics/Example23_TimePulseParameters/Example23_TimePulse_Frequency/Example23_TimePulse_Frequency.ino

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,18 @@ void setup()
6060
myGNSS.newCfgValset(VAL_LAYER_RAM); // Create a new Configuration Interface VALSET message. Apply the changes in RAM only (not BBR).
6161

6262
// While the module is _locking_ to GNSS time, make it generate 2kHz
63-
myGNSS.addCfgValset32(UBLOX_CFG_TP_FREQ_TP1, 2000); // Set the frequency to 2000Hz
64-
myGNSS.addCfgValsetDouble(UBLOX_CFG_TP_DUTY_TP1, 100.0 / 3.0); // Set the pulse ratio / duty to 33.333% to produce 33.333:66.666 mark:space
63+
myGNSS.addCfgValset(UBLOX_CFG_TP_FREQ_TP1, 2000); // Set the frequency to 2000Hz
64+
myGNSS.addCfgValset(UBLOX_CFG_TP_DUTY_TP1, 100.0 / 3.0); // Set the pulse ratio / duty to 33.333% to produce 33.333:66.666 mark:space
6565

6666
// When the module is _locked_ to GNSS time, make it generate 1kHz
67-
myGNSS.addCfgValset32(UBLOX_CFG_TP_FREQ_LOCK_TP1, 1000); // Set the frequency to 1000Hz
68-
myGNSS.addCfgValsetDouble(UBLOX_CFG_TP_DUTY_LOCK_TP1, 50.0); // Set the pulse ratio / duty to 50% to produce 50:50 mark:space
69-
70-
myGNSS.addCfgValset8(UBLOX_CFG_TP_TP1_ENA, 1); // Make sure the enable flag is set to enable the time pulse. (Set to 0 to disable.)
71-
myGNSS.addCfgValset8(UBLOX_CFG_TP_USE_LOCKED_TP1, 1); // Tell the module to use FREQ while locking and FREQ_LOCK when locked to GNSS time
72-
myGNSS.addCfgValset8(UBLOX_CFG_TP_PULSE_DEF, 1); // Tell the module that we want to set the frequency (not the period). PERIOD = 0. FREQ = 1.
73-
myGNSS.addCfgValset8(UBLOX_CFG_TP_PULSE_LENGTH_DEF, 0); // Tell the module to set the pulse ratio / duty (not the pulse length). RATIO = 0. LENGTH = 1.
74-
myGNSS.addCfgValset8(UBLOX_CFG_TP_POL_TP1, 1); // Tell the module that we want the rising edge at the top of second. Falling Edge = 0. Rising Edge = 1.
67+
myGNSS.addCfgValset(UBLOX_CFG_TP_FREQ_LOCK_TP1, 1000); // Set the frequency to 1000Hz
68+
myGNSS.addCfgValset(UBLOX_CFG_TP_DUTY_LOCK_TP1, 50.0); // Set the pulse ratio / duty to 50% to produce 50:50 mark:space
69+
70+
myGNSS.addCfgValset(UBLOX_CFG_TP_TP1_ENA, 1); // Make sure the enable flag is set to enable the time pulse. (Set to 0 to disable.)
71+
myGNSS.addCfgValset(UBLOX_CFG_TP_USE_LOCKED_TP1, 1); // Tell the module to use FREQ while locking and FREQ_LOCK when locked to GNSS time
72+
myGNSS.addCfgValset(UBLOX_CFG_TP_PULSE_DEF, 1); // Tell the module that we want to set the frequency (not the period). PERIOD = 0. FREQ = 1.
73+
myGNSS.addCfgValset(UBLOX_CFG_TP_PULSE_LENGTH_DEF, 0); // Tell the module to set the pulse ratio / duty (not the pulse length). RATIO = 0. LENGTH = 1.
74+
myGNSS.addCfgValset(UBLOX_CFG_TP_POL_TP1, 1); // Tell the module that we want the rising edge at the top of second. Falling Edge = 0. Rising Edge = 1.
7575

7676
// Now set the time pulse parameters
7777
if (myGNSS.sendCfgValset() == false)

examples/Basics/Example23_TimePulseParameters/Example23_TimePulse_Period/Example23_TimePulse_Period.ino

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,18 @@ void setup()
6363
// Let's say that we want our 1 pulse every 30 seconds to be as accurate as possible. So, let's tell the module
6464
// to generate no signal while it is _locking_ to GNSS time. We want the signal to start only when the module is
6565
// _locked_ to GNSS time.
66-
myGNSS.addCfgValset32(UBLOX_CFG_TP_PERIOD_TP1, 0); // Set the period to zero
67-
myGNSS.addCfgValset32(UBLOX_CFG_TP_LEN_TP1, 0); // Set the pulse length to zero
66+
myGNSS.addCfgValset(UBLOX_CFG_TP_PERIOD_TP1, 0); // Set the period to zero
67+
myGNSS.addCfgValset(UBLOX_CFG_TP_LEN_TP1, 0); // Set the pulse length to zero
6868

6969
// When the module is _locked_ to GNSS time, make it generate a 1 second pulse every 30 seconds
70-
myGNSS.addCfgValset32(UBLOX_CFG_TP_PERIOD_LOCK_TP1, 30000000); // Set the period to 30,000,000 us
71-
myGNSS.addCfgValset32(UBLOX_CFG_TP_LEN_LOCK_TP1, 1000000); // Set the pulse length to 1,000,000 us
72-
73-
myGNSS.addCfgValset8(UBLOX_CFG_TP_TP1_ENA, 1); // Make sure the enable flag is set to enable the time pulse. (Set to 0 to disable.)
74-
myGNSS.addCfgValset8(UBLOX_CFG_TP_USE_LOCKED_TP1, 1); // Tell the module to use PERIOD while locking and PERIOD_LOCK when locked to GNSS time
75-
myGNSS.addCfgValset8(UBLOX_CFG_TP_PULSE_DEF, 0); // Tell the module that we want to set the period (not the frequency). PERIOD = 0. FREQ = 1.
76-
myGNSS.addCfgValset8(UBLOX_CFG_TP_PULSE_LENGTH_DEF, 1); // Tell the module to set the pulse length (not the pulse ratio / duty). RATIO = 0. LENGTH = 1.
77-
myGNSS.addCfgValset8(UBLOX_CFG_TP_POL_TP1, 1); // Tell the module that we want the rising edge at the top of second. Falling Edge = 0. Rising Edge = 1.
70+
myGNSS.addCfgValset(UBLOX_CFG_TP_PERIOD_LOCK_TP1, 30000000); // Set the period to 30,000,000 us
71+
myGNSS.addCfgValset(UBLOX_CFG_TP_LEN_LOCK_TP1, 1000000); // Set the pulse length to 1,000,000 us
72+
73+
myGNSS.addCfgValset(UBLOX_CFG_TP_TP1_ENA, 1); // Make sure the enable flag is set to enable the time pulse. (Set to 0 to disable.)
74+
myGNSS.addCfgValset(UBLOX_CFG_TP_USE_LOCKED_TP1, 1); // Tell the module to use PERIOD while locking and PERIOD_LOCK when locked to GNSS time
75+
myGNSS.addCfgValset(UBLOX_CFG_TP_PULSE_DEF, 0); // Tell the module that we want to set the period (not the frequency). PERIOD = 0. FREQ = 1.
76+
myGNSS.addCfgValset(UBLOX_CFG_TP_PULSE_LENGTH_DEF, 1); // Tell the module to set the pulse length (not the pulse ratio / duty). RATIO = 0. LENGTH = 1.
77+
myGNSS.addCfgValset(UBLOX_CFG_TP_POL_TP1, 1); // Tell the module that we want the rising edge at the top of second. Falling Edge = 0. Rising Edge = 1.
7878

7979
// Now set the time pulse parameters
8080
if (myGNSS.sendCfgValset() == false)

0 commit comments

Comments
 (0)