File tree Expand file tree Collapse file tree 10 files changed +46
-2
lines changed
libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32 Expand file tree Collapse file tree 10 files changed +46
-2
lines changed Original file line number Diff line number Diff line change 17
17
#include "pinmap.h"
18
18
#include "em_cmu.h"
19
19
#include "mbed_assert.h"
20
+ #include "sleepmodes.h"
20
21
21
22
uint8_t gpio_get_index (gpio_t * obj )
22
23
{
Original file line number Diff line number Diff line change 25
25
#include "em_int.h"
26
26
#include "em_cmu.h"
27
27
#include "sleep_api.h"
28
+ #include "sleepmodes.h"
28
29
29
30
#define NUM_GPIO_CHANNELS (16)
30
31
#define GPIO_LEAST_ACTIVE_SLEEPMODE EM3
Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ static inline int gpio_read(gpio_t *obj)
48
48
}
49
49
}
50
50
51
+ static inline int gpio_is_connected (const gpio_t * obj ) {
52
+ return obj -> pin != (PinName )NC ;
53
+ }
54
+
51
55
#ifdef __cplusplus
52
56
}
53
57
#endif
Original file line number Diff line number Diff line change 24
24
#include "i2c_api.h"
25
25
#include "PeripheralPins.h"
26
26
#include "pinmap_function.h"
27
+ #include "sleepmodes.h"
27
28
28
29
#include "em_i2c.h"
29
30
#include "em_cmu.h"
Original file line number Diff line number Diff line change 22
22
#include "em_cmu.h"
23
23
#include "em_rtc.h"
24
24
#include "sleep_api.h"
25
+ #include "sleepmodes.h"
25
26
26
27
static bool rtc_inited = false;
27
28
static time_t time_base = 0 ;
Original file line number Diff line number Diff line change 36
36
#include "dma_api.h"
37
37
#include "sleep_api.h"
38
38
#include "buffer.h"
39
+ #include "sleepmodes.h"
39
40
40
41
#define SERIAL_LEAST_ACTIVE_SLEEPMODE EM1
41
42
#define SERIAL_LEAST_ACTIVE_SLEEPMODE_LEUART EM2
@@ -227,7 +228,7 @@ inline IRQn_Type serial_get_rx_irq_index(serial_t *obj)
227
228
default :
228
229
MBED_ASSERT (0 );
229
230
}
230
- return 0 ;
231
+ return ( IRQn_Type ) 0 ;
231
232
}
232
233
233
234
/**
@@ -270,7 +271,7 @@ inline IRQn_Type serial_get_tx_irq_index(serial_t *obj)
270
271
default :
271
272
MBED_ASSERT (0 );
272
273
}
273
- return 0 ;
274
+ return ( IRQn_Type ) 0 ;
274
275
}
275
276
276
277
/**
Original file line number Diff line number Diff line change 18
18
#if DEVICE_SLEEP
19
19
20
20
#include "sleep_api.h"
21
+ #include "sleepmodes.h"
21
22
#include "cmsis.h"
22
23
#include "em_emu.h"
23
24
#include "em_int.h"
Original file line number Diff line number Diff line change
1
+ /* mbed Microcontroller Library
2
+ * Copyright (c) 2015 ARM Limited
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ #ifndef MBED_SLEEPMODES_H
17
+ #define MBED_SLEEPMODES_H
18
+
19
+ #include "em_gpio.h"
20
+
21
+ #ifdef __cplusplus
22
+ extern "C" {
23
+ #endif
24
+
25
+ void blockSleepMode (sleepstate_enum minimumMode );
26
+ void unblockSleepMode (sleepstate_enum minimumMode );
27
+
28
+ #ifdef __cplusplus
29
+ }
30
+ #endif
31
+
32
+ #endif
Original file line number Diff line number Diff line change 30
30
#include "em_cmu.h"
31
31
#include "em_dma.h"
32
32
#include "sleep_api.h"
33
+ #include "sleepmodes.h"
33
34
34
35
static uint16_t fill_word = SPI_FILL_WORD ;
35
36
#define SPI_LEAST_ACTIVE_SLEEPMODE EM1
Original file line number Diff line number Diff line change 23
23
#include "device.h"
24
24
#include "clocking.h"
25
25
#include "sleep_api.h"
26
+ #include "sleepmodes.h"
26
27
27
28
#define TIMER_LEAST_ACTIVE_SLEEPMODE EM1
28
29
/**
You can’t perform that action at this time.
0 commit comments