Skip to content
This repository was archived by the owner on Feb 4, 2022. It is now read-only.

Commit df54d12

Browse files
committed
Update gnssON and gnssOFF in remaining examples
1 parent 135ec48 commit df54d12

File tree

12 files changed

+135
-9
lines changed

12 files changed

+135
-9
lines changed

Software/examples/Example10_BasicSend/Example10_BasicSend.ino

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,23 @@
6767
// Declare the IridiumSBD object (including the sleep (ON/OFF) and Ring Indicator pins)
6868
IridiumSBD modem(Serial1, iridiumSleep, iridiumRI);
6969

70+
void gnssON(void) // Enable power for the GNSS
71+
{
72+
am_hal_gpio_pincfg_t pinCfg = g_AM_HAL_GPIO_OUTPUT; // Begin by making the gnssEN pin an open-drain output
73+
pinCfg.eGPOutcfg = AM_HAL_GPIO_PIN_OUTCFG_OPENDRAIN;
74+
pin_config(PinName(gnssEN), pinCfg);
75+
delay(1);
76+
77+
digitalWrite(gnssEN, LOW); // Enable GNSS power (HIGH = disable; LOW = enable)
78+
}
79+
7080
void gnssOFF(void) // Disable power for the GNSS
7181
{
72-
pinMode(gnssEN, INPUT_PULLUP); // Configure the pin which enables power for the ZOE-M8Q GNSS
82+
am_hal_gpio_pincfg_t pinCfg = g_AM_HAL_GPIO_OUTPUT; // Begin by making the gnssEN pin an open-drain output
83+
pinCfg.eGPOutcfg = AM_HAL_GPIO_PIN_OUTCFG_OPENDRAIN;
84+
pin_config(PinName(gnssEN), pinCfg);
85+
delay(1);
86+
7387
digitalWrite(gnssEN, HIGH); // Disable GNSS power (HIGH = disable; LOW = enable)
7488
}
7589

Software/examples/Example11_Ring/Example11_Ring.ino

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,23 @@
6464
// Declare the IridiumSBD object (including the sleep (ON/OFF) and Ring Indicator pins)
6565
IridiumSBD modem(Serial1, iridiumSleep, iridiumRI);
6666

67+
void gnssON(void) // Enable power for the GNSS
68+
{
69+
am_hal_gpio_pincfg_t pinCfg = g_AM_HAL_GPIO_OUTPUT; // Begin by making the gnssEN pin an open-drain output
70+
pinCfg.eGPOutcfg = AM_HAL_GPIO_PIN_OUTCFG_OPENDRAIN;
71+
pin_config(PinName(gnssEN), pinCfg);
72+
delay(1);
73+
74+
digitalWrite(gnssEN, LOW); // Enable GNSS power (HIGH = disable; LOW = enable)
75+
}
76+
6777
void gnssOFF(void) // Disable power for the GNSS
6878
{
69-
pinMode(gnssEN, INPUT_PULLUP); // Configure the pin which enables power for the ZOE-M8Q GNSS
79+
am_hal_gpio_pincfg_t pinCfg = g_AM_HAL_GPIO_OUTPUT; // Begin by making the gnssEN pin an open-drain output
80+
pinCfg.eGPOutcfg = AM_HAL_GPIO_PIN_OUTCFG_OPENDRAIN;
81+
pin_config(PinName(gnssEN), pinCfg);
82+
delay(1);
83+
7084
digitalWrite(gnssEN, HIGH); // Disable GNSS power (HIGH = disable; LOW = enable)
7185
}
7286

Software/examples/Example1_Blink/Example1_Blink.ino

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,23 @@
4040
// Make sure you do not have gnssEN and iridiumPwrEN enabled at the same time!
4141
// If you do, bad things might happen to the AS179 RF switch!
4242

43+
void gnssON(void) // Enable power for the GNSS
44+
{
45+
am_hal_gpio_pincfg_t pinCfg = g_AM_HAL_GPIO_OUTPUT; // Begin by making the gnssEN pin an open-drain output
46+
pinCfg.eGPOutcfg = AM_HAL_GPIO_PIN_OUTCFG_OPENDRAIN;
47+
pin_config(PinName(gnssEN), pinCfg);
48+
delay(1);
49+
50+
digitalWrite(gnssEN, LOW); // Enable GNSS power (HIGH = disable; LOW = enable)
51+
}
52+
4353
void gnssOFF(void) // Disable power for the GNSS
4454
{
45-
pinMode(gnssEN, INPUT_PULLUP); // Configure the pin which enables power for the ZOE-M8Q GNSS
55+
am_hal_gpio_pincfg_t pinCfg = g_AM_HAL_GPIO_OUTPUT; // Begin by making the gnssEN pin an open-drain output
56+
pinCfg.eGPOutcfg = AM_HAL_GPIO_PIN_OUTCFG_OPENDRAIN;
57+
pin_config(PinName(gnssEN), pinCfg);
58+
delay(1);
59+
4660
digitalWrite(gnssEN, HIGH); // Disable GNSS power (HIGH = disable; LOW = enable)
4761
}
4862

Software/examples/Example2_BusVoltage/Example2_BusVoltage.ino

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,23 @@
4444
// Make sure you do not have gnssEN and iridiumPwrEN enabled at the same time!
4545
// If you do, bad things might happen to the AS179 RF switch!
4646

47+
void gnssON(void) // Enable power for the GNSS
48+
{
49+
am_hal_gpio_pincfg_t pinCfg = g_AM_HAL_GPIO_OUTPUT; // Begin by making the gnssEN pin an open-drain output
50+
pinCfg.eGPOutcfg = AM_HAL_GPIO_PIN_OUTCFG_OPENDRAIN;
51+
pin_config(PinName(gnssEN), pinCfg);
52+
delay(1);
53+
54+
digitalWrite(gnssEN, LOW); // Enable GNSS power (HIGH = disable; LOW = enable)
55+
}
56+
4757
void gnssOFF(void) // Disable power for the GNSS
4858
{
49-
pinMode(gnssEN, INPUT_PULLUP); // Configure the pin which enables power for the ZOE-M8Q GNSS
59+
am_hal_gpio_pincfg_t pinCfg = g_AM_HAL_GPIO_OUTPUT; // Begin by making the gnssEN pin an open-drain output
60+
pinCfg.eGPOutcfg = AM_HAL_GPIO_PIN_OUTCFG_OPENDRAIN;
61+
pin_config(PinName(gnssEN), pinCfg);
62+
delay(1);
63+
5064
digitalWrite(gnssEN, HIGH); // Disable GNSS power (HIGH = disable; LOW = enable)
5165
}
5266

Software/examples/Example3_PHT/Example3_PHT.ino

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,23 @@ TwoWire agtWire(9,8); //Create an I2C port using pads 8 (SCL) and 9 (SDA)
4848
//Create an instance of the MS8607 object
4949
MS8607 barometricSensor;
5050

51+
void gnssON(void) // Enable power for the GNSS
52+
{
53+
am_hal_gpio_pincfg_t pinCfg = g_AM_HAL_GPIO_OUTPUT; // Begin by making the gnssEN pin an open-drain output
54+
pinCfg.eGPOutcfg = AM_HAL_GPIO_PIN_OUTCFG_OPENDRAIN;
55+
pin_config(PinName(gnssEN), pinCfg);
56+
delay(1);
57+
58+
digitalWrite(gnssEN, LOW); // Enable GNSS power (HIGH = disable; LOW = enable)
59+
}
60+
5161
void gnssOFF(void) // Disable power for the GNSS
5262
{
53-
pinMode(gnssEN, INPUT_PULLUP); // Configure the pin which enables power for the ZOE-M8Q GNSS
63+
am_hal_gpio_pincfg_t pinCfg = g_AM_HAL_GPIO_OUTPUT; // Begin by making the gnssEN pin an open-drain output
64+
pinCfg.eGPOutcfg = AM_HAL_GPIO_PIN_OUTCFG_OPENDRAIN;
65+
pin_config(PinName(gnssEN), pinCfg);
66+
delay(1);
67+
5468
digitalWrite(gnssEN, HIGH); // Disable GNSS power (HIGH = disable; LOW = enable)
5569
}
5670

Software/examples/Example4_ExternalPHT/Example4_ExternalPHT.ino

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,23 @@ TwoWire qwiic(40,39); //Will use Artemis pads 39 (SCL) and 40 (SDA)
4949
//Create an instance of the MS8607 object
5050
MS8607 barometricSensor;
5151

52+
void gnssON(void) // Enable power for the GNSS
53+
{
54+
am_hal_gpio_pincfg_t pinCfg = g_AM_HAL_GPIO_OUTPUT; // Begin by making the gnssEN pin an open-drain output
55+
pinCfg.eGPOutcfg = AM_HAL_GPIO_PIN_OUTCFG_OPENDRAIN;
56+
pin_config(PinName(gnssEN), pinCfg);
57+
delay(1);
58+
59+
digitalWrite(gnssEN, LOW); // Enable GNSS power (HIGH = disable; LOW = enable)
60+
}
61+
5262
void gnssOFF(void) // Disable power for the GNSS
5363
{
54-
pinMode(gnssEN, INPUT_PULLUP); // Configure the pin which enables power for the ZOE-M8Q GNSS
64+
am_hal_gpio_pincfg_t pinCfg = g_AM_HAL_GPIO_OUTPUT; // Begin by making the gnssEN pin an open-drain output
65+
pinCfg.eGPOutcfg = AM_HAL_GPIO_PIN_OUTCFG_OPENDRAIN;
66+
pin_config(PinName(gnssEN), pinCfg);
67+
delay(1);
68+
5569
digitalWrite(gnssEN, HIGH); // Disable GNSS power (HIGH = disable; LOW = enable)
5670
}
5771

Software/examples/Example7_GetIMEI/Example7_GetIMEI.ino

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,23 @@
6464
// Declare the IridiumSBD object (including the sleep (ON/OFF) and Ring Indicator pins)
6565
IridiumSBD modem(Serial1, iridiumSleep, iridiumRI);
6666

67+
void gnssON(void) // Enable power for the GNSS
68+
{
69+
am_hal_gpio_pincfg_t pinCfg = g_AM_HAL_GPIO_OUTPUT; // Begin by making the gnssEN pin an open-drain output
70+
pinCfg.eGPOutcfg = AM_HAL_GPIO_PIN_OUTCFG_OPENDRAIN;
71+
pin_config(PinName(gnssEN), pinCfg);
72+
delay(1);
73+
74+
digitalWrite(gnssEN, LOW); // Enable GNSS power (HIGH = disable; LOW = enable)
75+
}
76+
6777
void gnssOFF(void) // Disable power for the GNSS
6878
{
69-
pinMode(gnssEN, INPUT_PULLUP); // Configure the pin which enables power for the ZOE-M8Q GNSS
79+
am_hal_gpio_pincfg_t pinCfg = g_AM_HAL_GPIO_OUTPUT; // Begin by making the gnssEN pin an open-drain output
80+
pinCfg.eGPOutcfg = AM_HAL_GPIO_PIN_OUTCFG_OPENDRAIN;
81+
pin_config(PinName(gnssEN), pinCfg);
82+
delay(1);
83+
7084
digitalWrite(gnssEN, HIGH); // Disable GNSS power (HIGH = disable; LOW = enable)
7185
}
7286

Software/examples/Example8_CheckCSQ/Example8_CheckCSQ.ino

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,23 @@
6464
// Declare the IridiumSBD object (including the sleep (ON/OFF) and Ring Indicator pins)
6565
IridiumSBD modem(Serial1, iridiumSleep, iridiumRI);
6666

67+
void gnssON(void) // Enable power for the GNSS
68+
{
69+
am_hal_gpio_pincfg_t pinCfg = g_AM_HAL_GPIO_OUTPUT; // Begin by making the gnssEN pin an open-drain output
70+
pinCfg.eGPOutcfg = AM_HAL_GPIO_PIN_OUTCFG_OPENDRAIN;
71+
pin_config(PinName(gnssEN), pinCfg);
72+
delay(1);
73+
74+
digitalWrite(gnssEN, LOW); // Enable GNSS power (HIGH = disable; LOW = enable)
75+
}
76+
6777
void gnssOFF(void) // Disable power for the GNSS
6878
{
69-
pinMode(gnssEN, INPUT_PULLUP); // Configure the pin which enables power for the ZOE-M8Q GNSS
79+
am_hal_gpio_pincfg_t pinCfg = g_AM_HAL_GPIO_OUTPUT; // Begin by making the gnssEN pin an open-drain output
80+
pinCfg.eGPOutcfg = AM_HAL_GPIO_PIN_OUTCFG_OPENDRAIN;
81+
pin_config(PinName(gnssEN), pinCfg);
82+
delay(1);
83+
7084
digitalWrite(gnssEN, HIGH); // Disable GNSS power (HIGH = disable; LOW = enable)
7185
}
7286

Software/examples/Example9_GetTime/Example9_GetTime.ino

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,23 @@
7171
// Declare the IridiumSBD object
7272
IridiumSBD modem(Serial1, iridiumSleep, iridiumRI);
7373

74+
void gnssON(void) // Enable power for the GNSS
75+
{
76+
am_hal_gpio_pincfg_t pinCfg = g_AM_HAL_GPIO_OUTPUT; // Begin by making the gnssEN pin an open-drain output
77+
pinCfg.eGPOutcfg = AM_HAL_GPIO_PIN_OUTCFG_OPENDRAIN;
78+
pin_config(PinName(gnssEN), pinCfg);
79+
delay(1);
80+
81+
digitalWrite(gnssEN, LOW); // Enable GNSS power (HIGH = disable; LOW = enable)
82+
}
83+
7484
void gnssOFF(void) // Disable power for the GNSS
7585
{
76-
pinMode(gnssEN, INPUT_PULLUP); // Configure the pin which enables power for the ZOE-M8Q GNSS
86+
am_hal_gpio_pincfg_t pinCfg = g_AM_HAL_GPIO_OUTPUT; // Begin by making the gnssEN pin an open-drain output
87+
pinCfg.eGPOutcfg = AM_HAL_GPIO_PIN_OUTCFG_OPENDRAIN;
88+
pin_config(PinName(gnssEN), pinCfg);
89+
delay(1);
90+
7791
digitalWrite(gnssEN, HIGH); // Disable GNSS power (HIGH = disable; LOW = enable)
7892
}
7993

24 Bytes
Binary file not shown.
208 Bytes
Binary file not shown.
184 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)