tinyusb
board.h
Go to the documentation of this file.
1 /**************************************************************************/
37 /**************************************************************************/
38 
43 #ifndef _TUSB_BOARD_H_
44 #define _TUSB_BOARD_H_
45 
46 #ifdef __cplusplus
47  extern "C" {
48 #endif
49 
50 #include <stdint.h>
51 #include <stdbool.h>
52 
53 #include "ansi_escape.h"
54 #include "tusb.h"
55 
56 //--------------------------------------------------------------------+
57 // BOARD DEFINE
58 //--------------------------------------------------------------------+
61 #define BOARD_LPCXPRESSO11U14 1114
62 #define BOARD_RF1GHZNODE 1100
63 #define BOARD_LPCXPRESSO1347 1300
64 #define BOARD_LPCXPRESSO1769 1700
65 
66 #define BOARD_NGX4330 4300
67 #define BOARD_EA4357 4301
68 #define BOARD_MCB4300 4302
69 #define BOARD_HITEX4350 4303
70 #define BOARD_LPC4357USB 4304
71 
72 #define BOARD_LPCLINK2 4370
73 
75 //--------------------------------------------------------------------+
76 // PRINTF TARGET DEFINE
77 //--------------------------------------------------------------------+
81 #define PRINTF_TARGET_SEMIHOST 1
82 #define PRINTF_TARGET_UART 2
83 #define PRINTF_TARGET_SWO 3
84 #define PRINTF_TARGET_NONE 4
85 
87 #define PRINTF(...) printf(__VA_ARGS__)
88 
89 //--------------------------------------------------------------------+
90 // BOARD INCLUDE
91 //--------------------------------------------------------------------+
92 #if BOARD == BOARD_LPCXPRESSO11U14
94 #elif BOARD == BOARD_RF1GHZNODE
96 #elif BOARD == BOARD_LPCXPRESSO1347
98 #elif BOARD == BOARD_LPCXPRESSO1769
100 #elif BOARD == BOARD_NGX4330
101  #include "ngx/board_ngx4330.h"
102 #elif BOARD == BOARD_EA4357
104 #elif BOARD == BOARD_MCB4300
105  #include "keil/board_mcb4300.h"
106 #elif BOARD == BOARD_HITEX4350
107  #include "hitex/board_hitex4350.h"
108 #elif BOARD == BOARD_LPC4357USB
110 #elif BOARD == BOARD_LPCLINK2
111  #include "lpcxpresso/board_lpclink2.h"
112 #else
113  #error BOARD is not defined or supported yet
114 #endif
115 
116 //--------------------------------------------------------------------+
117 // Common Configuration
118 //--------------------------------------------------------------------+
119 #define CFG_UART_BAUDRATE 115200
120 
121 //--------------------------------------------------------------------+
122 // Board Common API
123 //--------------------------------------------------------------------+
128 void board_init(void);
130 
137 void board_leds(uint32_t on_mask, uint32_t off_mask);
138 
142 uint32_t board_buttons(void);
143 
147 uint8_t board_uart_getchar(void);
148 
152 void board_uart_putchar(uint8_t c);
153 
156 //------------- Board Application -------------//
157 OSAL_TASK_FUNCTION( led_blinking_task , p_task_para);
158 
160 void led_blinking_init(void);
161 
165 void led_blinking_set_interval(uint32_t ms);
166 
167 #ifdef __cplusplus
168  }
169 #endif
170 
171 #endif /* _TUSB_BOARD_H_ */
172 
void led_blinking_init(void)
Initialize the LED blinking task application. The initial blinking rate is 1 Hert (1 per second) ...
Definition: board.c:64
void board_init(void)
Initialize all required peripherals on board including uart, led, buttons etc ... ...
void board_leds(uint32_t on_mask, uint32_t off_mask)
Turns on and off leds on the board.
uint32_t board_buttons(void)
Get the current state of the buttons on the board.
void led_blinking_set_interval(uint32_t ms)
Change the blinking rate.
Definition: board.c:69
void board_uart_putchar(uint8_t c)
Send a character to UART.
uint8_t board_uart_getchar(void)
Get a character input from UART.