mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-14 04:18:56 +00:00
more board_api.h rename
This commit is contained in:
parent
cf91660cee
commit
a5768f52b4
@ -24,11 +24,11 @@
|
||||
* This file is part of the TinyUSB stack.
|
||||
*/
|
||||
|
||||
#ifndef _BSP_BOARD_H_
|
||||
#define _BSP_BOARD_H_
|
||||
#ifndef _BOARD_API_H_
|
||||
#define _BOARD_API_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
@ -62,40 +62,36 @@ uint32_t board_button_read(void);
|
||||
|
||||
// Get characters from UART
|
||||
// Return number of read bytes
|
||||
int board_uart_read(uint8_t* buf, int len);
|
||||
int board_uart_read(uint8_t *buf, int len);
|
||||
|
||||
// Send characters to UART
|
||||
// Return number of sent bytes
|
||||
int board_uart_write(void const * buf, int len);
|
||||
int board_uart_write(void const *buf, int len);
|
||||
|
||||
#if CFG_TUSB_OS == OPT_OS_NONE
|
||||
// Get current milliseconds, must be implemented when no RTOS is used
|
||||
uint32_t board_millis(void);
|
||||
// Get current milliseconds, must be implemented when no RTOS is used
|
||||
uint32_t board_millis(void);
|
||||
|
||||
#elif CFG_TUSB_OS == OPT_OS_FREERTOS
|
||||
static inline uint32_t board_millis(void)
|
||||
{
|
||||
return ( ( ((uint64_t) xTaskGetTickCount()) * 1000) / configTICK_RATE_HZ );
|
||||
}
|
||||
static inline uint32_t board_millis(void) {
|
||||
return ( ( ((uint64_t) xTaskGetTickCount()) * 1000) / configTICK_RATE_HZ );
|
||||
}
|
||||
|
||||
#elif CFG_TUSB_OS == OPT_OS_MYNEWT
|
||||
static inline uint32_t board_millis(void)
|
||||
{
|
||||
return os_time_ticks_to_ms32( os_time_get() );
|
||||
}
|
||||
static inline uint32_t board_millis(void) {
|
||||
return os_time_ticks_to_ms32( os_time_get() );
|
||||
}
|
||||
|
||||
#elif CFG_TUSB_OS == OPT_OS_PICO
|
||||
#include "pico/time.h"
|
||||
static inline uint32_t board_millis(void)
|
||||
{
|
||||
return to_ms_since_boot(get_absolute_time());
|
||||
}
|
||||
#include "pico/time.h"
|
||||
static inline uint32_t board_millis(void) {
|
||||
return to_ms_since_boot(get_absolute_time());
|
||||
}
|
||||
|
||||
#elif CFG_TUSB_OS == OPT_OS_RTTHREAD
|
||||
static inline uint32_t board_millis(void)
|
||||
{
|
||||
return (((uint64_t)rt_tick_get()) * 1000 / RT_TICK_PER_SECOND);
|
||||
}
|
||||
static inline uint32_t board_millis(void) {
|
||||
return (((uint64_t)rt_tick_get()) * 1000 / RT_TICK_PER_SECOND);
|
||||
}
|
||||
|
||||
#else
|
||||
#error "board_millis() is not implemented for this OS"
|
||||
@ -104,22 +100,18 @@ int board_uart_write(void const * buf, int len);
|
||||
//--------------------------------------------------------------------+
|
||||
// Helper functions
|
||||
//--------------------------------------------------------------------+
|
||||
static inline void board_led_on(void)
|
||||
{
|
||||
static inline void board_led_on(void) {
|
||||
board_led_write(true);
|
||||
}
|
||||
|
||||
static inline void board_led_off(void)
|
||||
{
|
||||
static inline void board_led_off(void) {
|
||||
board_led_write(false);
|
||||
}
|
||||
|
||||
// TODO remove
|
||||
static inline void board_delay(uint32_t ms)
|
||||
{
|
||||
static inline void board_delay(uint32_t ms) {
|
||||
uint32_t start_ms = board_millis();
|
||||
while (board_millis() - start_ms < ms)
|
||||
{
|
||||
while ( board_millis() - start_ms < ms ) {
|
||||
#if CFG_TUD_ENABLED
|
||||
// take chance to run usb background
|
||||
tud_task();
|
||||
@ -131,7 +123,7 @@ static inline void board_delay(uint32_t ms)
|
||||
int board_getchar(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -24,7 +24,7 @@
|
||||
* This file is part of the TinyUSB stack.
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
#include "broadcom/cpu.h"
|
||||
|
@ -24,7 +24,7 @@
|
||||
* This file is part of the TinyUSB stack.
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
#include "broadcom/cpu.h"
|
||||
|
@ -24,7 +24,7 @@
|
||||
* This file is part of the TinyUSB stack.
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
#include <ft900.h>
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include "debug_uart.h"
|
||||
#include "ch32v30x.h"
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -24,7 +24,7 @@
|
||||
* This file is part of the TinyUSB stack.
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include <hal/hal_gpio.h>
|
||||
#include <mcu/mcu.h>
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
* This file is part of the TinyUSB stack.
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include <hal/hal_gpio.h>
|
||||
#include <mcu/mcu.h>
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
* This file is part of the TinyUSB stack.
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
#include "esp_rom_gpio.h"
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include <malloc.h>
|
||||
#include <irqflags.h>
|
||||
#include <f1c100s-irq.h>
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
extern void sys_uart_putc(char c);
|
||||
|
@ -24,7 +24,7 @@
|
||||
* This file is part of the TinyUSB stack.
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
// Suppress warning caused by mcu driver
|
||||
|
@ -25,7 +25,7 @@
|
||||
* This file is part of the TinyUSB stack.
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
#include "fsl_gpio.h"
|
||||
#include "fsl_port.h"
|
||||
|
@ -25,7 +25,7 @@
|
||||
* This file is part of the TinyUSB stack.
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
#include "fsl_gpio.h"
|
||||
#include "fsl_port.h"
|
||||
|
@ -25,7 +25,7 @@
|
||||
* This file is part of the TinyUSB stack.
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
#include "fsl_smc.h"
|
||||
#include "fsl_gpio.h"
|
||||
|
@ -23,7 +23,7 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
#include "fsl_device_registers.h"
|
||||
#include "fsl_gpio.h"
|
||||
|
@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include "chip.h"
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Forward USB interrupt events to TinyUSB IRQ Handler
|
||||
|
@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include "chip.h"
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Forward USB interrupt events to TinyUSB IRQ Handler
|
||||
|
@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include "chip.h"
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include "chip.h"
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
#ifdef BOARD_TUD_RHPORT
|
||||
|
@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include "chip.h"
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "fsl_iocon.h"
|
||||
#include "fsl_usart.h"
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
#ifdef BOARD_TUD_RHPORT
|
||||
|
@ -24,7 +24,7 @@
|
||||
* This file is part of the TinyUSB stack.
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
#include "fsl_device_registers.h"
|
||||
#include "fsl_gpio.h"
|
||||
|
@ -24,7 +24,7 @@
|
||||
* This file is part of the TinyUSB stack.
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "fsl_device_registers.h"
|
||||
#include "fsl_gpio.h"
|
||||
#include "fsl_lpuart.h"
|
||||
|
@ -24,7 +24,7 @@
|
||||
* This file is part of the TinyUSB stack.
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
#include "msp430.h"
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
* This file is part of the TinyUSB stack.
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
#include "msp.h"
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
* This file is part of the TinyUSB stack.
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
// Suppress warning caused by mcu driver
|
||||
|
@ -24,7 +24,7 @@
|
||||
* This file is part of the TinyUSB stack.
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "NuMicro.h"
|
||||
#include "clk.h"
|
||||
#include "sys.h"
|
||||
|
@ -24,7 +24,7 @@
|
||||
* This file is part of the TinyUSB stack.
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "NuMicro.h"
|
||||
#include "clk.h"
|
||||
#include "sys.h"
|
||||
|
@ -24,7 +24,7 @@
|
||||
* This file is part of the TinyUSB stack.
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "NuMicro.h"
|
||||
#include "clk.h"
|
||||
#include "sys.h"
|
||||
|
@ -24,7 +24,7 @@
|
||||
* This file is part of the TinyUSB stack.
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "NUC100Series.h"
|
||||
#include "clk.h"
|
||||
#include "sys.h"
|
||||
|
@ -24,7 +24,7 @@
|
||||
* This file is part of the TinyUSB stack.
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "NUC505Series.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -45,7 +45,7 @@
|
||||
#include "r_ioport_api.h"
|
||||
#include "renesas.h"
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
/* Key code for writing PRCR register. */
|
||||
|
@ -52,7 +52,7 @@
|
||||
* regarding downloading.
|
||||
*/
|
||||
|
||||
#include "../board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "iodefine.h"
|
||||
#include "interrupt_handlers.h"
|
||||
|
||||
|
@ -50,7 +50,7 @@
|
||||
* regarding downloading.
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "iodefine.h"
|
||||
#include "interrupt_handlers.h"
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include "sam.h"
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
#include "hal/include/hal_gpio.h"
|
||||
|
@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include "sam.h"
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
#include "hal/include/hal_gpio.h"
|
||||
|
@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include "sam.h"
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
#include "hal/include/hal_gpio.h"
|
||||
|
@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
#include <sam.h>
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
|
||||
#include <hal/include/hal_gpio.h>
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
#include <sam.h>
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
|
||||
#include <hal/include/hal_gpio.h>
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
#include "sam.h"
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
|
||||
#include "peripheral_clk_config.h"
|
||||
#include "hpl/usart/hpl_usart_base.h"
|
||||
|
@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
#include "sam.h"
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
|
||||
#include "peripheral_clk_config.h"
|
||||
#include "hpl/usart/hpl_usart_base.h"
|
||||
|
@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
#include "sam.h"
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
|
||||
#include "peripheral_clk_config.h"
|
||||
#include "hal/include/hal_init.h"
|
||||
|
@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include "sam.h"
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
#include "hal/include/hal_gpio.h"
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include <arch/board/board.h>
|
||||
#include <arch/chip/pin.h>
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* MACRO TYPEDEF CONSTANT ENUM
|
||||
|
@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include "stm32f0xx_hal.h"
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include "stm32f1xx_hal.h"
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -24,7 +24,7 @@
|
||||
* This file is part of the TinyUSB stack.
|
||||
*/
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
|
||||
#include "stm32f2xx_hal.h"
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include "stm32f4xx_hal.h"
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -27,7 +27,7 @@
|
||||
*/
|
||||
|
||||
#include "stm32f7xx_hal.h"
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
#include "stm32g0xx_hal.h"
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "stm32g4xx_hal.h"
|
||||
#include "stm32g4xx_ll_bus.h"
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -28,7 +28,7 @@
|
||||
*/
|
||||
|
||||
#include "stm32h7xx_hal.h"
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include "stm32l0xx_hal.h"
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
#include "stm32u5xx_hal.h"
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include "stm32wbxx_hal.h"
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "TM4C123.h"
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include "xmc_scu.h"
|
||||
#include "xmc_uart.h"
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "board.h"
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user