You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
2.1 KiB
C

#ifndef __CONF_SERCOM_H__
#define __CONF_SERCOM_H__
#define CONF_SERCOM_0_ENABLE (0)
#define CONF_SERCOM_1_ENABLE (0)
#define CONF_SERCOM_2_ENABLE (0)
#define CONF_SERCOM_3_ENABLE (0)
#define CONF_SERCOM_4_ENABLE (0)
#define CONF_SERCOM_5_ENABLE (0)
#define CONF_SERCOM_6_ENABLE (0)
#define CONF_SERCOM_7_ENABLE (0)
#define CONF_SERCOM_0_USART_ENABLE 1
#define CONF_SERCOM_0_USART_RXEN 1
#define CONF_SERCOM_0_USART_TXEN 1
#define CONF_SERCOM_0_USART_PARITY 0
#define CONF_SERCOM_0_USART_CHSIZE 0
#define CONF_SERCOM_0_USART_SBMODE 0
#define CONF_SERCOM_0_USART_BAUD 115200
#define CONF_SERCOM_0_USART_ADVANCED_CONFIG 0
#define CONF_SERCOM_0_USART_RUNSTANDBY 0
#define CONF_SERCOM_0_USART_IBON 0
#define CONF_SERCOM_0_USART_SFDE 0
#define CONF_SERCOM_0_USART_CLODEN 0
#define CONF_SERCOM_0_USART_MODE 0x1
#define CONF_SERCOM_0_USART_SAMPR 0x0
#define CONF_SERCOM_0_USART_SAMPA 0x0
#define CONF_SERCOM_0_USART_DORD 1
#define CONF_SERCOM_0_USART_CPOL 0
#define CONF_SERCOM_0_USART_ENC 0
#define CONF_SERCOM_0_USART_LIN_SLAVE_ENABLE 0
#define CONF_SERCOM_0_USART_DEBUG_STOP_MODE 0
#define CONF_SERCOM_0_USART_INACK 0x0
#define CONF_SERCOM_0_USART_DSNACK 0x0
#define CONF_SERCOM_0_USART_MAXITER 0x7
#define CONF_SERCOM_0_USART_GTIME 0x2
#define CONF_SERCOM_0_USART_RXINV 0x0
#define CONF_SERCOM_0_USART_TXINV 0x0
#define CONF_SERCOM_0_USART_CMODE 1
#define CONF_SERCOM_0_USART_RXPO 1 // RX is on PIN_PA05
#define CONF_SERCOM_0_USART_TXPO 0
#if CONF_SERCOM_0_USART_LIN_SLAVE_ENABLE == 1
#if CONF_SERCOM_0_USART_PARITY == 0
#define CONF_SERCOM_0_USART_PMODE 0
#define CONF_SERCOM_0_USART_FORM 4
#else
#define CONF_SERCOM_0_USART_PMODE CONF_SERCOM_0_USART_PARITY - 1
#define CONF_SERCOM_0_USART_FORM 5
#endif
#else
#if CONF_SERCOM_0_USART_PARITY == 0
#define CONF_SERCOM_0_USART_PMODE 0
#define CONF_SERCOM_0_USART_FORM 0
#else
#define CONF_SERCOM_0_USART_PMODE CONF_SERCOM_0_USART_PARITY - 1
#define CONF_SERCOM_0_USART_FORM 1
#endif
#endif
#if CONF_SERCOM_0_USART_SAMPR == 0
#define CONF_SERCOM_0_USART_BAUD_RATE \
(65536 - ((65536 * 16.0f * CONF_SERCOM_0_USART_BAUD) / CONF_GCLK_SERCOM0_CORE_FREQUENCY))