Skip to content

Commit f1295b9

Browse files
authored
Merge pull request #11573 from felser/add_413_dragonfly
Add 413 dragonfly
2 parents ad891d9 + dd778c4 commit f1295b9

File tree

10 files changed

+1096
-2
lines changed

10 files changed

+1096
-2
lines changed

components/storage/blockdevice/COMPONENT_SPIF/mbed_lib.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@
7373
"SPI_MISO": "SPI3_MISO",
7474
"SPI_CLK": "SPI3_SCK",
7575
"SPI_CS": "SPI_CS1"
76+
},
77+
"MTS_DRAGONFLY_F413RH": {
78+
"SPI_MOSI": "SPI3_MOSI",
79+
"SPI_MISO": "SPI3_MISO",
80+
"SPI_CLK": "SPI3_SCK",
81+
"SPI_CS": "SPI_CS1"
7682
}
7783
}
7884
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2018 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+
17+
#if MBED_CONF_NSAPI_PRESENT
18+
19+
#include "cellular/onboard_modem_api.h"
20+
#include "UARTSerial.h"
21+
#include "ONBOARD_TELIT_HE910.h"
22+
#include "ThisThread.h"
23+
#include "CellularLog.h"
24+
25+
using namespace mbed;
26+
27+
ONBOARD_TELIT_HE910::ONBOARD_TELIT_HE910(FileHandle *fh) : TELIT_HE910(fh)
28+
{
29+
}
30+
31+
nsapi_error_t ONBOARD_TELIT_HE910::hard_power_on()
32+
{
33+
::onboard_modem_init();
34+
return NSAPI_ERROR_OK;
35+
}
36+
37+
nsapi_error_t ONBOARD_TELIT_HE910::hard_power_off()
38+
{
39+
::onboard_modem_deinit();
40+
return NSAPI_ERROR_OK;
41+
}
42+
43+
nsapi_error_t ONBOARD_TELIT_HE910::soft_power_on()
44+
{
45+
::onboard_modem_power_up();
46+
// From Telit_xE910 Global form factor App note: It is mandatory to avoid sending data to the serial ports during the first 200ms of the module start-up.
47+
rtos::ThisThread::sleep_for(200);
48+
return NSAPI_ERROR_OK;
49+
}
50+
51+
nsapi_error_t ONBOARD_TELIT_HE910::soft_power_off()
52+
{
53+
::onboard_modem_power_down();
54+
return NSAPI_ERROR_OK;
55+
}
56+
57+
CellularDevice *CellularDevice::get_target_default_instance()
58+
{
59+
static UARTSerial serial(MDMTXD, MDMRXD, 115200);
60+
#if DEVICE_SERIAL_FC
61+
if (MDMRTS != NC && MDMCTS != NC) {
62+
tr_debug("Modem flow control: RTS %d CTS %d", MDMRTS, MDMCTS);
63+
serial.set_flow_control(SerialBase::RTSCTS, MDMRTS, MDMCTS);
64+
}
65+
#endif
66+
static ONBOARD_TELIT_HE910 device(&serial);
67+
return &device;
68+
}
69+
70+
#endif // MBED_CONF_NSAPI_PRESENT
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2018 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+
17+
#ifndef ONBOARD_TELIT_HE910_
18+
#define ONBOARD_TELIT_HE910_
19+
20+
#include "TELIT_HE910.h"
21+
22+
namespace mbed {
23+
24+
class ONBOARD_TELIT_HE910 : public TELIT_HE910 {
25+
public:
26+
ONBOARD_TELIT_HE910(FileHandle *fh);
27+
28+
virtual nsapi_error_t hard_power_on();
29+
virtual nsapi_error_t hard_power_off();
30+
virtual nsapi_error_t soft_power_on();
31+
virtual nsapi_error_t soft_power_off();
32+
};
33+
34+
} // namespace mbed
35+
36+
#endif // ONBOARD_TELIT_HE910_
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2016 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_PERIPHERALNAMES_H
17+
#define MBED_PERIPHERALNAMES_H
18+
19+
#include "cmsis.h"
20+
21+
#ifdef __cplusplus
22+
extern "C" {
23+
#endif
24+
25+
typedef enum {
26+
ADC_1 = (int)ADC1_BASE
27+
} ADCName;
28+
29+
typedef enum {
30+
DAC_1 = (int)DAC_BASE
31+
} DACName;
32+
33+
typedef enum {
34+
UART_1 = (int)USART1_BASE,
35+
UART_2 = (int)USART2_BASE,
36+
UART_3 = (int)USART3_BASE,
37+
UART_4 = (int)UART4_BASE,
38+
UART_5 = (int)UART5_BASE,
39+
UART_6 = (int)USART6_BASE,
40+
UART_7 = (int)UART7_BASE,
41+
UART_8 = (int)UART8_BASE,
42+
UART_9 = (int)UART9_BASE,
43+
UART_10 = (int)UART10_BASE
44+
} UARTName;
45+
46+
typedef enum {
47+
SPI_1 = (int)SPI1_BASE,
48+
SPI_2 = (int)SPI2_BASE,
49+
SPI_3 = (int)SPI3_BASE,
50+
SPI_4 = (int)SPI4_BASE,
51+
SPI_5 = (int)SPI5_BASE
52+
} SPIName;
53+
54+
typedef enum {
55+
I2C_1 = (int)I2C1_BASE,
56+
I2C_2 = (int)I2C2_BASE,
57+
I2C_3 = (int)I2C3_BASE,
58+
FMPI2C_1 = (int)FMPI2C1_BASE
59+
} I2CName;
60+
61+
typedef enum {
62+
PWM_1 = (int)TIM1_BASE,
63+
PWM_2 = (int)TIM2_BASE,
64+
PWM_3 = (int)TIM3_BASE,
65+
PWM_4 = (int)TIM4_BASE,
66+
PWM_5 = (int)TIM5_BASE,
67+
PWM_8 = (int)TIM8_BASE,
68+
PWM_9 = (int)TIM9_BASE,
69+
PWM_10 = (int)TIM10_BASE,
70+
PWM_11 = (int)TIM11_BASE,
71+
PWM_12 = (int)TIM12_BASE,
72+
PWM_13 = (int)TIM13_BASE,
73+
PWM_14 = (int)TIM14_BASE
74+
} PWMName;
75+
76+
typedef enum {
77+
CAN_1 = (int)CAN1_BASE,
78+
CAN_2 = (int)CAN2_BASE,
79+
CAN_3 = (int)CAN3_BASE
80+
} CANName;
81+
82+
typedef enum {
83+
QSPI_1 = (int)QSPI_R_BASE,
84+
} QSPIName;
85+
86+
#ifdef __cplusplus
87+
}
88+
#endif
89+
90+
#endif

0 commit comments

Comments
 (0)