Browse code

Add modified LPM3_EXIT_ISR to work around FLL IRQ wake-up problem

Nils Faerber authored on 06/07/2013 21:19:55
Showing 1 changed files
... ...
@@ -12,17 +12,18 @@
12 12
 #define BT_IO_POUT		P1OUT
13 13
 #define BT_IO_PIN		P1IN
14 14
 #define BT_IO_PDIR		P1DIR
15
+#define BT_IO_REN		P1REN
15 16
 
16 17
 #define BT_IO_PIN1		BIT5
17 18
 #define BT_IO_PIN2		BIT6
18
-#define BT_IO_CLKREQ		BIT4
19
+#define BT_IO_CLKREQ	BIT4
19 20
 
20 21
 #define BT_SHUTDOWN()		{ BT_RST_POUT &= ~BT_RST_PIN; }
21
-#define BT_ENABLE()		{ BT_RST_POUT |= BT_RST_PIN; }
22
+#define BT_ENABLE()			{ BT_RST_POUT |= BT_RST_PIN; }
22 23
 
23 24
 #define BT_UART_PSEL		P5SEL
24 25
 #define BT_UART_PDIR		P5DIR
25
-#define BT_UART_REN		P5REN
26
+#define BT_UART_REN			P5REN
26 27
 #define BT_UART_POUT		P5OUT
27 28
 #define BT_UART_TX_PIN		BIT6
28 29
 #define BT_UART_RX_PIN		BIT7
... ...
@@ -56,7 +57,7 @@ typedef enum {
56 57
 
57 58
 void mw_init_bt_uart(const bt_uart_baud_t baud);
58 59
 
59
-void mw_bt_uart_tx(const void *buf, const unsigned int len);
60
+int mw_bt_uart_tx(const void *buf, const unsigned int len);
60 61
 // extern char BT_UART_RX_CHAR;
61 62
 
62 63
 int mw_bt_get_rxbuf_len(void);
Browse code

Power saving changes, add new fonts, bitmaps and screens

Nils Faerber authored on 19/05/2013 00:07:04
Showing 1 changed files
... ...
@@ -59,6 +59,7 @@ void mw_init_bt_uart(const bt_uart_baud_t baud);
59 59
 void mw_bt_uart_tx(const void *buf, const unsigned int len);
60 60
 // extern char BT_UART_RX_CHAR;
61 61
 
62
+int mw_bt_get_rxbuf_len(void);
62 63
 const unsigned char *mw_bt_get_rx_buf(unsigned char **rpos, unsigned char *len);
63 64
 unsigned char bt_feed_packet_data(unsigned char pdata);
64 65
 uint8_t mw_bt_is_enabled(void);
Browse code

Here we are! MetaWatch support in Oswald!

Nils Faerber authored on 27/04/2013 20:22:32
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,65 @@
1
+#ifndef _MW_BT_H
2
+#define _MW_BT_H
3
+
4
+#define BT_RST_PIN		BIT3
5
+#define BT_RST_PSEL		P10SEL
6
+#define BT_RST_POUT		P10OUT
7
+#define BT_RST_PDIR		P10DIR
8
+
9
+#define BT_IO_PSEL		P1SEL
10
+#define BT_IO_RTS		BIT0
11
+#define BT_IO_CTS		BIT3
12
+#define BT_IO_POUT		P1OUT
13
+#define BT_IO_PIN		P1IN
14
+#define BT_IO_PDIR		P1DIR
15
+
16
+#define BT_IO_PIN1		BIT5
17
+#define BT_IO_PIN2		BIT6
18
+#define BT_IO_CLKREQ		BIT4
19
+
20
+#define BT_SHUTDOWN()		{ BT_RST_POUT &= ~BT_RST_PIN; }
21
+#define BT_ENABLE()		{ BT_RST_POUT |= BT_RST_PIN; }
22
+
23
+#define BT_UART_PSEL		P5SEL
24
+#define BT_UART_PDIR		P5DIR
25
+#define BT_UART_REN		P5REN
26
+#define BT_UART_POUT		P5OUT
27
+#define BT_UART_TX_PIN		BIT6
28
+#define BT_UART_RX_PIN		BIT7
29
+
30
+#define CONFIG_BT_PINS() { \
31
+	BT_RST_PSEL &= ~BT_RST_PIN; \
32
+	BT_RST_PDIR |= BT_RST_PIN; \
33
+	BT_SHUTDOWN(); \
34
+	BT_IO_PSEL &= ~(BT_IO_RTS | BT_IO_CTS | BT_IO_PIN1 | BT_IO_PIN2 | BT_IO_CLKREQ); \
35
+	BT_IO_PDIR &= ~(BT_IO_RTS | BT_IO_CTS | BT_IO_PIN1 | BT_IO_PIN2 | BT_IO_CLKREQ); \
36
+	BT_IO_POUT &= ~(BT_IO_RTS | BT_IO_CTS | BT_IO_PIN1 | BT_IO_PIN2 | BT_IO_CLKREQ); \
37
+	BT_UART_PSEL &= ~(BT_UART_TX_PIN | BT_UART_RX_PIN); \
38
+	BT_UART_PDIR &= ~(BT_UART_TX_PIN | BT_UART_RX_PIN); \
39
+	BT_UART_REN |= BT_UART_TX_PIN | BT_UART_RX_PIN; \
40
+	BT_UART_POUT |= BT_UART_TX_PIN | BT_UART_RX_PIN; \
41
+}
42
+
43
+void mw_enable_bt(void);
44
+void mw_disable_bt(void);
45
+
46
+typedef enum {
47
+	BT_UART_BD19200 = 0,
48
+	BT_UART_BD38400,
49
+	BT_UART_BD57600,
50
+	BT_UART_BD115200,
51
+	BT_UART_BD234000,
52
+} bt_uart_baud_t;
53
+
54
+#define BT_MW_DEVICE_CLASS	0x842704 /* Limited discovery, Rendering, Information, Wearable, Wrist Watch */
55
+#define BT_RX_MAX_SIZE		255
56
+
57
+void mw_init_bt_uart(const bt_uart_baud_t baud);
58
+
59
+void mw_bt_uart_tx(const void *buf, const unsigned int len);
60
+// extern char BT_UART_RX_CHAR;
61
+
62
+const unsigned char *mw_bt_get_rx_buf(unsigned char **rpos, unsigned char *len);
63
+unsigned char bt_feed_packet_data(unsigned char pdata);
64
+uint8_t mw_bt_is_enabled(void);
65
+#endif