Set target C030-R412M in mbed

pull/9369/head
Fahim Alavi 2019-01-14 17:34:50 +05:00
parent 9d4db2b0ea
commit 5caeaed6db
9 changed files with 35 additions and 15 deletions

View File

@ -32,7 +32,7 @@ namespace mbed {
#elif TARGET_MTB_MTS_DRAGONFLY
#define CELLULAR_DEVICE TELIT_HE910
#elif TARGET_UBLOX_C030
#if defined(TARGET_UBLOX_C030_N211) || defined(TARGET_UBLOX_C030_R410M)
#if defined(TARGET_UBLOX_C030_N211) || defined(TARGET_UBLOX_C030_R41XM)
#define CELLULAR_DEVICE UBLOX_AT
#else
#define CELLULAR_DEVICE UBLOX_PPP

View File

@ -23,7 +23,7 @@
using namespace mbed;
using namespace events;
#ifdef TARGET_UBLOX_C030_R410M
#ifdef TARGET_UBLOX_C030_R41XM
static const AT_CellularBase::SupportedFeature unsupported_features[] = {
AT_CellularBase::AT_CGSN_WITH_TYPE,
AT_CellularBase::SUPPORTED_FEATURE_END_MARK
@ -32,7 +32,7 @@ static const AT_CellularBase::SupportedFeature unsupported_features[] = {
UBLOX_AT::UBLOX_AT(FileHandle *fh) : AT_CellularDevice(fh)
{
#ifdef TARGET_UBLOX_C030_R410M
#ifdef TARGET_UBLOX_C030_R41XM
AT_CellularBase::set_unsupported_features(unsupported_features);
#endif
}

View File

@ -50,7 +50,7 @@ void UBLOX_AT_CellularContext::do_connect()
_cb_data.error = NSAPI_ERROR_NO_CONNECTION;
// Attempt to establish a connection
#ifdef TARGET_UBLOX_C030_R410M
#ifdef TARGET_UBLOX_C030_R41XM
_cb_data.error = NSAPI_ERROR_OK;
#else
_cb_data.error = open_data_channel();

View File

@ -54,10 +54,10 @@ nsapi_error_t UBLOX_AT_CellularNetwork::set_access_technology_impl(RadioAccessTe
break;
case RAT_HSDPA_HSUPA:
break;
#elif defined(TARGET_UBLOX_C030_R410M)
#elif defined(TARGET_UBLOX_C030_R41XM)
case RAT_CATM1:
break;
#elif defined(TARGET_UBLOX_C030_R410M) || defined(TARGET_UBLOX_C030_N211)
#elif defined(TARGET_UBLOX_C030_R41XM) || defined(TARGET_UBLOX_C030_N211)
case RAT_NB1:
break;
#endif

View File

@ -42,6 +42,9 @@ const PinMap PinMap_ADC[] = {
{PA_4, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4
{PA_6, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6
{PB_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8
#ifdef TARGET_UBLOX_C030_R412M
{PB_1, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9
#endif
{PC_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10
{PC_2, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC1_IN12
{PC_3, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC1_IN13
@ -80,7 +83,9 @@ const PinMap PinMap_DAC[] = {
const PinMap PinMap_PWM[] = {
{PE_13, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3
{PE_9, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1N
#ifndef TARGET_UBLOX_C030_R412M
{PB_1, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4
#endif
{PD_12, PWM_4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1
{PB_8, PWM_10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1
{PB_15, PWM_12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 2, 0)}, // TIM12_CH2

View File

@ -82,7 +82,7 @@ typedef enum {
// Cellular modem (a DCE)
MDMPWRON = PE_14, // Power (active high)
MDMRST = PB_5, // Reset (active low)
#if defined(TARGET_UBLOX_C030_R410M)
#if defined(TARGET_UBLOX_C030_R41XM)
MDMTXD = PA_9, // Transmit Data
MDMRXD = PA_10, // Receive Data
MDMCTS = PA_11, // Clear to Send
@ -165,7 +165,7 @@ typedef enum {
#ifdef MBED_CONF_TARGET_STDIO_UART_TX
STDIO_UART_TX = MBED_CONF_TARGET_STDIO_UART_TX,
#else
#if defined(TARGET_UBLOX_C030_R410M)
#if defined(TARGET_UBLOX_C030_R41XM)
STDIO_UART_TX = PD_5,
#else
STDIO_UART_TX = PA_9,
@ -174,7 +174,7 @@ typedef enum {
#ifdef MBED_CONF_TARGET_STDIO_UART_RX
STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX,
#else
#if defined(TARGET_UBLOX_C030_R410M)
#if defined(TARGET_UBLOX_C030_R41XM)
STDIO_UART_RX = PD_6,
#else
STDIO_UART_RX = PA_10,

View File

@ -28,7 +28,7 @@ static void press_power_button(int time_us)
{
gpio_t gpio;
#if defined(TARGET_UBLOX_C030_R410M)
#if defined(TARGET_UBLOX_C030_R41XM)
gpio_init_inout(&gpio, MDMPWRON, PIN_OUTPUT, OpenDrain, 0);
#else
gpio_init_out_ex(&gpio, MDMPWRON, 0);
@ -42,21 +42,28 @@ void onboard_modem_init()
{
gpio_t gpio;
#if defined(TARGET_UBLOX_C030_R41XM)
// Set the pin to high so on powerup we can set low
gpio_init_inout(&gpio, MDMPWRON, PIN_OUTPUT, OpenDrain, 1);
#else
// Take us out of reset
gpio_init_out_ex(&gpio, MDMRST, 1);
#endif
}
void onboard_modem_deinit()
{
#ifndef TARGET_UBLOX_C030_R41XM
gpio_t gpio;
// Back into reset
gpio_init_out_ex(&gpio, MDMRST, 0);
#endif
}
void onboard_modem_power_up()
{
#if defined(TARGET_UBLOX_C030_R410M)
#if defined(TARGET_UBLOX_C030_R41XM)
/* keep the power line low for 1 seconds */
press_power_button(1000000);
#else

View File

@ -26,7 +26,7 @@ void ublox_board_init(void) {
// start with modem disabled
gpio_init_out_ex(&gpio, MDMRST, 0);
#if defined(TARGET_UBLOX_C030_R410M)
#if defined(TARGET_UBLOX_C030_R41XM)
gpio_init_inout(&gpio, MDMPWRON, PIN_OUTPUT, OpenDrain, 1);
#else
gpio_init_out_ex(&gpio, MDMPWRON, 0);
@ -34,8 +34,8 @@ void ublox_board_init(void) {
gpio_init_out_ex(&gpio, MDMRTS, 0);
gpio_init_in_ex(&gpio, MDMCURRENTSENSE, PullNone);
#if !defined (TARGET_UBLOX_C030_R410M)
// start with GNSS disabled, this is ONLY TEMPORARY and that once the HW issue with the GNSSEN pin on the R410M board is resolved then this line will become default for all platforms.
#if !defined (TARGET_UBLOX_C030_R41XM)
// start with GNSS disabled, this is ONLY TEMPORARY and that once the HW issue with the GNSSEN pin on the R41XM board is resolved then this line will become default for all platforms.
gpio_init_inout(&gpio, GNSSEN, PIN_OUTPUT, PushPullNoPull, 0);
#endif

View File

@ -4273,10 +4273,18 @@
"inherits": ["UBLOX_C030"],
"release_versions": ["5"]
},
"UBLOX_C030_R410M": {
"UBLOX_C030_R41XM": {
"inherits": ["UBLOX_C030"],
"release_versions": ["5"]
},
"UBLOX_C030_R410M": {
"inherits": ["UBLOX_C030_R41XM"],
"release_versions": ["5"]
},
"UBLOX_C030_R412M": {
"inherits": ["UBLOX_C030_R41XM"],
"release_versions": ["5"]
},
"NZ32_SC151": {
"inherits": ["FAMILY_STM32"],
"core": "Cortex-M3",