27 #include <libopencm3/stm32/rcc.h> 28 #include <libopencm3/stm32/gpio.h> 29 #include <libopencm3/stm32/usart.h> 30 #include <libopencm3/cm3/nvic.h> 31 #include <libopencmsis/core_cm3.h> 47 #define RS485_RE_PORT C 48 #define RS485_RE_PIN 13 49 #define RS485_DE_PORT C 50 #define RS485_DE_PIN 14 53 #define RS485_BAUDRATE 1200 79 rcc_periph_clock_enable(RCC_AFIO);
library for RS-485/RS-422 communication (API)
#define RCC_GPIO(x)
get RCC for GPIO based on GPIO identifier
#define RS485_RE_PORT
RS-485 pin to enable receiver (active low, pulled up)
global definitions and methods (API)
#define GPIO(x)
get GPIO based on GPIO identifier
#define RS485_DE_PORT
RS-485 pin to enable driver (active high, pulled low)
#define RS485_RE_PIN
RS-485 pin to enable receiver (active low, pulled up)
#define USART(x)
get USART based on USART identifier
#define RS485_DE_PIN
RS-485 pin to enable driver (active high, pulled low)
#define USART_PORT(x)
get port for USART based on USART identifier
#define USART_PORT_RCC(x)
get RCC for USART port based on USART identifier
#define RS485_USART
USART peripheral.
size_t printf(const char *format,...)
print format string on user output
#define RS485_BAUDRATE
serial baudrate, in bits per second (with 8N1 8 bits, no parity bit, 1 stop bit settings) ...
printing utilities to replace the large printf from the standard library (API)
#define USART_RCC(x)
get RCC for USART based on USART identifier
#define USART_PIN_RX(x)
get receive pin for USART based on USART identifier
#define USART_PIN_TX(x)
get transmit pin for USART based on USART identifier
void rs485_setup(void)
transmit and receive buffer sizes