Skip to content

Commit 1c78f3a

Browse files
committed
Update variants to latest logicrom core
Signed-off-by: Ajay Bhargav <[email protected]>
1 parent 14df10d commit 1c78f3a

File tree

6 files changed

+56
-52
lines changed

6 files changed

+56
-52
lines changed

variants/m66/variant.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2020 SiWi Embedded Solutions. All right reserved.
2+
Copyright (c) 2021 WAYBYTE Solutions. All right reserved.
33
44
This library is free software; you can redistribute it and/or
55
modify it under the terms of the GNU Lesser General Public
@@ -23,9 +23,9 @@ int g_ioHandles[GPIO_PIN_MAX];
2323
int g_ioModes[GPIO_PIN_MAX];
2424

2525
static const uint32_t adc_channel_map[4][2] = {
26-
{GPIO_1, ADC_CH1},
27-
{GPIO_7, ADC_CH2},
28-
{GPIO_8, ADC_CH3},
26+
{GPIO_0, ADC_CH1},
27+
{GPIO_6, ADC_CH2},
28+
{GPIO_7, ADC_CH3},
2929
{GPIO_PIN_MAX, ADC_CH0},
3030
};
3131

@@ -41,7 +41,7 @@ int pin2adc_channel(uint32_t pin)
4141

4242
int pin2pwm_channel(uint32_t pin)
4343
{
44-
if (pin == GPIO_1)
44+
if (pin == GPIO_0)
4545
return PWM_CH0;
4646

4747
return -1;
@@ -91,7 +91,7 @@ static void urc_callback(unsigned int param1, unsigned int param2)
9191
case URC_CFUN_STATE_IND:
9292
break;
9393
case URC_COMING_CALL_IND:
94-
debug(DBG_OFF, "Incoming voice call from: %s\n", ((ST_ComingCall *)param2)->phoneNumber);
94+
debug(DBG_OFF, "Incoming voice call from: %s\n", ((struct callinfo_t *)param2)->phoneNumber);
9595
/* Take action here, Answer/Hang-up */
9696
break;
9797
case URC_CALL_STATE_IND:
@@ -139,6 +139,6 @@ static void urc_callback(unsigned int param1, unsigned int param2)
139139

140140
void variant_init(void)
141141
{
142-
/* Initialize Siwi system task */
143-
siwilib_init(DEFAULT_STDIO_PORT, urc_callback);
142+
/* Initialize LogicROM */
143+
logicrom_init(DEFAULT_STDIO_PORT, urc_callback);
144144
}

variants/m66/variant.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@
2424

2525
/* Analog Pin definition */
2626
#define A0 GPIO_PIN_MAX
27-
#define A1 GPIO_1
28-
#define A2 GPIO_7
29-
#define A3 GPIO_8
27+
#define A1 GPIO_0
28+
#define A2 GPIO_6
29+
#define A3 GPIO_7
3030

3131
/* LED */
32-
#define LED_BUILTIN GPIO_1
32+
#define LED_BUILTIN GPIO_0
3333

3434
/*
3535
* SPI Interfaces
3636
*/
3737
#define SPI_INTERFACES_COUNT 1
38-
#define PIN_SPI_SS0 (GPIO_9)
39-
#define PIN_SPI_MISO (GPIO_10)
40-
#define PIN_SPI_SCK (GPIO_11)
41-
#define PIN_SPI_MOSI (GPIO_12)
38+
#define PIN_SPI_SS0 (GPIO_8)
39+
#define PIN_SPI_MISO (GPIO_9)
40+
#define PIN_SPI_SCK (GPIO_10)
41+
#define PIN_SPI_MOSI (GPIO_11)
4242
#define BOARD_SPI_SS0 (PIN_SPI_SS0)
4343

4444
static const uint8_t SS = BOARD_SPI_SS0;

variants/mc60/variant.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2020 SiWi Embedded Solutions. All right reserved.
2+
Copyright (c) 2021 WAYBYTE Solutions. All right reserved.
33
44
This library is free software; you can redistribute it and/or
55
modify it under the terms of the GNU Lesser General Public
@@ -23,15 +23,15 @@ int g_ioHandles[GPIO_PIN_MAX];
2323
int g_ioModes[GPIO_PIN_MAX];
2424

2525
static const uint32_t adc_channel_map[6][2] = {
26-
{GPIO_1, ADC_CH1},
27-
{GPIO_27, ADC_CH2},
28-
{GPIO_28, ADC_CH3},
26+
{GPIO_0, ADC_CH1},
27+
{GPIO_26, ADC_CH2},
28+
{GPIO_27, ADC_CH3},
2929
{GPIO_PIN_MAX, ADC_CH0},
3030
};
3131

3232
static const uint32_t pwm_channel_map[2][2] = {
33-
{GPIO_1, PWM_CH0},
34-
{GPIO_32, PWM_CH1},
33+
{GPIO_0, PWM_CH0},
34+
{GPIO_31, PWM_CH1},
3535
};
3636

3737
int pin2adc_channel(uint32_t pin)
@@ -98,7 +98,7 @@ static void urc_callback(unsigned int param1, unsigned int param2)
9898
case URC_CFUN_STATE_IND:
9999
break;
100100
case URC_COMING_CALL_IND:
101-
debug(DBG_OFF, "Incoming voice call from: %s\n", ((ST_ComingCall *)param2)->phoneNumber);
101+
debug(DBG_OFF, "Incoming voice call from: %s\n", ((struct callinfo_t *)param2)->phoneNumber);
102102
/* Take action here, Answer/Hang-up */
103103
break;
104104
case URC_CALL_STATE_IND:
@@ -146,6 +146,6 @@ static void urc_callback(unsigned int param1, unsigned int param2)
146146

147147
void variant_init(void)
148148
{
149-
/* Initialize Siwi system task */
150-
siwilib_init(DEFAULT_STDIO_PORT, urc_callback);
149+
/* Initialize LogicROM */
150+
logicrom_init(DEFAULT_STDIO_PORT, urc_callback);
151151
}

variants/mc60/variant.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@
2424

2525
/* Analog Pin definition */
2626
#define A0 GPIO_PIN_MAX
27-
#define A1 GPIO_1
28-
#define A2 GPIO_27
29-
#define A3 GPIO_28
27+
#define A1 GPIO_0
28+
#define A2 GPIO_26
29+
#define A3 GPIO_27
3030

3131
/* LED */
32-
#define LED_BUILTIN GPIO_1
32+
#define LED_BUILTIN GPIO_0
3333

3434
/*
3535
* SPI Interfaces
3636
*/
3737
#define SPI_INTERFACES_COUNT 1
38-
#define PIN_SPI_SS0 (GPIO_7)
39-
#define PIN_SPI_MISO (GPIO_8)
40-
#define PIN_SPI_SCK (GPIO_9)
41-
#define PIN_SPI_MOSI (GPIO_10)
38+
#define PIN_SPI_SS0 (GPIO_6)
39+
#define PIN_SPI_MISO (GPIO_7)
40+
#define PIN_SPI_SCK (GPIO_8)
41+
#define PIN_SPI_MOSI (GPIO_9)
4242
#define BOARD_SPI_SS0 (PIN_SPI_SS0)
4343

4444
static const uint8_t SS = BOARD_SPI_SS0;

variants/s20u/variant.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2020 SiWi Embedded Solutions. All right reserved.
2+
Copyright (c) 2021 WAYBYTE Solutions. All right reserved.
33
44
This library is free software; you can redistribute it and/or
55
modify it under the terms of the GNU Lesser General Public
@@ -23,17 +23,19 @@ int g_ioHandles[GPIO_PIN_MAX];
2323
int g_ioModes[GPIO_PIN_MAX];
2424

2525
static const uint32_t adc_channel_map[6][2] = {
26-
{GPIO_1, ADC_CH1},
27-
{GPIO_21, ADC_CH2},
28-
{GPIO_31, ADC_CH3},
29-
{GPIO_32, ADC_CH4},
26+
{GPIO_0, ADC_CH1},
27+
{GPIO_20, ADC_CH2},
28+
{GPIO_30, ADC_CH3},
29+
{GPIO_31, ADC_CH4},
3030
{GPIO_PIN_MAX, ADC_CH0},
31+
#ifdef PLATFORM_M56
3132
{GPIO_PIN_MAX + 1, ADC_CH5},
33+
#endif
3234
};
3335

3436
static const uint32_t pwm_channel_map[2][2] = {
35-
{GPIO_1, PWM_CH0},
36-
{GPIO_36, PWM_CH1},
37+
{GPIO_0, PWM_CH0},
38+
{GPIO_35, PWM_CH1},
3739
};
3840

3941
int pin2adc_channel(uint32_t pin)
@@ -100,7 +102,7 @@ static void urc_callback(unsigned int param1, unsigned int param2)
100102
case URC_CFUN_STATE_IND:
101103
break;
102104
case URC_COMING_CALL_IND:
103-
debug(DBG_OFF, "Incoming voice call from: %s\n", ((ST_ComingCall *)param2)->phoneNumber);
105+
debug(DBG_OFF, "Incoming voice call from: %s\n", ((struct callinfo_t *)param2)->phoneNumber);
104106
/* Take action here, Answer/Hang-up */
105107
break;
106108
case URC_CALL_STATE_IND:
@@ -148,6 +150,6 @@ static void urc_callback(unsigned int param1, unsigned int param2)
148150

149151
void variant_init(void)
150152
{
151-
/* Initialize Siwi system task */
152-
siwilib_init(DEFAULT_STDIO_PORT, urc_callback);
153+
/* Initialize LogicROM */
154+
logicrom_init(DEFAULT_STDIO_PORT, urc_callback);
153155
}

variants/s20u/variant.h

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,25 @@
2424

2525
/* Analog Pin definition */
2626
#define A0 GPIO_PIN_MAX
27-
#define A1 GPIO_1
28-
#define A2 GPIO_21
29-
#define A3 GPIO_31
30-
#define A4 GPIO_32
27+
#define A1 GPIO_0
28+
#define A2 GPIO_20
29+
#define A3 GPIO_30
30+
#define A4 GPIO_31
31+
#ifdef PLATFORM_M56
3132
#define A5 (GPIO_PIN_MAX + 1)
33+
#endif
3234

3335
/* LED */
34-
#define LED_BUILTIN GPIO_1
36+
#define LED_BUILTIN GPIO_0
3537

3638
/*
3739
* SPI Interfaces
3840
*/
3941
#define SPI_INTERFACES_COUNT 1
40-
#define PIN_SPI_SS0 (GPIO_7)
41-
#define PIN_SPI_MOSI (GPIO_10)
42-
#define PIN_SPI_MISO (GPIO_8)
43-
#define PIN_SPI_SCK (GPIO_9)
42+
#define PIN_SPI_SS0 (GPIO_6)
43+
#define PIN_SPI_MOSI (GPIO_9)
44+
#define PIN_SPI_MISO (GPIO_7)
45+
#define PIN_SPI_SCK (GPIO_8)
4446
#define BOARD_SPI_SS0 (PIN_SPI_SS0)
4547

4648
static const uint8_t SS = BOARD_SPI_SS0;

0 commit comments

Comments
 (0)