forked from LairdCP/RM1xx-Applications
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlp.low.power.deep.sleep.sb
61 lines (50 loc) · 2.77 KB
/
lp.low.power.deep.sleep.sb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//******************************************************************************
// Laird Technologies (c) 2013
//
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// +++++ ++
// +++++ When UwTerminal downloads the app it will store it as a filenname ++
// +++++ which consists of all characters up to the first . and excluding it ++
// +++++ ++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
//
// This small program configures the development board for minimal
// power consumption by setting SIO_6 as digital out, closing the UART,
// putting the LoRa radio to sleep, and finally putting the BLE radio to sleep.
//
// After running this application you should see ~750nA at the current measurement
// header pins J11 pins 1-2. Remove the jumper and place an ammeter in series.
//
// gpiosetfunc(SIO,function,sub function)
//
//******************************************************************************
//******************************************************************************
// Definitions
//******************************************************************************
//******************************************************************************
// Library Import
//******************************************************************************
//******************************************************************************
// Global Variable Declarations
//******************************************************************************
dim rc //Declare rc as a variable (result code)
//******************************************************************************
// Function and Subroutine definitions
//******************************************************************************
//******************************************************************************
// Handler definitions
//******************************************************************************
//******************************************************************************
// Equivalent to main() in C
//******************************************************************************
rc = gpiosetfunc(6,2,0) //Sets SIO_6 as a digital output set low to keep LED 5 OFF
uartclose() //Closes the UART
rc = LoraMacSleepMode()
//Put module into deep sleep
rc = SystemStateSet(0)
//------------------------------------------------------------------------------
// Wait for a synchronous event.
// An application can have multiple <WaitEvent> statements
//------------------------------------------------------------------------------
waitevent //Waits for an event to happen