Onewire-uart for B-L072Z-LRWAN1 board
gilbertoe opened this issue · 3 comments
Hi
I am porting the onewire-uart package to the B-L072Z-LRWAN1 LoRa® / Sigfox ™ Discovery card. This card is powered by an STM32L072CZ microcontroller. The application is based on Semtech's loramac-node stack and I intend to integrate the onewire-uart into it.
I have already modified the cmake files in order to compile the application. So far so good. However, there is an error with the ONEWIRE_TX_PORT_CLK_EN macro because the LL_AHB1_GRP1_PERIPH_GPIOA is not defined in the STM32 low level drivers.
Please advise
Gilberto
Yes, these are for L4 series originally as you included that in the project. Now you need to know which UART you want and what are the pins related with that UART.
Yes, these are for L4 series originally as you included that in the project. Now you need to know which UART you want and what are the pins related with that UART.
Hi
The onewire interface is going to use UART1, pins PA9(TX) and PA10(RX).
A new code would look like this
/* USART */
#define ONEWIRE_USART USART1
#define ONEWIRE_USART_CLK_EN LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_USART1)
/* USART TX PIN */
#define ONEWIRE_TX_PORT GPIOA
#define ONEWIRE_TX_PORT_CLK_EN LL_IOP_GRP1_EnableClock(LL_IOP_GRP1_PERIPH_GPIOA)
#define ONEWIRE_TX_PIN LL_GPIO_PIN_9
#define ONEWIRE_TX_PIN_AF LL_GPIO_AF_4
/* USART RX PIN */
#define ONEWIRE_RX_PORT GPIOA
#define ONEWIRE_RX_PORT_CLK_EN LL_IOP_GRP1_EnableClock(LL_IOP_GRP1_PERIPH_GPIOA)
#define ONEWIRE_RX_PIN LL_GPIO_PIN_10
#define ONEWIRE_RX_PIN_AF LL_GPIO_AF_4
A driver has been added for L0xx series: https://github.com/MaJerle/onewire-uart/blob/develop/onewire_uart/src/system/ow_ll_stm32l0xx.c