altosui: Add config and pyro tabs to graph widget
[fw/altos] / src / samd21 / samd21.h
index 4a18e757d986d73a2ee4c43891f2803448e3cb17..b101c6b9f3e97c100d803a3c3d938f88a254bb56 100644 (file)
@@ -777,6 +777,16 @@ samd21_port_pmux_set(struct samd21_port *port, uint8_t pin, uint8_t func)
                               (1 << SAMD21_PORT_PINCFG_PMUXEN));
 }
 
+static inline uint8_t
+samd21_port_pmux_get(struct samd21_port *port, uint8_t pin)
+{
+       uint8_t byte = pin >> 1;
+       uint8_t bit = (pin & 1) << 2;
+       uint8_t mask = 0xf << bit;
+       uint8_t value = (uint8_t) ((port->pmux[byte] & mask) >> bit);
+       return value;
+}
+
 static inline void
 samd21_port_pmux_clr(struct samd21_port *port, uint8_t pin)
 {
@@ -860,6 +870,7 @@ struct samd21_adc {
 #define SAMD21_ADC_SWTRIG_START                1
 
 #define SAMD21_ADC_INPUTCTRL_MUXPOS            0
+# define SAMD21_ADC_INPUTCTRL_MUXPOS_TEMP              0x18
 # define SAMD21_ADC_INPUTCTRL_MUXPOS_BANDGAP           0x19
 # define SAMD21_ADC_INPUTCTRL_MUXPOS_SCALEDCOREVCC     0x1a
 # define SAMD21_ADC_INPUTCTRL_MUXPOS_SCALEDIOVCC       0x1b
@@ -1599,7 +1610,14 @@ extern struct samd21_sercom samd21_sercom5;
 #define SAMD21_SERCOM_CTRLA_IBON       8
 #define SAMD21_SERCOM_CTRLA_SAMPR      13
 #define SAMD21_SERCOM_CTRLA_TXPO       16
+#define  SAMD21_SERCOM_CTRLA_TXPO_TX_0                 0
+#define  SAMD21_SERCOM_CTRLA_TXPO_TX_2                 1
+#define  SAMD21_SERCOM_CTRLA_TXPO_TX_0_RTS_2_CTS_3     2
 #define SAMD21_SERCOM_CTRLA_RXPO       20
+#define  SAMD21_SERCOM_CTRLA_RXPO_RX_0                 0
+#define  SAMD21_SERCOM_CTRLA_RXPO_RX_1                 1
+#define  SAMD21_SERCOM_CTRLA_RXPO_RX_2                 2
+#define  SAMD21_SERCOM_CTRLA_RXPO_RX_3                 3
 #define SAMD21_SERCOM_CTRLA_SAMPA      22
 #define SAMD21_SERCOM_CTRLA_FORM       24
 #define SAMD21_SERCOM_CTRLA_CMODE      28