Skip to content

Add LoRa pins definition for DISCO_L072CZ_LRWAN1 #221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions variants/DISCO_L072CZ_LRWAN1/PeripheralPins.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ const PinMap PinMap_UART_CTS[] = {

#ifdef HAL_SPI_MODULE_ENABLED
const PinMap PinMap_SPI_MOSI[] = {
// {PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, // Not available on board
{PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, // RADIO_MOSI_PORT
{PA_12, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
{PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
{PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI2)},
Expand All @@ -202,7 +202,7 @@ const PinMap PinMap_SPI_MOSI[] = {

#ifdef HAL_SPI_MODULE_ENABLED
const PinMap PinMap_SPI_MISO[] = {
// {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, // Not available on board
{PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, // RADIO_MISO_PORT
{PA_11, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
// {PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, // Not available on board
{PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI2)},
Expand All @@ -214,7 +214,7 @@ const PinMap PinMap_SPI_MISO[] = {
#ifdef HAL_SPI_MODULE_ENABLED
const PinMap PinMap_SPI_SCLK[] = {
{PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
// {PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, // Not available on board
{PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, // RADIO_SCLK_PORT
// {PB_10, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, // Not available on board
{PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI2)},
{NC, NP, 0}
Expand All @@ -224,7 +224,7 @@ const PinMap PinMap_SPI_SCLK[] = {
#ifdef HAL_SPI_MODULE_ENABLED
const PinMap PinMap_SPI_SSEL[] = {
{PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
// {PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, // Not available on board
{PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, // RADIO_NSS_PORT
{PB_9, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
{PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI2)},
{NC, NP, 0}
Expand Down
13 changes: 11 additions & 2 deletions variants/DISCO_L072CZ_LRWAN1/variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,20 @@ const PinName digitalPin[] = {
PA_11, //D25
PA_0, //D26/A0
PA_0, //D27/A1 - alias for A0 - requires closing solder bridge SB7
PA_4, //D28/A2
PA_4, //D28/A2 - RADIO_DIO_5_PORT
PA_4, //D29/A3 - alias for A2 - requires closing solder bridge SB8
PB_9, //D30/A4 - requires closing solder bridge SB11
PB_8, //D31/A5 - requires closing solder bridge SB12
PA_5, //D32/A6
PA_5, //D32/A6 - RADIO_DIO_4_PORT
PC_0, //D33 - RADIO_RESET_PORT
PA_7, //D34 - RADIO_MOSI_PORT
PA_6, //D35 - RADIO_MISO_PORT
PB_3, //D36 - RADIO_SCLK_PORT
PA_15, //D37 - RADIO_NSS_PORT
PB_4, //D38 - RADIO_DIO_0_PORT
PB_1, //D39 - RADIO_DIO_1_PORT
PB_0, //D40 - RADIO_DIO_2_PORT
PC_13, //D41 - RADIO_DIO_3_PORT
};

#ifdef __cplusplus
Expand Down
32 changes: 27 additions & 5 deletions variants/DISCO_L072CZ_LRWAN1/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,25 @@ enum {
PA11, //D25
PA0, //D26/A0
PA0_2,//D27/A1 - alias for A0 - requires closing solder bridge SB7
PA4, //D28/A2
PA4, //D28/A2 - RADIO_DIO_5_PORT
PA4_2,//D29/A3 - alias for A2 - requires closing solder bridge SB8
PB9_2,//D30/A4 - requires closing solder bridge SB11
PB8_2,//D31/A5 - requires closing solder bridge SB12
PA5, //D32/A6
PA5, //D32/A6 - RADIO_DIO_4_PORT
PC0, //D33 - RADIO_RESET_PORT
PA7, //D34 - RADIO_MOSI_PORT
PA6, //D35 - RADIO_MISO_PORT
PB3, //D36 - RADIO_SCLK_PORT
PA15, //D37 - RADIO_NSS_PORT
PB4, //D38 - RADIO_DIO_0_PORT
PB1, //D39 - RADIO_DIO_1_PORT
PB0, //D40 - RADIO_DIO_2_PORT
PC13, //D41 - RADIO_DIO_3_PORT
PEND
};

// This must be a literal with the same value as PEND
#define NUM_DIGITAL_PINS 33
#define NUM_DIGITAL_PINS 42
// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS
#define NUM_ANALOG_INPUTS 7
#define NUM_ANALOG_FIRST 26
Expand All @@ -92,8 +101,21 @@ enum {
// On-board user button
#define USER_BTN 6

// Timer Definitions
// Do not use timer used by PWM pins when possible. See PinMap_PWM.
// LORA
#define RADIO_RESET_PORT PC0
#define RADIO_MOSI_PORT PA7
#define RADIO_MISO_PORT PA6
#define RADIO_SCLK_PORT PB3
#define RADIO_NSS_PORT PA15
#define RADIO_DIO_0_PORT PB4
#define RADIO_DIO_1_PORT PB1
#define RADIO_DIO_2_PORT PB0
#define RADIO_DIO_3_PORT PC13
#define RADIO_DIO_4_PORT PA5
#define RADIO_DIO_5_PORT PA4

//Timer Definitions
//Do not use timer used by PWM pins when possible. See PinMap_PWM.
#define TIMER_TONE TIM22

// Do not use basic timer: OC is required
Expand Down