mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-14 04:18:56 +00:00
add new example device_virtual_com
This commit is contained in:
parent
acea45c094
commit
889169d4d0
166
examples/device/device_virtual_com/src/cdc_device_app.c
Normal file
166
examples/device/device_virtual_com/src/cdc_device_app.c
Normal file
@ -0,0 +1,166 @@
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@file cdc_device_app.c
|
||||
@author hathach (tinyusb.org)
|
||||
|
||||
@section LICENSE
|
||||
|
||||
Software License Agreement (BSD License)
|
||||
|
||||
Copyright (c) 2013, hathach (tinyusb.org)
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holders nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
This file is part of the tinyusb stack.
|
||||
*/
|
||||
/**************************************************************************/
|
||||
|
||||
#include "cdc_device_app.h"
|
||||
|
||||
#if TUSB_CFG_DEVICE_CDC
|
||||
|
||||
#include "common/fifo.h" // TODO refractor
|
||||
#include "app_os_prio.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// INCLUDE
|
||||
//--------------------------------------------------------------------+
|
||||
enum { SERIAL_BUFFER_SIZE = 64 };
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// MACRO CONSTANT TYPEDEF
|
||||
//--------------------------------------------------------------------+
|
||||
static osal_semaphore_t sem_hdl;
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// INTERNAL OBJECT & FUNCTION DECLARATION
|
||||
//--------------------------------------------------------------------+
|
||||
TUSB_CFG_ATTR_USBRAM static uint8_t serial_rx_buffer[SERIAL_BUFFER_SIZE];
|
||||
TUSB_CFG_ATTR_USBRAM static uint8_t serial_tx_buffer[SERIAL_BUFFER_SIZE];
|
||||
|
||||
FIFO_DEF(fifo_serial, SERIAL_BUFFER_SIZE, uint8_t, true);
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// tinyusb callbacks
|
||||
//--------------------------------------------------------------------+
|
||||
void cdc_serial_app_mount(uint8_t coreid)
|
||||
{
|
||||
osal_semaphore_reset(sem_hdl);
|
||||
|
||||
tud_cdc_receive(coreid, serial_rx_buffer, SERIAL_BUFFER_SIZE, true);
|
||||
}
|
||||
|
||||
void cdc_serial_app_umount(uint8_t coreid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void tud_cdc_xfer_cb(uint8_t coreid, tusb_event_t event, cdc_pipeid_t pipe_id, uint32_t xferred_bytes)
|
||||
{
|
||||
switch ( pipe_id )
|
||||
{
|
||||
case CDC_PIPE_DATA_OUT:
|
||||
switch(event)
|
||||
{
|
||||
case TUSB_EVENT_XFER_COMPLETE:
|
||||
for(uint8_t i=0; i<xferred_bytes; i++)
|
||||
{
|
||||
fifo_write(&fifo_serial, serial_rx_buffer+i);
|
||||
}
|
||||
osal_semaphore_post(sem_hdl); // notify main task
|
||||
break;
|
||||
|
||||
case TUSB_EVENT_XFER_ERROR:
|
||||
tud_cdc_receive(0, serial_rx_buffer, SERIAL_BUFFER_SIZE, true); // ignore, queue transfer again
|
||||
break;
|
||||
|
||||
case TUSB_EVENT_XFER_STALLED:
|
||||
default :
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case CDC_PIPE_DATA_IN:
|
||||
case CDC_PIPE_NOTIFICATION:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// APPLICATION CODE
|
||||
//--------------------------------------------------------------------+
|
||||
void cdc_serial_app_init(void)
|
||||
{
|
||||
sem_hdl = osal_semaphore_create(1, 0);
|
||||
VERIFY(sem_hdl, );
|
||||
|
||||
osal_task_create(cdc_serial_app_task, "cdc", 128, NULL, CDC_SERIAL_APP_TASK_PRIO);
|
||||
}
|
||||
|
||||
tusb_error_t cdc_serial_subtask(void);
|
||||
|
||||
void cdc_serial_app_task(void* param)
|
||||
{
|
||||
(void) param;
|
||||
|
||||
OSAL_TASK_BEGIN
|
||||
cdc_serial_subtask();
|
||||
OSAL_TASK_END
|
||||
}
|
||||
|
||||
tusb_error_t cdc_serial_subtask(void)
|
||||
{
|
||||
OSAL_SUBTASK_BEGIN
|
||||
|
||||
tusb_error_t error;
|
||||
|
||||
osal_semaphore_wait(sem_hdl, OSAL_TIMEOUT_WAIT_FOREVER, &error);
|
||||
(void) error; // suppress compiler's warnings
|
||||
|
||||
if ( tud_mounted(0) )
|
||||
{
|
||||
// echo back data in the fifo
|
||||
if ( !tud_cdc_busy(0, CDC_PIPE_DATA_IN) )
|
||||
{
|
||||
uint16_t count=0;
|
||||
while( fifo_read(&fifo_serial, &serial_tx_buffer[count]) )
|
||||
{
|
||||
count++;
|
||||
}
|
||||
|
||||
if (count)
|
||||
{
|
||||
tud_cdc_send(0, serial_tx_buffer, count, false);
|
||||
}
|
||||
}
|
||||
|
||||
// getting more data from host
|
||||
tud_cdc_receive(0, serial_rx_buffer, SERIAL_BUFFER_SIZE, true);
|
||||
}
|
||||
|
||||
OSAL_SUBTASK_END
|
||||
}
|
||||
|
||||
#endif
|
80
examples/device/device_virtual_com/src/cdc_device_app.h
Normal file
80
examples/device/device_virtual_com/src/cdc_device_app.h
Normal file
@ -0,0 +1,80 @@
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@file cdc_device_app.h
|
||||
@author hathach (tinyusb.org)
|
||||
|
||||
@section LICENSE
|
||||
|
||||
Software License Agreement (BSD License)
|
||||
|
||||
Copyright (c) 2013, hathach (tinyusb.org)
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holders nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
This file is part of the tinyusb stack.
|
||||
*/
|
||||
/**************************************************************************/
|
||||
|
||||
/** \ingroup TBD
|
||||
* \defgroup TBD
|
||||
* \brief TBD
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef _TUSB_CDCD_DEVICE_APP_H_
|
||||
#define _TUSB_CDCD_DEVICE_APP_H_
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "tusb.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if TUSB_CFG_DEVICE_CDC
|
||||
|
||||
void cdc_serial_app_init(void);
|
||||
void cdc_serial_app_task(void* param);
|
||||
|
||||
void cdc_serial_app_mount(uint8_t coreid);
|
||||
void cdc_serial_app_umount(uint8_t coreid);
|
||||
|
||||
#else
|
||||
|
||||
#define cdc_serial_app_init()
|
||||
#define cdc_serial_app_task(x)
|
||||
#define cdc_serial_app_mount(x)
|
||||
#define cdc_serial_app_umount(x)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _TUSB_CDCD_DEVICE_APP_H_ */
|
||||
|
||||
/** @} */
|
133
examples/device/device_virtual_com/src/main.c
Normal file
133
examples/device/device_virtual_com/src/main.c
Normal file
@ -0,0 +1,133 @@
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@file main.c
|
||||
@author hathach (tinyusb.org)
|
||||
|
||||
@section LICENSE
|
||||
|
||||
Software License Agreement (BSD License)
|
||||
|
||||
Copyright (c) 2013, hathach (tinyusb.org)
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holders nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
This file is part of the tinyusb stack.
|
||||
*/
|
||||
/**************************************************************************/
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// INCLUDE
|
||||
//--------------------------------------------------------------------+
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "tusb.h"
|
||||
|
||||
#include "cdc_device_app.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// MACRO CONSTANT TYPEDEF
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// INTERNAL OBJECT & FUNCTION DECLARATION
|
||||
//--------------------------------------------------------------------+
|
||||
void print_greeting(void);
|
||||
|
||||
#if TUSB_CFG_OS == TUSB_OS_NONE
|
||||
// like a real RTOS, this function is a main loop invoking each task in application and never return
|
||||
void os_none_start_scheduler(void)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
tusb_task_runner();
|
||||
led_blinking_task(NULL);
|
||||
cdc_serial_app_task(NULL);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
int main(void)
|
||||
{
|
||||
board_init();
|
||||
print_greeting();
|
||||
|
||||
tusb_init();
|
||||
|
||||
//------------- application task init -------------//
|
||||
led_blinking_init();
|
||||
cdc_serial_app_init();
|
||||
|
||||
while (1)
|
||||
{
|
||||
tusb_task_runner();
|
||||
|
||||
led_blinking_task(NULL);
|
||||
cdc_serial_app_task(NULL);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// tinyusb callbacks
|
||||
//--------------------------------------------------------------------+
|
||||
void tud_mount_cb(uint8_t coreid)
|
||||
{
|
||||
cdc_serial_app_mount(coreid);
|
||||
}
|
||||
|
||||
void tud_umount_cb(uint8_t coreid)
|
||||
{
|
||||
cdc_serial_app_umount(coreid);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// HELPER FUNCTION
|
||||
//--------------------------------------------------------------------+
|
||||
void print_greeting(void)
|
||||
{
|
||||
char const * const rtos_name[] =
|
||||
{
|
||||
[TUSB_OS_NONE] = "None",
|
||||
[TUSB_OS_FREERTOS] = "FreeRTOS",
|
||||
};
|
||||
|
||||
printf("\n\
|
||||
--------------------------------------------------------------------\n\
|
||||
- Device Demo (a tinyusb example)\n\
|
||||
- if you find any bugs or get any questions, feel free to file an\n\
|
||||
- issue at https://github.com/hathach/tinyusb\n\
|
||||
--------------------------------------------------------------------\n\n"
|
||||
);
|
||||
|
||||
puts("This DEVICE demo is configured to support:");
|
||||
printf(" - RTOS = %s\n", rtos_name[TUSB_CFG_OS]);
|
||||
if (TUSB_CFG_DEVICE_HID_MOUSE ) puts(" - HID Mouse");
|
||||
if (TUSB_CFG_DEVICE_HID_KEYBOARD ) puts(" - HID Keyboard");
|
||||
if (TUSB_CFG_DEVICE_MSC ) puts(" - Mass Storage");
|
||||
if (TUSB_CFG_DEVICE_CDC ) puts(" - Communication Device Class");
|
||||
}
|
121
examples/device/device_virtual_com/src/tusb_config.h
Normal file
121
examples/device/device_virtual_com/src/tusb_config.h
Normal file
@ -0,0 +1,121 @@
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@file tusb_config.h
|
||||
@author hathach (tinyusb.org)
|
||||
|
||||
@section LICENSE
|
||||
|
||||
Software License Agreement (BSD License)
|
||||
|
||||
Copyright (c) 2013, hathach (tinyusb.org)
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holders nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
This file is part of the tinyusb stack.
|
||||
*/
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef _TUSB_TUSB_CONFIG_H_
|
||||
#define _TUSB_TUSB_CONFIG_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// CONTROLLER CONFIGURATION
|
||||
//--------------------------------------------------------------------+
|
||||
//#define TUSB_CFG_MCU will be passed from IDE/command line for easy board/mcu switching
|
||||
|
||||
#define TUSB_CFG_CONTROLLER_0_MODE (TUSB_MODE_DEVICE)
|
||||
//#define TUSB_CFG_CONTROLLER_1_MODE (TUSB_MODE_DEVICE)
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// DEVICE CONFIGURATION
|
||||
//--------------------------------------------------------------------+
|
||||
#define TUSB_CFG_DEVICE_CONTROL_ENDOINT_SIZE 64
|
||||
|
||||
//------------- CLASS -------------//
|
||||
#define TUSB_CFG_DEVICE_HID_KEYBOARD 0
|
||||
#define TUSB_CFG_DEVICE_HID_MOUSE 0
|
||||
#define TUSB_CFG_DEVICE_HID_GENERIC 0 // not supported yet
|
||||
#define TUSB_CFG_DEVICE_MSC 0
|
||||
#define TUSB_CFG_DEVICE_CDC 1
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// COMMON CONFIGURATION
|
||||
//--------------------------------------------------------------------+
|
||||
#define TUSB_CFG_DEBUG 2
|
||||
|
||||
//#define TUSB_CFG_OS TUSB_OS_NONE // be passed from IDE/command line for easy project switching
|
||||
//#define TUSB_CFG_OS_TASK_PRIO 0 // be passed from IDE/command line for easy project switching
|
||||
#define TUSB_CFG_TICKS_HZ 1000
|
||||
|
||||
//#define TUSB_CFG_OS TUSB_OS_NONE
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB RAM PLACEMENT
|
||||
//--------------------------------------------------------------------+
|
||||
#ifdef __CODE_RED // compiled with lpcxpresso
|
||||
|
||||
#if (TUSB_CFG_MCU == MCU_LPC11UXX) || (TUSB_CFG_MCU == MCU_LPC13UXX)
|
||||
#define TUSB_CFG_ATTR_USBRAM ATTR_SECTION(.data.$RAM2) ATTR_ALIGNED(64) // lp11u & lp13u requires data to be 64 byte aligned
|
||||
#elif TUSB_CFG_MCU == MCU_LPC175X_6X
|
||||
#define TUSB_CFG_ATTR_USBRAM // LPC17xx USB DMA can access all
|
||||
#elif (TUSB_CFG_MCU == MCU_LPC43XX)
|
||||
#define TUSB_CFG_ATTR_USBRAM ATTR_SECTION(.data.$RAM3)
|
||||
#endif
|
||||
|
||||
#elif defined __CC_ARM // Compiled with Keil armcc, USBRAM_SECTION is defined in scatter files
|
||||
|
||||
#if (TUSB_CFG_MCU == MCU_LPC11UXX) || (TUSB_CFG_MCU == MCU_LPC13UXX)
|
||||
#define TUSB_CFG_ATTR_USBRAM ATTR_SECTION(USBRAM_SECTION) ATTR_ALIGNED(64) // lp11u & lp13u requires data to be 64 byte aligned
|
||||
#elif (TUSB_CFG_MCU == MCU_LPC175X_6X)
|
||||
#define TUSB_CFG_ATTR_USBRAM // LPC17xx USB DMA can access all address
|
||||
#elif (TUSB_CFG_MCU == MCU_LPC43XX)
|
||||
#define TUSB_CFG_ATTR_USBRAM // Use keil tool configure to have AHB SRAM as default memory
|
||||
#endif
|
||||
|
||||
#elif defined __ICCARM__ // compiled with IAR
|
||||
|
||||
#if (TUSB_CFG_MCU == MCU_LPC11UXX) || (TUSB_CFG_MCU == MCU_LPC13UXX)
|
||||
#define TUSB_CFG_ATTR_USBRAM _Pragma("location=\"USB_PACKET_MEMORY\"") ATTR_ALIGNED(64)
|
||||
#elif (TUSB_CFG_MCU == MCU_LPC175X_6X)
|
||||
#define TUSB_CFG_ATTR_USBRAM
|
||||
#elif (TUSB_CFG_MCU == MCU_LPC43XX)
|
||||
#define TUSB_CFG_ATTR_USBRAM _Pragma("location=\".ahb_sram1\"")
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#error compiler not specified
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _TUSB_TUSB_CONFIG_H_ */
|
475
examples/device/device_virtual_com/src/tusb_descriptors.c
Normal file
475
examples/device/device_virtual_com/src/tusb_descriptors.c
Normal file
@ -0,0 +1,475 @@
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@file tusb_descriptors.c
|
||||
@author hathach (tinyusb.org)
|
||||
|
||||
@section LICENSE
|
||||
|
||||
Software License Agreement (BSD License)
|
||||
|
||||
Copyright (c) 2013, hathach (tinyusb.org)
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holders nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
This file is part of the tinyusb stack.
|
||||
*/
|
||||
/**************************************************************************/
|
||||
|
||||
#include "tusb_descriptors.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Keyboard Report Descriptor
|
||||
//--------------------------------------------------------------------+
|
||||
#if TUSB_CFG_DEVICE_HID_KEYBOARD
|
||||
uint8_t const desc_keyboard_report[] = {
|
||||
HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ),
|
||||
HID_USAGE ( HID_USAGE_DESKTOP_KEYBOARD ),
|
||||
HID_COLLECTION ( HID_COLLECTION_APPLICATION ),
|
||||
HID_USAGE_PAGE ( HID_USAGE_PAGE_KEYBOARD ),
|
||||
HID_USAGE_MIN ( 224 ),
|
||||
HID_USAGE_MAX ( 231 ),
|
||||
HID_LOGICAL_MIN ( 0 ),
|
||||
HID_LOGICAL_MAX ( 1 ),
|
||||
|
||||
HID_REPORT_SIZE ( 1 ),
|
||||
HID_REPORT_COUNT ( 8 ), /* 8 bits */
|
||||
HID_INPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ), /* maskable modifier key */
|
||||
|
||||
HID_REPORT_SIZE ( 8 ),
|
||||
HID_REPORT_COUNT ( 1 ),
|
||||
HID_INPUT ( HID_CONSTANT ), /* reserved */
|
||||
|
||||
HID_USAGE_PAGE ( HID_USAGE_PAGE_LED ),
|
||||
HID_USAGE_MIN ( 1 ),
|
||||
HID_USAGE_MAX ( 5 ),
|
||||
HID_REPORT_COUNT ( 5 ),
|
||||
HID_REPORT_SIZE ( 1 ),
|
||||
HID_OUTPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ), /* 5-bit Led report */
|
||||
|
||||
HID_REPORT_SIZE ( 3 ), /* led padding */
|
||||
HID_REPORT_COUNT ( 1 ),
|
||||
HID_OUTPUT ( HID_CONSTANT ),
|
||||
|
||||
HID_USAGE_PAGE (HID_USAGE_PAGE_KEYBOARD),
|
||||
HID_USAGE_MIN ( 0 ),
|
||||
HID_USAGE_MAX ( 101 ),
|
||||
HID_LOGICAL_MIN ( 0 ),
|
||||
HID_LOGICAL_MAX ( 101 ),
|
||||
|
||||
HID_REPORT_SIZE ( 8 ),
|
||||
HID_REPORT_COUNT ( 6 ),
|
||||
HID_INPUT ( HID_DATA | HID_ARRAY | HID_ABSOLUTE ), /* keycodes array 6 items */
|
||||
HID_COLLECTION_END
|
||||
};
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Mouse Report Descriptor
|
||||
//--------------------------------------------------------------------+
|
||||
#if TUSB_CFG_DEVICE_HID_MOUSE
|
||||
uint8_t const desc_mouse_report[] = {
|
||||
HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ),
|
||||
HID_USAGE ( HID_USAGE_DESKTOP_MOUSE ),
|
||||
HID_COLLECTION ( HID_COLLECTION_APPLICATION ),
|
||||
HID_USAGE (HID_USAGE_DESKTOP_POINTER),
|
||||
|
||||
HID_COLLECTION ( HID_COLLECTION_PHYSICAL ),
|
||||
HID_USAGE_PAGE ( HID_USAGE_PAGE_BUTTON ),
|
||||
HID_USAGE_MIN ( 1 ),
|
||||
HID_USAGE_MAX ( 3 ),
|
||||
HID_LOGICAL_MIN ( 0 ),
|
||||
HID_LOGICAL_MAX ( 1 ),
|
||||
|
||||
HID_REPORT_SIZE ( 1 ),
|
||||
HID_REPORT_COUNT ( 3 ), /* Left, Right and Middle mouse*/
|
||||
HID_INPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ),
|
||||
|
||||
HID_REPORT_SIZE ( 5 ),
|
||||
HID_REPORT_COUNT ( 1 ),
|
||||
HID_INPUT ( HID_CONSTANT ), /* 5 bit padding followed 3 bit buttons */
|
||||
|
||||
HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ),
|
||||
HID_USAGE ( HID_USAGE_DESKTOP_X ),
|
||||
HID_USAGE ( HID_USAGE_DESKTOP_Y ),
|
||||
HID_LOGICAL_MIN ( 0x81 ), /* -127 */
|
||||
HID_LOGICAL_MAX ( 0x7f ), /* 127 */
|
||||
|
||||
HID_REPORT_SIZE ( 8 ),
|
||||
HID_REPORT_COUNT ( 2 ), /* X, Y position */
|
||||
HID_INPUT ( HID_DATA | HID_VARIABLE | HID_RELATIVE ), /* relative values */
|
||||
|
||||
HID_USAGE ( HID_USAGE_DESKTOP_WHEEL ), /* mouse scroll */
|
||||
HID_LOGICAL_MIN ( 0x81 ), /* -127 */
|
||||
HID_LOGICAL_MAX ( 0x7f ), /* 127 */
|
||||
HID_REPORT_COUNT( 1 ),
|
||||
HID_REPORT_SIZE ( 8 ), /* 8-bit value */
|
||||
HID_INPUT ( HID_DATA | HID_VARIABLE | HID_RELATIVE ), /* relative values */
|
||||
|
||||
HID_COLLECTION_END,
|
||||
|
||||
HID_COLLECTION_END
|
||||
};
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB DEVICE DESCRIPTOR
|
||||
//--------------------------------------------------------------------+
|
||||
tusb_descriptor_device_t const desc_device =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_device_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_DEVICE,
|
||||
.bcdUSB = 0x0200,
|
||||
#if TUSB_CFG_DEVICE_CDC
|
||||
// Use Interface Association Descriptor (IAD) for CDC
|
||||
// As required by USB Specs IAD's subclass must be common class (2) and protocol must be IAD (1)
|
||||
.bDeviceClass = TUSB_CLASS_MISC,
|
||||
.bDeviceSubClass = MISC_SUBCLASS_COMMON,
|
||||
.bDeviceProtocol = MISC_PROTOCOL_IAD,
|
||||
#else
|
||||
.bDeviceClass = 0x00,
|
||||
.bDeviceSubClass = 0x00,
|
||||
.bDeviceProtocol = 0x00,
|
||||
#endif
|
||||
|
||||
.bMaxPacketSize0 = TUSB_CFG_DEVICE_CONTROL_ENDOINT_SIZE,
|
||||
|
||||
.idVendor = CFG_VENDORID,
|
||||
.idProduct = CFG_PRODUCTID,
|
||||
.bcdDevice = 0x0100,
|
||||
|
||||
.iManufacturer = 0x01,
|
||||
.iProduct = 0x02,
|
||||
.iSerialNumber = 0x03,
|
||||
|
||||
.bNumConfigurations = 0x01 // TODO multiple configurations
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB COFNIGURATION DESCRIPTOR
|
||||
//--------------------------------------------------------------------+
|
||||
app_descriptor_configuration_t const desc_configuration =
|
||||
{
|
||||
.configuration =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_configuration_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_CONFIGURATION,
|
||||
|
||||
.wTotalLength = sizeof(app_descriptor_configuration_t),
|
||||
.bNumInterfaces = TOTAL_INTEFACES,
|
||||
|
||||
.bConfigurationValue = 1,
|
||||
.iConfiguration = 0x00,
|
||||
.bmAttributes = TUSB_DESC_CONFIG_ATT_BUS_POWER,
|
||||
.bMaxPower = TUSB_DESC_CONFIG_POWER_MA(500)
|
||||
},
|
||||
|
||||
#if TUSB_CFG_DEVICE_CDC
|
||||
// IAD points to CDC Interfaces
|
||||
.cdc_iad =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_association_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE_ASSOCIATION,
|
||||
|
||||
.bFirstInterface = INTERFACE_NO_CDC,
|
||||
.bInterfaceCount = 2,
|
||||
|
||||
.bFunctionClass = TUSB_CLASS_CDC,
|
||||
.bFunctionSubClass = CDC_COMM_SUBCLASS_ABSTRACT_CONTROL_MODEL,
|
||||
.bFunctionProtocol = CDC_COMM_PROTOCOL_ATCOMMAND,
|
||||
.iFunction = 0
|
||||
},
|
||||
|
||||
//------------- CDC Communication Interface -------------//
|
||||
.cdc_comm_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE,
|
||||
.bInterfaceNumber = INTERFACE_NO_CDC,
|
||||
.bAlternateSetting = 0,
|
||||
.bNumEndpoints = 1,
|
||||
.bInterfaceClass = TUSB_CLASS_CDC,
|
||||
.bInterfaceSubClass = CDC_COMM_SUBCLASS_ABSTRACT_CONTROL_MODEL,
|
||||
.bInterfaceProtocol = CDC_COMM_PROTOCOL_ATCOMMAND,
|
||||
.iInterface = 0x00
|
||||
},
|
||||
|
||||
.cdc_header =
|
||||
{
|
||||
.bLength = sizeof(cdc_desc_func_header_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE_CLASS_SPECIFIC,
|
||||
.bDescriptorSubType = CDC_FUNC_DESC_HEADER,
|
||||
.bcdCDC = 0x0120
|
||||
},
|
||||
|
||||
.cdc_call =
|
||||
{
|
||||
.bLength = sizeof(cdc_desc_func_call_management_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE_CLASS_SPECIFIC,
|
||||
.bDescriptorSubType = CDC_FUNC_DESC_CALL_MANAGEMENT,
|
||||
.bmCapabilities = { 0 },
|
||||
.bDataInterface = INTERFACE_NO_CDC+1,
|
||||
},
|
||||
|
||||
.cdc_acm =
|
||||
{
|
||||
.bLength = sizeof(cdc_desc_func_abstract_control_management_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE_CLASS_SPECIFIC,
|
||||
.bDescriptorSubType = CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT,
|
||||
.bmCapabilities = { // 0x02
|
||||
.support_line_request = 1,
|
||||
}
|
||||
},
|
||||
|
||||
.cdc_union =
|
||||
{
|
||||
.bLength = sizeof(cdc_desc_func_union_t), // plus number of
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE_CLASS_SPECIFIC,
|
||||
.bDescriptorSubType = CDC_FUNC_DESC_UNION,
|
||||
.bControlInterface = INTERFACE_NO_CDC,
|
||||
.bSubordinateInterface = INTERFACE_NO_CDC+1,
|
||||
},
|
||||
|
||||
.cdc_endpoint_notification =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = CDC_EDPT_NOTIFICATION_ADDR,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
|
||||
.wMaxPacketSize = { .size = 0x08 },
|
||||
.bInterval = 0x10
|
||||
},
|
||||
|
||||
//------------- CDC Data Interface -------------//
|
||||
.cdc_data_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE,
|
||||
.bInterfaceNumber = INTERFACE_NO_CDC+1,
|
||||
.bAlternateSetting = 0x00,
|
||||
.bNumEndpoints = 2,
|
||||
.bInterfaceClass = TUSB_CLASS_CDC_DATA,
|
||||
.bInterfaceSubClass = 0,
|
||||
.bInterfaceProtocol = 0,
|
||||
.iInterface = 0x04
|
||||
},
|
||||
|
||||
.cdc_endpoint_out =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = CDC_EDPT_DATA_OUT_ADDR,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
.wMaxPacketSize = { .size = CDC_EDPT_DATA_PACKETSIZE },
|
||||
.bInterval = 0
|
||||
},
|
||||
|
||||
.cdc_endpoint_in =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = CDC_EDPT_DATA_IN_ADDR,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
.wMaxPacketSize = { .size = CDC_EDPT_DATA_PACKETSIZE },
|
||||
.bInterval = 0
|
||||
},
|
||||
#endif
|
||||
|
||||
//------------- HID Keyboard -------------//
|
||||
#if TUSB_CFG_DEVICE_HID_KEYBOARD
|
||||
.keyboard_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE,
|
||||
.bInterfaceNumber = INTERFACE_NO_HID_KEYBOARD,
|
||||
.bAlternateSetting = 0x00,
|
||||
.bNumEndpoints = 1,
|
||||
.bInterfaceClass = TUSB_CLASS_HID,
|
||||
.bInterfaceSubClass = HID_SUBCLASS_BOOT,
|
||||
.bInterfaceProtocol = HID_PROTOCOL_KEYBOARD,
|
||||
.iInterface = 0x05
|
||||
},
|
||||
|
||||
.keyboard_hid =
|
||||
{
|
||||
.bLength = sizeof(tusb_hid_descriptor_hid_t),
|
||||
.bDescriptorType = HID_DESC_TYPE_HID,
|
||||
.bcdHID = 0x0111,
|
||||
.bCountryCode = HID_Local_NotSupported,
|
||||
.bNumDescriptors = 1,
|
||||
.bReportType = HID_DESC_TYPE_REPORT,
|
||||
.wReportLength = sizeof(desc_keyboard_report)
|
||||
},
|
||||
|
||||
.keyboard_endpoint =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = HID_KEYBOARD_EDPT_ADDR,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
|
||||
.wMaxPacketSize = { .size = HID_KEYBOARD_EDPT_PACKETSIZE },
|
||||
.bInterval = 0x0A
|
||||
},
|
||||
#endif
|
||||
|
||||
//------------- HID Mouse -------------//
|
||||
#if TUSB_CFG_DEVICE_HID_MOUSE
|
||||
.mouse_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE,
|
||||
.bInterfaceNumber = INTERFACE_NO_HID_MOUSE,
|
||||
.bAlternateSetting = 0x00,
|
||||
.bNumEndpoints = 1,
|
||||
.bInterfaceClass = TUSB_CLASS_HID,
|
||||
.bInterfaceSubClass = HID_SUBCLASS_BOOT,
|
||||
.bInterfaceProtocol = HID_PROTOCOL_MOUSE,
|
||||
.iInterface = 0x06
|
||||
},
|
||||
|
||||
.mouse_hid =
|
||||
{
|
||||
.bLength = sizeof(tusb_hid_descriptor_hid_t),
|
||||
.bDescriptorType = HID_DESC_TYPE_HID,
|
||||
.bcdHID = 0x0111,
|
||||
.bCountryCode = HID_Local_NotSupported,
|
||||
.bNumDescriptors = 1,
|
||||
.bReportType = HID_DESC_TYPE_REPORT,
|
||||
.wReportLength = sizeof(desc_mouse_report)
|
||||
},
|
||||
|
||||
.mouse_endpoint =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = HID_MOUSE_EDPT_ADDR, // TODO
|
||||
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
|
||||
.wMaxPacketSize = { .size = HID_MOUSE_EDPT_PACKETSIZE },
|
||||
.bInterval = 0x0A
|
||||
},
|
||||
#endif
|
||||
|
||||
//------------- Mass Storage -------------//
|
||||
#if TUSB_CFG_DEVICE_MSC
|
||||
.msc_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE,
|
||||
.bInterfaceNumber = INTERFACE_NO_MSC,
|
||||
.bAlternateSetting = 0x00,
|
||||
.bNumEndpoints = 2,
|
||||
.bInterfaceClass = TUSB_CLASS_MSC,
|
||||
.bInterfaceSubClass = MSC_SUBCLASS_SCSI,
|
||||
.bInterfaceProtocol = MSC_PROTOCOL_BOT,
|
||||
.iInterface = 0x07
|
||||
},
|
||||
|
||||
.msc_endpoint_in =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = MSC_EDPT_IN_ADDR,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
.wMaxPacketSize = { .size = MSC_EDPT_PACKETSIZE },
|
||||
.bInterval = 1
|
||||
},
|
||||
|
||||
.msc_endpoint_out =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = MSC_EDPT_OUT_ADDR,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
.wMaxPacketSize = { .size = MSC_EDPT_PACKETSIZE },
|
||||
.bInterval = 1
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// STRING DESCRIPTORS
|
||||
//--------------------------------------------------------------------+
|
||||
#define STRING_LEN_UNICODE(n) (2 + (2*(n))) // also includes 2 byte header
|
||||
#define ENDIAN_BE16_FROM( high, low) ENDIAN_BE16(high << 8 | low)
|
||||
|
||||
// array of pointer to string descriptors
|
||||
uint16_t const * const string_descriptor_arr [] =
|
||||
{
|
||||
[0] = (uint16_t []) { // supported language
|
||||
ENDIAN_BE16_FROM( STRING_LEN_UNICODE(1), TUSB_DESC_TYPE_STRING ),
|
||||
0x0409 // English
|
||||
},
|
||||
|
||||
[1] = (uint16_t []) { // manufacturer
|
||||
ENDIAN_BE16_FROM( STRING_LEN_UNICODE(11), TUSB_DESC_TYPE_STRING),
|
||||
't', 'i', 'n', 'y', 'u', 's', 'b', '.', 'o', 'r', 'g' // len = 11
|
||||
},
|
||||
|
||||
[2] = (uint16_t []) { // product
|
||||
ENDIAN_BE16_FROM( STRING_LEN_UNICODE(14), TUSB_DESC_TYPE_STRING),
|
||||
't', 'i', 'n', 'y', 'u', 's', 'b', ' ', 'd', 'e', 'v', 'i', 'c', 'e' // len = 14
|
||||
},
|
||||
|
||||
[3] = (uint16_t []) { // serials
|
||||
ENDIAN_BE16_FROM( STRING_LEN_UNICODE(4), TUSB_DESC_TYPE_STRING),
|
||||
'1', '2', '3', '4' // len = 4
|
||||
},
|
||||
|
||||
[4] = (uint16_t []) { // CDC Interface
|
||||
ENDIAN_BE16_FROM( STRING_LEN_UNICODE(3), TUSB_DESC_TYPE_STRING),
|
||||
'c', 'd', 'c' // len = 3
|
||||
},
|
||||
|
||||
[5] = (uint16_t []) { // Keyboard Interface
|
||||
ENDIAN_BE16_FROM( STRING_LEN_UNICODE(5), TUSB_DESC_TYPE_STRING),
|
||||
'm', 'o', 'u', 's', 'e' // len = 5
|
||||
},
|
||||
|
||||
[6] = (uint16_t []) { // Keyboard Interface
|
||||
ENDIAN_BE16_FROM( STRING_LEN_UNICODE(8), TUSB_DESC_TYPE_STRING),
|
||||
'k', 'e', 'y', 'b', 'o', 'a', 'r', 'd' // len = 8
|
||||
},
|
||||
|
||||
[7] = (uint16_t []) { // MSC Interface
|
||||
ENDIAN_BE16_FROM( STRING_LEN_UNICODE(3), TUSB_DESC_TYPE_STRING),
|
||||
'm', 's', 'c' // len = 3
|
||||
}
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// TINYUSB Descriptors Pointer (this variable is required by the stack)
|
||||
//--------------------------------------------------------------------+
|
||||
tusbd_descriptor_pointer_t tusbd_descriptor_pointers =
|
||||
{
|
||||
.p_device = (uint8_t const * ) &desc_device,
|
||||
.p_configuration = (uint8_t const * ) &desc_configuration,
|
||||
.p_string_arr = (uint8_t const **) string_descriptor_arr,
|
||||
|
||||
#if TUSB_CFG_DEVICE_HID_KEYBOARD
|
||||
.p_hid_keyboard_report = (uint8_t const *) desc_keyboard_report,
|
||||
#endif
|
||||
|
||||
#if TUSB_CFG_DEVICE_HID_MOUSE
|
||||
.p_hid_mouse_report = (uint8_t const *) desc_mouse_report,
|
||||
#endif
|
||||
};
|
178
examples/device/device_virtual_com/src/tusb_descriptors.h
Normal file
178
examples/device/device_virtual_com/src/tusb_descriptors.h
Normal file
@ -0,0 +1,178 @@
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@file tusb_descriptors.h
|
||||
@author hathach (tinyusb.org)
|
||||
|
||||
@section LICENSE
|
||||
|
||||
Software License Agreement (BSD License)
|
||||
|
||||
Copyright (c) 2013, hathach (tinyusb.org)
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holders nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
This file is part of the tinyusb stack.
|
||||
*/
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef _TUSB_DESCRIPTORS_H_
|
||||
#define _TUSB_DESCRIPTORS_H_
|
||||
|
||||
#include "tusb.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Descriptors Value (calculated by enabled Classes)
|
||||
//--------------------------------------------------------------------+
|
||||
#define CFG_VENDORID 0xCAFE
|
||||
//#define CFG_PRODUCTID 0x4567 // use auto product id to prevent conflict with pc's driver
|
||||
|
||||
// each combination of interfaces need to have a unique productid, as windows will bind & remember device driver after the first plug.
|
||||
// Auto ProductID layout's Bitmap: (MSB) MassStorage | Generic | Mouse | Key | CDC (LSB)
|
||||
#ifndef CFG_PRODUCTID
|
||||
#define PRODUCTID_BITMAP(interface, n) ( (TUSB_CFG_DEVICE_##interface) << (n) )
|
||||
#define CFG_PRODUCTID (0x4000 | ( PRODUCTID_BITMAP(CDC, 0) | PRODUCTID_BITMAP(HID_KEYBOARD, 1) | \
|
||||
PRODUCTID_BITMAP(HID_MOUSE, 2) | PRODUCTID_BITMAP(HID_GENERIC, 3) | \
|
||||
PRODUCTID_BITMAP(MSC, 4) ) )
|
||||
#endif
|
||||
|
||||
#define INTERFACE_NO_CDC 0
|
||||
#define INTERFACE_NO_HID_KEYBOARD (INTERFACE_NO_CDC + 2*(TUSB_CFG_DEVICE_CDC ? 1 : 0) )
|
||||
#define INTERFACE_NO_HID_MOUSE (INTERFACE_NO_HID_KEYBOARD + TUSB_CFG_DEVICE_HID_KEYBOARD )
|
||||
#define INTERFACE_NO_HID_GENERIC (INTERFACE_NO_HID_MOUSE + TUSB_CFG_DEVICE_HID_MOUSE )
|
||||
#define INTERFACE_NO_MSC (INTERFACE_NO_HID_GENERIC + TUSB_CFG_DEVICE_HID_GENERIC )
|
||||
|
||||
#define TOTAL_INTEFACES (2*TUSB_CFG_DEVICE_CDC + TUSB_CFG_DEVICE_HID_KEYBOARD + TUSB_CFG_DEVICE_HID_MOUSE + \
|
||||
TUSB_CFG_DEVICE_HID_GENERIC + TUSB_CFG_DEVICE_MSC)
|
||||
|
||||
#if (TUSB_CFG_MCU == MCU_LPC11UXX || TUSB_CFG_MCU == MCU_LPC13UXX) && (TOTAL_INTEFACES > 4)
|
||||
#error These MCUs do not have enough number of endpoints for the current configuration
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Endpoints Address & Max Packet Size
|
||||
//--------------------------------------------------------------------+
|
||||
#define EDPT_IN(x) (0x80 | (x))
|
||||
#define EDPT_OUT(x) (x)
|
||||
|
||||
#if TUSB_CFG_MCU == MCU_LPC175X_6X // MCUs's endpoint number has a fixed type
|
||||
|
||||
//------------- CDC -------------//
|
||||
#define CDC_EDPT_NOTIFICATION_ADDR EDPT_IN (1)
|
||||
#define CDC_EDPT_NOTIFICATION_PACKETSIZE 64
|
||||
|
||||
#define CDC_EDPT_DATA_OUT_ADDR EDPT_OUT(2)
|
||||
#define CDC_EDPT_DATA_IN_ADDR EDPT_IN (2)
|
||||
#define CDC_EDPT_DATA_PACKETSIZE 64
|
||||
|
||||
//------------- HID Keyboard -------------//
|
||||
#define HID_KEYBOARD_EDPT_ADDR EDPT_IN (4)
|
||||
#define HID_KEYBOARD_EDPT_PACKETSIZE 8
|
||||
|
||||
//------------- HID Mouse -------------//
|
||||
#define HID_MOUSE_EDPT_ADDR EDPT_IN (7)
|
||||
#define HID_MOUSE_EDPT_PACKETSIZE 8
|
||||
|
||||
//------------- HID Generic -------------//
|
||||
|
||||
//------------- Mass Storage -------------//
|
||||
#define MSC_EDPT_OUT_ADDR EDPT_OUT(5)
|
||||
#define MSC_EDPT_IN_ADDR EDPT_IN (5)
|
||||
|
||||
#else
|
||||
|
||||
//------------- CDC -------------//
|
||||
#define CDC_EDPT_NOTIFICATION_ADDR EDPT_IN (INTERFACE_NO_CDC+1)
|
||||
#define CDC_EDPT_NOTIFICATION_PACKETSIZE 64
|
||||
|
||||
#define CDC_EDPT_DATA_OUT_ADDR EDPT_OUT(INTERFACE_NO_CDC+2)
|
||||
#define CDC_EDPT_DATA_IN_ADDR EDPT_IN (INTERFACE_NO_CDC+2)
|
||||
#define CDC_EDPT_DATA_PACKETSIZE 64
|
||||
|
||||
//------------- HID Keyboard -------------//
|
||||
#define HID_KEYBOARD_EDPT_ADDR EDPT_IN (INTERFACE_NO_HID_KEYBOARD+1)
|
||||
#define HID_KEYBOARD_EDPT_PACKETSIZE 8
|
||||
|
||||
//------------- HID Mouse -------------//
|
||||
#define HID_MOUSE_EDPT_ADDR EDPT_IN (INTERFACE_NO_HID_MOUSE+1)
|
||||
#define HID_MOUSE_EDPT_PACKETSIZE 8
|
||||
|
||||
//------------- HID Generic -------------//
|
||||
|
||||
//------------- Mass Storage -------------//
|
||||
#define MSC_EDPT_OUT_ADDR EDPT_OUT(INTERFACE_NO_MSC+1)
|
||||
#define MSC_EDPT_IN_ADDR EDPT_IN (INTERFACE_NO_MSC+1)
|
||||
|
||||
#endif
|
||||
|
||||
#define MSC_EDPT_PACKETSIZE (TUSB_CFG_MCU == MCU_LPC43XX ? 512 : 64)
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// CONFIGURATION DESCRIPTOR
|
||||
//--------------------------------------------------------------------+
|
||||
typedef struct ATTR_PACKED
|
||||
{
|
||||
tusb_descriptor_configuration_t configuration;
|
||||
|
||||
//------------- CDC -------------//
|
||||
#if TUSB_CFG_DEVICE_CDC
|
||||
tusb_descriptor_interface_association_t cdc_iad;
|
||||
|
||||
//CDC Control Interface
|
||||
tusb_descriptor_interface_t cdc_comm_interface;
|
||||
cdc_desc_func_header_t cdc_header;
|
||||
cdc_desc_func_call_management_t cdc_call;
|
||||
cdc_desc_func_abstract_control_management_t cdc_acm;
|
||||
cdc_desc_func_union_t cdc_union;
|
||||
tusb_descriptor_endpoint_t cdc_endpoint_notification;
|
||||
|
||||
//CDC Data Interface
|
||||
tusb_descriptor_interface_t cdc_data_interface;
|
||||
tusb_descriptor_endpoint_t cdc_endpoint_out;
|
||||
tusb_descriptor_endpoint_t cdc_endpoint_in;
|
||||
#endif
|
||||
|
||||
//------------- HID Keyboard -------------//
|
||||
#if TUSB_CFG_DEVICE_HID_KEYBOARD
|
||||
tusb_descriptor_interface_t keyboard_interface;
|
||||
tusb_hid_descriptor_hid_t keyboard_hid;
|
||||
tusb_descriptor_endpoint_t keyboard_endpoint;
|
||||
#endif
|
||||
|
||||
//------------- HID Mouse -------------//
|
||||
#if TUSB_CFG_DEVICE_HID_MOUSE
|
||||
tusb_descriptor_interface_t mouse_interface;
|
||||
tusb_hid_descriptor_hid_t mouse_hid;
|
||||
tusb_descriptor_endpoint_t mouse_endpoint;
|
||||
#endif
|
||||
|
||||
//------------- Mass Storage -------------//
|
||||
#if TUSB_CFG_DEVICE_MSC
|
||||
tusb_descriptor_interface_t msc_interface;
|
||||
tusb_descriptor_endpoint_t msc_endpoint_in;
|
||||
tusb_descriptor_endpoint_t msc_endpoint_out;
|
||||
#endif
|
||||
|
||||
} app_descriptor_configuration_t;
|
||||
|
||||
#endif
|
204
examples/device/device_virtual_com/xpresso/.cproject
Normal file
204
examples/device/device_virtual_com/xpresso/.cproject
Normal file
@ -0,0 +1,204 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="com.crt.advproject.config.exe.debug.1203173668.586387399">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.crt.advproject.config.exe.debug.1203173668.586387399" moduleId="org.eclipse.cdt.core.settings" name="EA4357">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="axf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" errorParsers="org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" id="com.crt.advproject.config.exe.debug.1203173668.586387399" name="EA4357" parent="com.crt.advproject.config.exe.debug" postannouncebuildStep="Performing post-build steps" postbuildStep="arm-none-eabi-size "${BuildArtifactFileName}"; # arm-none-eabi-objcopy -v -O binary "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" ; # checksum -p ${TargetChip} -d "${BuildArtifactFileBaseName}.bin"; ">
|
||||
<folderInfo id="com.crt.advproject.config.exe.debug.1203173668.586387399." name="/" resourcePath="">
|
||||
<toolChain id="com.crt.advproject.toolchain.exe.debug.797521259" name="NXP MCU Tools" superClass="com.crt.advproject.toolchain.exe.debug">
|
||||
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.GNU_ELF" id="com.crt.advproject.platform.exe.debug.546357503" name="ARM-based MCU (Debug)" superClass="com.crt.advproject.platform.exe.debug"/>
|
||||
<builder buildPath="${workspace_loc:/device_virtual_com}/Debug" id="com.crt.advproject.builder.exe.debug.1377782676" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="com.crt.advproject.builder.exe.debug"/>
|
||||
<tool id="com.crt.advproject.cpp.exe.debug.1902983438" name="MCU C++ Compiler" superClass="com.crt.advproject.cpp.exe.debug"/>
|
||||
<tool id="com.crt.advproject.gcc.exe.debug.1115700323" name="MCU C Compiler" superClass="com.crt.advproject.gcc.exe.debug">
|
||||
<option id="com.crt.advproject.gcc.thumb.2000167205" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="com.crt.advproject.gcc.arch.1426190863" name="Architecture" superClass="com.crt.advproject.gcc.arch" useByScannerDiscovery="false" value="com.crt.advproject.gcc.target.cm4" valueType="enumerated"/>
|
||||
<option id="gnu.c.compiler.option.preprocessor.def.symbols.869168107" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="DEBUG"/>
|
||||
<listOptionValue builtIn="false" value="__CODE_RED"/>
|
||||
<listOptionValue builtIn="false" value="CORE_M4"/>
|
||||
<listOptionValue builtIn="false" value="__LPC43XX__"/>
|
||||
<listOptionValue builtIn="false" value="__REDLIB__"/>
|
||||
<listOptionValue builtIn="false" value="__MULTICORE_NONE"/>
|
||||
<listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC43XX"/>
|
||||
<listOptionValue builtIn="false" value="BOARD=BOARD_EA4357"/>
|
||||
</option>
|
||||
<option id="gnu.c.compiler.option.misc.other.1756693195" name="Other flags" superClass="gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fsingle-precision-constant" valueType="string"/>
|
||||
<option id="gnu.c.compiler.option.optimization.flags.89900395" name="Other optimization flags" superClass="gnu.c.compiler.option.optimization.flags" useByScannerDiscovery="false" value="-fno-common" valueType="string"/>
|
||||
<option id="com.crt.advproject.gcc.hdrlib.807046052" name="Library headers" superClass="com.crt.advproject.gcc.hdrlib" useByScannerDiscovery="false" value="Redlib" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gcc.specs.1934361851" name="Specs" superClass="com.crt.advproject.gcc.specs" useByScannerDiscovery="false" value="com.crt.advproject.gcc.specs.codered" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gcc.fpu.913487808" name="Floating point" superClass="com.crt.advproject.gcc.fpu" useByScannerDiscovery="false" value="com.crt.advproject.gcc.fpu.fpv4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.c.misc.dialect.565052617" name="Language standard" superClass="com.crt.advproject.c.misc.dialect" useByScannerDiscovery="true" value="com.crt.advproject.misc.dialect.gnu99" valueType="enumerated"/>
|
||||
<option id="gnu.c.compiler.option.include.paths.927641778" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/hw/cmsis/Include}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/hw/mcu/nxp/lpc43xx/CMSIS_LPC43xx_DriverLib/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/hw/mcu/nxp/lpc43xx/hal}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/hw}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/tinyusb}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src}""/>
|
||||
</option>
|
||||
<inputType id="com.crt.advproject.compiler.input.1083122507" superClass="com.crt.advproject.compiler.input"/>
|
||||
</tool>
|
||||
<tool id="com.crt.advproject.gas.exe.debug.922965957" name="MCU Assembler" superClass="com.crt.advproject.gas.exe.debug">
|
||||
<option id="com.crt.advproject.gas.thumb.312702473" name="Thumb mode" superClass="com.crt.advproject.gas.thumb" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="com.crt.advproject.gas.arch.1185311108" name="Architecture" superClass="com.crt.advproject.gas.arch" useByScannerDiscovery="false" value="com.crt.advproject.gas.target.cm4" valueType="enumerated"/>
|
||||
<option id="gnu.both.asm.option.flags.crt.569279937" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" useByScannerDiscovery="false" value="-c -x assembler-with-cpp -DDEBUG -D__CODE_RED -DCORE_M4 -D__LPC43XX__ -D__REDLIB__ -D__MULTICORE_NONE" valueType="string"/>
|
||||
<option id="com.crt.advproject.gas.hdrlib.405751747" name="Library headers" superClass="com.crt.advproject.gas.hdrlib" useByScannerDiscovery="false" value="Redlib" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gas.specs.1311199680" name="Specs" superClass="com.crt.advproject.gas.specs" useByScannerDiscovery="false" value="com.crt.advproject.gas.specs.codered" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gas.fpu.1104960904" name="Floating point" superClass="com.crt.advproject.gas.fpu" useByScannerDiscovery="false" value="com.crt.advproject.gas.fpu.fpv4" valueType="enumerated"/>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.154926147" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
||||
<inputType id="com.crt.advproject.assembler.input.1198912369" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>
|
||||
</tool>
|
||||
<tool id="com.crt.advproject.link.cpp.exe.debug.844358431" name="MCU C++ Linker" superClass="com.crt.advproject.link.cpp.exe.debug"/>
|
||||
<tool id="com.crt.advproject.link.exe.debug.1844250132" name="MCU Linker" superClass="com.crt.advproject.link.exe.debug">
|
||||
<option id="com.crt.advproject.link.thumb.657050778" name="Thumb mode" superClass="com.crt.advproject.link.thumb" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="com.crt.advproject.link.memory.heapAndStack.2140786677" name="Heap and Stack options" superClass="com.crt.advproject.link.memory.heapAndStack" useByScannerDiscovery="false" value="&Heap:Default;Post Data;Default&Stack:Default;End;Default" valueType="string"/>
|
||||
<option id="com.crt.advproject.link.gcc.multicore.master.1590965523" name="Multicore master" superClass="com.crt.advproject.link.gcc.multicore.master" useByScannerDiscovery="false"/>
|
||||
<option id="com.crt.advproject.link.gcc.multicore.master.userobjs.1932284380" name="Slave Objects (not visible)" superClass="com.crt.advproject.link.gcc.multicore.master.userobjs" useByScannerDiscovery="false" valueType="userObjs"/>
|
||||
<option id="com.crt.advproject.link.arch.487705047" name="Architecture" superClass="com.crt.advproject.link.arch" useByScannerDiscovery="false" value="com.crt.advproject.link.target.cm4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.link.script.1615078816" name="Linker script" superClass="com.crt.advproject.link.script" useByScannerDiscovery="false" value=""device_virtual_com_EA4357.ld"" valueType="string"/>
|
||||
<option id="com.crt.advproject.link.manage.552600512" name="Manage linker script" superClass="com.crt.advproject.link.manage" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="gnu.c.link.option.nostdlibs.1781077087" name="No startup or default libs (-nostdlib)" superClass="gnu.c.link.option.nostdlibs" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="gnu.c.link.option.other.754517866" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="-Map="${BuildArtifactFileBaseName}.map""/>
|
||||
<listOptionValue builtIn="false" value="--gc-sections"/>
|
||||
<listOptionValue builtIn="false" value="-print-memory-usage"/>
|
||||
</option>
|
||||
<option id="com.crt.advproject.link.gcc.hdrlib.978983296" name="Library" superClass="com.crt.advproject.link.gcc.hdrlib" useByScannerDiscovery="false" value="com.crt.advproject.gcc.link.hdrlib.codered.nohost" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.link.fpu.896260173" name="Floating point" superClass="com.crt.advproject.link.fpu" useByScannerDiscovery="false" value="com.crt.advproject.link.fpu.fpv4" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.link.crpenable.983788363" name="Enable automatic placement of Code Read Protection field in image" superClass="com.crt.advproject.link.crpenable" useByScannerDiscovery="false" value="false" valueType="boolean"/>
|
||||
<option id="com.crt.advproject.link.gcc.multicore.slave.312914823" name="Multicore configuration" superClass="com.crt.advproject.link.gcc.multicore.slave" useByScannerDiscovery="false"/>
|
||||
<option defaultValue="com.crt.advproject.heapAndStack.lpcXpressoStyle" id="com.crt.advproject.link.memory.heapAndStack.style.848801259" name="Heap and Stack placement" superClass="com.crt.advproject.link.memory.heapAndStack.style" useByScannerDiscovery="false" valueType="enumerated"/>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1952169203" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||
</inputType>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="hw/bsp/ngx|hw/bsp/lpcxpresso1769|hw/bsp/lpcxpresso1347|hw/bsp/lpcxpresso11u68|hw/bsp/lpcxpresso|hw/bsp/keil|hw/bsp/hitex|hw/mcu/nxp/lpc175x_6x|hw/mcu/nxp/lpc13uxx|hw/mcu/nxp/lpc11uxx" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="device_virtual_com.com.crt.advproject.projecttype.exe.577278554" name="Executable" projectType="com.crt.advproject.projecttype.exe"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="scannerConfiguration">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
<storageModule moduleId="com.crt.config">
|
||||
<projectStorage><?xml version="1.0" encoding="UTF-8"?>
|
||||
<TargetConfig>
|
||||
<Properties property_0="None" property_2="LPC18x7_43x7_2x512_BootA.cfx" property_3="NXP" property_4="LPC4357" property_count="5" version="70200"/>
|
||||
<infoList vendor="NXP"><info chip="LPC4357" flash_driver="LPC18x7_43x7_2x512_BootA.cfx" match_id="0x0" name="LPC4357" resetscript="LPC18LPC43InternalFLASHBootResetscript.scp" stub="crt_emu_lpc18_43_nxp"><chip><name>LPC4357</name>
|
||||
<family>LPC43xx</family>
|
||||
<vendor>NXP (formerly Philips)</vendor>
|
||||
<reset board="None" core="Real" sys="Real"/>
|
||||
<clock changeable="TRUE" freq="20MHz" is_accurate="TRUE"/>
|
||||
<memory can_program="true" id="Flash" is_ro="true" type="Flash"/>
|
||||
<memory id="RAM" type="RAM"/>
|
||||
<memory id="Periph" is_volatile="true" type="Peripheral"/>
|
||||
<memoryInstance derived_from="Flash" edited="true" id="MFlashA512" location="0x1a000000" size="0x80000"/>
|
||||
<memoryInstance derived_from="Flash" edited="true" id="MFlashB512" location="0x1b000000" size="0x80000"/>
|
||||
<memoryInstance derived_from="RAM" edited="true" id="RamLoc32" location="0x10000000" size="0x8000"/>
|
||||
<memoryInstance derived_from="RAM" edited="true" id="RamLoc40" location="0x10080000" size="0xa000"/>
|
||||
<memoryInstance derived_from="RAM" edited="true" id="RamAHB32" location="0x20000000" size="0x8000"/>
|
||||
<memoryInstance derived_from="RAM" edited="true" id="RamAHB16" location="0x20008000" size="0x4000"/>
|
||||
<memoryInstance derived_from="RAM" edited="true" id="RamAHB_ETB16" location="0x2000c000" size="0x4000"/>
|
||||
<prog_flash blocksz="0x2000" location="0x1a000000" maxprgbuff="0x400" progwithcode="TRUE" size="0x10000"/>
|
||||
<prog_flash blocksz="0x10000" location="0x1a010000" maxprgbuff="0x400" progwithcode="TRUE" size="0x70000"/>
|
||||
<prog_flash blocksz="0x2000" location="0x1b000000" maxprgbuff="0x400" progwithcode="TRUE" size="0x10000"/>
|
||||
<prog_flash blocksz="0x10000" location="0x1b010000" maxprgbuff="0x400" progwithcode="TRUE" size="0x70000"/>
|
||||
<peripheralInstance derived_from="V7M_MPU" id="MPU" location="0xe000ed90"/>
|
||||
<peripheralInstance derived_from="V7M_NVIC" id="NVIC" location="0xe000e000"/>
|
||||
<peripheralInstance derived_from="V7M_DCR" id="DCR" location="0xe000edf0"/>
|
||||
<peripheralInstance derived_from="V7M_ITM" id="ITM" location="0xe0000000"/>
|
||||
<peripheralInstance derived_from="SCT" id="SCT" location="0x40000000"/>
|
||||
<peripheralInstance derived_from="GPDMA" id="GPDMA" location="0x40002000"/>
|
||||
<peripheralInstance derived_from="SPIFI" id="SPIFI" location="0x40003000"/>
|
||||
<peripheralInstance derived_from="SDMMC" id="SDMMC" location="0x40004000"/>
|
||||
<peripheralInstance derived_from="EMC" id="EMC" location="0x40005000"/>
|
||||
<peripheralInstance derived_from="USB0" id="USB0" location="0x40006000"/>
|
||||
<peripheralInstance derived_from="USB1" id="USB1" location="0x40007000"/>
|
||||
<peripheralInstance derived_from="LCD" id="LCD" location="0x40008000"/>
|
||||
<peripheralInstance derived_from="EEPROM" id="EEPROM" location="0x4000e000"/>
|
||||
<peripheralInstance derived_from="ETHERNET" id="ETHERNET" location="0x40010000"/>
|
||||
<peripheralInstance derived_from="ATIMER" id="ATIMER" location="0x40040000"/>
|
||||
<peripheralInstance derived_from="REGFILE" id="REGFILE" location="0x40041000"/>
|
||||
<peripheralInstance derived_from="PMC" id="PMC" location="0x40042000"/>
|
||||
<peripheralInstance derived_from="CREG" id="CREG" location="0x40043000"/>
|
||||
<peripheralInstance derived_from="EVENTROUTER" id="EVENTROUTER" location="0x40044000"/>
|
||||
<peripheralInstance derived_from="RTC" id="RTC" location="0x40046000"/>
|
||||
<peripheralInstance derived_from="CGU" id="CGU" location="0x40050000"/>
|
||||
<peripheralInstance derived_from="CCU1" id="CCU1" location="0x40051000"/>
|
||||
<peripheralInstance derived_from="CCU2" id="CCU2" location="0x40052000"/>
|
||||
<peripheralInstance derived_from="RGU" id="RGU" location="0x40053000"/>
|
||||
<peripheralInstance derived_from="WWDT" id="WWDT" location="0x40080000"/>
|
||||
<peripheralInstance derived_from="USART0" id="USART0" location="0x40081000"/>
|
||||
<peripheralInstance derived_from="USART2" id="USART2" location="0x400c1000"/>
|
||||
<peripheralInstance derived_from="USART3" id="USART3" location="0x400c2000"/>
|
||||
<peripheralInstance derived_from="UART1" id="UART1" location="0x40082000"/>
|
||||
<peripheralInstance derived_from="SSP0" id="SSP0" location="0x40083000"/>
|
||||
<peripheralInstance derived_from="SSP1" id="SSP1" location="0x400c5000"/>
|
||||
<peripheralInstance derived_from="TIMER0" id="TIMER0" location="0x40084000"/>
|
||||
<peripheralInstance derived_from="TIMER1" id="TIMER1" location="0x40085000"/>
|
||||
<peripheralInstance derived_from="TIMER2" id="TIMER2" location="0x400c3000"/>
|
||||
<peripheralInstance derived_from="TIMER3" id="TIMER3" location="0x400c4000"/>
|
||||
<peripheralInstance derived_from="SCU" id="SCU" location="0x40086000"/>
|
||||
<peripheralInstance derived_from="GPIO-PIN-INT" id="GPIO-PIN-INT" location="0x40087000"/>
|
||||
<peripheralInstance derived_from="GPIO-GROUP-INT0" id="GPIO-GROUP-INT0" location="0x40088000"/>
|
||||
<peripheralInstance derived_from="GPIO-GROUP-INT1" id="GPIO-GROUP-INT1" location="0x40089000"/>
|
||||
<peripheralInstance derived_from="MCPWM" id="MCPWM" location="0x400a0000"/>
|
||||
<peripheralInstance derived_from="I2C0" id="I2C0" location="0x400a1000"/>
|
||||
<peripheralInstance derived_from="I2C1" id="I2C1" location="0x400e0000"/>
|
||||
<peripheralInstance derived_from="I2S0" id="I2S0" location="0x400a2000"/>
|
||||
<peripheralInstance derived_from="I2S1" id="I2S1" location="0x400a3000"/>
|
||||
<peripheralInstance derived_from="C-CAN1" id="C-CAN1" location="0x400a4000"/>
|
||||
<peripheralInstance derived_from="RITIMER" id="RITIMER" location="0x400c0000"/>
|
||||
<peripheralInstance derived_from="QEI" id="QEI" location="0x400c6000"/>
|
||||
<peripheralInstance derived_from="GIMA" id="GIMA" location="0x400c7000"/>
|
||||
<peripheralInstance derived_from="DAC" id="DAC" location="0x400e1000"/>
|
||||
<peripheralInstance derived_from="C-CAN0" id="C-CAN0" location="0x400e2000"/>
|
||||
<peripheralInstance derived_from="ADC0" id="ADC0" location="0x400e3000"/>
|
||||
<peripheralInstance derived_from="ADC1" id="ADC1" location="0x400e4000"/>
|
||||
<peripheralInstance derived_from="GPIO-PORT" id="GPIO-PORT" location="0x400f4000"/>
|
||||
<peripheralInstance derived_from="SPI" id="SPI" location="0x40100000"/>
|
||||
<peripheralInstance derived_from="SGPIO" id="SGPIO" location="0x40101000"/>
|
||||
</chip>
|
||||
<processor><name gcc_name="cortex-m4">Cortex-M4</name>
|
||||
<family>Cortex-M</family>
|
||||
</processor>
|
||||
<link href="nxp_lpc43xx_peripheral.xme" show="embed" type="simple"/>
|
||||
</info>
|
||||
</infoList>
|
||||
</TargetConfig></projectStorage>
|
||||
</storageModule>
|
||||
<storageModule moduleId="refreshScope" versionNumber="2">
|
||||
<configuration configurationName="Debug">
|
||||
<resource resourceType="PROJECT" workspacePath="/device_virtual_com"/>
|
||||
</configuration>
|
||||
<configuration configurationName="Release">
|
||||
<resource resourceType="PROJECT" workspacePath="/device_virtual_com"/>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="com.crt.advproject">
|
||||
<boardId>MCB4357</boardId>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
|
||||
</cproject>
|
43
examples/device/device_virtual_com/xpresso/.project
Normal file
43
examples/device/device_virtual_com/xpresso/.project
Normal file
@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>device_virtual_com</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<triggers>clean,full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
<link>
|
||||
<name>hw</name>
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-4-PROJECT_LOC/hw</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src</name>
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/src</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>tinyusb</name>
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-4-PROJECT_LOC/tinyusb</locationURI>
|
||||
</link>
|
||||
</linkedResources>
|
||||
</projectDescription>
|
@ -83,7 +83,7 @@
|
||||
<link>
|
||||
<name>hw</name>
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/hw</locationURI>
|
||||
<locationURI>PARENT-4-PROJECT_LOC/hw</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src</name>
|
||||
@ -93,7 +93,7 @@
|
||||
<link>
|
||||
<name>tinyusb</name>
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/tinyusb</locationURI>
|
||||
<locationURI>PARENT-4-PROJECT_LOC/tinyusb</locationURI>
|
||||
</link>
|
||||
</linkedResources>
|
||||
</projectDescription>
|
||||
|
@ -1,32 +1,34 @@
|
||||
//*****************************************************************************
|
||||
// +--+
|
||||
// | ++----+
|
||||
// +-++ |
|
||||
// | |
|
||||
// +-+--+ |
|
||||
// | +--+--+
|
||||
// +----+ Copyright (c) 2011-12 Code Red Technologies Ltd.
|
||||
//
|
||||
// LPC43xx Microcontroller Startup code for use with Red Suite
|
||||
//
|
||||
// Version : 120430
|
||||
//
|
||||
// Software License Agreement
|
||||
//
|
||||
// The software is owned by Code Red Technologies and/or its suppliers, and is
|
||||
// protected under applicable copyright laws. All rights are reserved. Any
|
||||
// use in violation of the foregoing restrictions may subject the user to criminal
|
||||
// sanctions under applicable laws, as well as to civil liability for the breach
|
||||
// of the terms and conditions of this license.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
|
||||
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
|
||||
// USE OF THIS SOFTWARE FOR COMMERCIAL DEVELOPMENT AND/OR EDUCATION IS SUBJECT
|
||||
// TO A CURRENT END USER LICENSE AGREEMENT (COMMERCIAL OR EDUCATIONAL) WITH
|
||||
// CODE RED TECHNOLOGIES LTD.
|
||||
// LPC43xx (Cortex-M4) Microcontroller Startup code for use with LPCXpresso IDE
|
||||
//
|
||||
// Version : 150706
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Copyright(C) NXP Semiconductors, 2013-2015
|
||||
// All rights reserved.
|
||||
//
|
||||
// Software that is described herein is for illustrative purposes only
|
||||
// which provides customers with programming information regarding the
|
||||
// LPC products. This software is supplied "AS IS" without any warranties of
|
||||
// any kind, and NXP Semiconductors and its licensor disclaim any and
|
||||
// all warranties, express or implied, including all implied warranties of
|
||||
// merchantability, fitness for a particular purpose and non-infringement of
|
||||
// intellectual property rights. NXP Semiconductors assumes no responsibility
|
||||
// or liability for the use of the software, conveys no license or rights under any
|
||||
// patent, copyright, mask work right, or any other intellectual property rights in
|
||||
// or to any products. NXP Semiconductors reserves the right to make changes
|
||||
// in the software without notification. NXP Semiconductors also makes no
|
||||
// representation or warranty that such application will be suitable for the
|
||||
// specified use without further testing or modification.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software and its
|
||||
// documentation is hereby granted, under NXP Semiconductors' and its
|
||||
// licensor's relevant copyrights in the software, without fee, provided that it
|
||||
// is used in conjunction with NXP Semiconductors microcontrollers. This
|
||||
// copyright, permission, and disclaimer notice must appear in all copies of
|
||||
// this code.
|
||||
//*****************************************************************************
|
||||
|
||||
#if defined (__cplusplus)
|
||||
#ifdef __REDLIB__
|
||||
#error Redlib does not support C++
|
||||
@ -37,7 +39,7 @@
|
||||
//
|
||||
//*****************************************************************************
|
||||
extern "C" {
|
||||
extern void __libc_init_array(void);
|
||||
extern void __libc_init_array(void);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@ -45,17 +47,17 @@ extern "C" {
|
||||
#define WEAK __attribute__ ((weak))
|
||||
#define ALIAS(f) __attribute__ ((weak, alias (#f)))
|
||||
|
||||
// Code Red - if CMSIS is being used, then SystemInit() routine
|
||||
// will be called by startup code rather than in application's main()
|
||||
#if defined (__USE_CMSIS)
|
||||
#include "LPC43xx.h"
|
||||
#endif
|
||||
|
||||
//*****************************************************************************
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//*****************************************************************************
|
||||
#if defined (__USE_CMSIS) || defined (__USE_LPCOPEN)
|
||||
// Declaration of external SystemInit function
|
||||
extern void SystemInit(void);
|
||||
#endif
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Forward declaration of the default handlers. These are aliased.
|
||||
@ -63,7 +65,7 @@ extern "C" {
|
||||
// automatically take precedence over these weak definitions
|
||||
//
|
||||
//*****************************************************************************
|
||||
void ResetISR(void);
|
||||
void ResetISR(void);
|
||||
WEAK void NMI_Handler(void);
|
||||
WEAK void HardFault_Handler(void);
|
||||
WEAK void MemManage_Handler(void);
|
||||
@ -84,9 +86,12 @@ WEAK void IntDefaultHandler(void);
|
||||
//
|
||||
//*****************************************************************************
|
||||
void DAC_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
#if defined (__USE_LPCOPEN)
|
||||
void M0APP_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
#else
|
||||
void M0CORE_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
#endif
|
||||
void DMA_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void EZH_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void FLASH_EEPROM_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void ETH_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void SDIO_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
@ -102,7 +107,7 @@ void TIMER3_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void MCPWM_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void ADC0_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void I2C0_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void SPI_IRQHandler (void) ALIAS(IntDefaultHandler);
|
||||
void SPI_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void I2C1_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void ADC1_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void SSP0_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
@ -127,15 +132,18 @@ void GINT0_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void GINT1_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void EVRT_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void CAN1_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
#if defined (__USE_LPCOPEN)
|
||||
void ADCHS_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
#else
|
||||
void VADC_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
#endif
|
||||
void ATIMER_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void RTC_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void WDT_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void M0s_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void M0SUB_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void CAN0_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
void QEI_IRQHandler(void) ALIAS(IntDefaultHandler);
|
||||
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The entry point for the application.
|
||||
@ -154,6 +162,13 @@ extern int main(void);
|
||||
//*****************************************************************************
|
||||
extern void _vStackTop(void);
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// External declaration for LPC MCU vector table checksum from Linker Script
|
||||
//
|
||||
//*****************************************************************************
|
||||
WEAK extern void __valid_user_code_checksum();
|
||||
|
||||
//*****************************************************************************
|
||||
#if defined (__cplusplus)
|
||||
} // extern "C"
|
||||
@ -165,81 +180,90 @@ extern void _vStackTop(void);
|
||||
//
|
||||
//*****************************************************************************
|
||||
extern void (* const g_pfnVectors[])(void);
|
||||
__attribute__ ((section(".isr_vector")))
|
||||
__attribute__ ((used,section(".isr_vector")))
|
||||
void (* const g_pfnVectors[])(void) = {
|
||||
// Core Level - CM4
|
||||
&_vStackTop, // The initial stack pointer
|
||||
ResetISR, // The reset handler
|
||||
NMI_Handler, // The NMI handler
|
||||
HardFault_Handler, // The hard fault handler
|
||||
MemManage_Handler, // The MPU fault handler
|
||||
BusFault_Handler, // The bus fault handler
|
||||
UsageFault_Handler, // The usage fault handler
|
||||
0, // Reserved
|
||||
0, // Reserved
|
||||
0, // Reserved
|
||||
0, // Reserved
|
||||
SVC_Handler, // SVCall handler
|
||||
DebugMon_Handler, // Debug monitor handler
|
||||
0, // Reserved
|
||||
PendSV_Handler, // The PendSV handler
|
||||
SysTick_Handler, // The SysTick handler
|
||||
// Core Level - CM4
|
||||
&_vStackTop, // The initial stack pointer
|
||||
ResetISR, // The reset handler
|
||||
NMI_Handler, // The NMI handler
|
||||
HardFault_Handler, // The hard fault handler
|
||||
MemManage_Handler, // The MPU fault handler
|
||||
BusFault_Handler, // The bus fault handler
|
||||
UsageFault_Handler, // The usage fault handler
|
||||
__valid_user_code_checksum, // LPC MCU Checksum
|
||||
0, // Reserved
|
||||
0, // Reserved
|
||||
0, // Reserved
|
||||
SVC_Handler, // SVCall handler
|
||||
DebugMon_Handler, // Debug monitor handler
|
||||
0, // Reserved
|
||||
PendSV_Handler, // The PendSV handler
|
||||
SysTick_Handler, // The SysTick handler
|
||||
|
||||
// Chip Level - LPC43 (M4)
|
||||
DAC_IRQHandler, // 16
|
||||
#if defined (__USE_LPCOPEN)
|
||||
M0APP_IRQHandler, // 17 CortexM4/M0 (LPC43XX ONLY)
|
||||
#else
|
||||
M0CORE_IRQHandler, // 17
|
||||
#endif
|
||||
DMA_IRQHandler, // 18
|
||||
0, // 19
|
||||
FLASH_EEPROM_IRQHandler, // 20 ORed flash Bank A, flash Bank B, EEPROM interrupts
|
||||
ETH_IRQHandler, // 21
|
||||
SDIO_IRQHandler, // 22
|
||||
LCD_IRQHandler, // 23
|
||||
USB0_IRQHandler, // 24
|
||||
USB1_IRQHandler, // 25
|
||||
SCT_IRQHandler, // 26
|
||||
RIT_IRQHandler, // 27
|
||||
TIMER0_IRQHandler, // 28
|
||||
TIMER1_IRQHandler, // 29
|
||||
TIMER2_IRQHandler, // 30
|
||||
TIMER3_IRQHandler, // 31
|
||||
MCPWM_IRQHandler, // 32
|
||||
ADC0_IRQHandler, // 33
|
||||
I2C0_IRQHandler, // 34
|
||||
I2C1_IRQHandler, // 35
|
||||
SPI_IRQHandler, // 36
|
||||
ADC1_IRQHandler, // 37
|
||||
SSP0_IRQHandler, // 38
|
||||
SSP1_IRQHandler, // 39
|
||||
UART0_IRQHandler, // 40
|
||||
UART1_IRQHandler, // 41
|
||||
UART2_IRQHandler, // 42
|
||||
UART3_IRQHandler, // 43
|
||||
I2S0_IRQHandler, // 44
|
||||
I2S1_IRQHandler, // 45
|
||||
SPIFI_IRQHandler, // 46
|
||||
SGPIO_IRQHandler, // 47
|
||||
GPIO0_IRQHandler, // 48
|
||||
GPIO1_IRQHandler, // 49
|
||||
GPIO2_IRQHandler, // 50
|
||||
GPIO3_IRQHandler, // 51
|
||||
GPIO4_IRQHandler, // 52
|
||||
GPIO5_IRQHandler, // 53
|
||||
GPIO6_IRQHandler, // 54
|
||||
GPIO7_IRQHandler, // 55
|
||||
GINT0_IRQHandler, // 56
|
||||
GINT1_IRQHandler, // 57
|
||||
EVRT_IRQHandler, // 58
|
||||
CAN1_IRQHandler, // 59
|
||||
0, // 60
|
||||
#if defined (__USE_LPCOPEN)
|
||||
ADCHS_IRQHandler, // 61 ADCHS combined interrupt
|
||||
#else
|
||||
VADC_IRQHandler, // 61
|
||||
#endif
|
||||
ATIMER_IRQHandler, // 62
|
||||
RTC_IRQHandler, // 63
|
||||
0, // 64
|
||||
WDT_IRQHandler, // 65
|
||||
M0SUB_IRQHandler, // 66
|
||||
CAN0_IRQHandler, // 67
|
||||
QEI_IRQHandler, // 68
|
||||
};
|
||||
|
||||
// Chip Level - LPC43
|
||||
DAC_IRQHandler, // 16
|
||||
M0CORE_IRQHandler, // 17
|
||||
DMA_IRQHandler, // 18
|
||||
EZH_IRQHandler, // 19
|
||||
FLASH_EEPROM_IRQHandler, // 20
|
||||
ETH_IRQHandler, // 21
|
||||
SDIO_IRQHandler, // 22
|
||||
LCD_IRQHandler, // 23
|
||||
USB0_IRQHandler, // 24
|
||||
USB1_IRQHandler, // 25
|
||||
SCT_IRQHandler, // 26
|
||||
RIT_IRQHandler, // 27
|
||||
TIMER0_IRQHandler, // 28
|
||||
TIMER1_IRQHandler, // 29
|
||||
TIMER2_IRQHandler, // 30
|
||||
TIMER3_IRQHandler, // 31
|
||||
MCPWM_IRQHandler, // 32
|
||||
ADC0_IRQHandler, // 33
|
||||
I2C0_IRQHandler, // 34
|
||||
I2C1_IRQHandler, // 35
|
||||
SPI_IRQHandler, // 36
|
||||
ADC1_IRQHandler, // 37
|
||||
SSP0_IRQHandler, // 38
|
||||
SSP1_IRQHandler, // 39
|
||||
UART0_IRQHandler, // 40
|
||||
UART1_IRQHandler, // 41
|
||||
UART2_IRQHandler, // 42
|
||||
UART3_IRQHandler, // 43
|
||||
I2S0_IRQHandler, // 44
|
||||
I2S1_IRQHandler, // 45
|
||||
SPIFI_IRQHandler, // 46
|
||||
SGPIO_IRQHandler, // 47
|
||||
GPIO0_IRQHandler, // 48
|
||||
GPIO1_IRQHandler, // 49
|
||||
GPIO2_IRQHandler, // 50
|
||||
GPIO3_IRQHandler, // 51
|
||||
GPIO4_IRQHandler, // 52
|
||||
GPIO5_IRQHandler, // 53
|
||||
GPIO6_IRQHandler, // 54
|
||||
GPIO7_IRQHandler, // 55
|
||||
GINT0_IRQHandler, // 56
|
||||
GINT1_IRQHandler, // 57
|
||||
EVRT_IRQHandler, // 58
|
||||
CAN1_IRQHandler, // 59
|
||||
0, // 60
|
||||
VADC_IRQHandler, // 61
|
||||
ATIMER_IRQHandler, // 62
|
||||
RTC_IRQHandler, // 63
|
||||
0, // 64
|
||||
WDT_IRQHandler, // 65
|
||||
M0s_IRQHandler, // 66
|
||||
CAN0_IRQHandler, // 67
|
||||
QEI_IRQHandler, // 68
|
||||
};
|
||||
|
||||
//*****************************************************************************
|
||||
// Functions to carry out the initialization of RW and BSS data sections. These
|
||||
@ -247,21 +271,22 @@ void (* const g_pfnVectors[])(void) = {
|
||||
// ResetISR() function in order to cope with MCUs with multiple banks of
|
||||
// memory.
|
||||
//*****************************************************************************
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
__attribute__((section(".after_vectors"
|
||||
)))
|
||||
void data_init(unsigned int romstart, unsigned int start, unsigned int len) {
|
||||
unsigned int *pulDest = (unsigned int*) start;
|
||||
unsigned int *pulSrc = (unsigned int*) romstart;
|
||||
unsigned int loop;
|
||||
for (loop = 0; loop < len; loop = loop + 4)
|
||||
*pulDest++ = *pulSrc++;
|
||||
unsigned int *pulDest = (unsigned int*) start;
|
||||
unsigned int *pulSrc = (unsigned int*) romstart;
|
||||
unsigned int loop;
|
||||
for (loop = 0; loop < len; loop = loop + 4)
|
||||
*pulDest++ = *pulSrc++;
|
||||
}
|
||||
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
void bss_init(unsigned int start, unsigned int len) {
|
||||
unsigned int *pulDest = (unsigned int*) start;
|
||||
unsigned int loop;
|
||||
for (loop = 0; loop < len; loop = loop + 4)
|
||||
*pulDest++ = 0;
|
||||
unsigned int *pulDest = (unsigned int*) start;
|
||||
unsigned int loop;
|
||||
for (loop = 0; loop < len; loop = loop + 4)
|
||||
*pulDest++ = 0;
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
@ -282,8 +307,7 @@ extern unsigned int __bss_section_table_end;
|
||||
// library.
|
||||
//
|
||||
//*****************************************************************************
|
||||
void
|
||||
ResetISR(void) {
|
||||
void ResetISR(void) {
|
||||
|
||||
// *************************************************************
|
||||
// The following conditional block of code manually resets as
|
||||
@ -298,123 +322,128 @@ ResetISR(void) {
|
||||
//
|
||||
#ifndef DONT_RESET_ON_RESTART
|
||||
|
||||
// Disable interrupts
|
||||
__asm volatile ("cpsid i");
|
||||
// equivalent to CMSIS '__disable_irq()' function
|
||||
// Disable interrupts
|
||||
__asm volatile ("cpsid i");
|
||||
// equivalent to CMSIS '__disable_irq()' function
|
||||
|
||||
unsigned int *RESET_CONTROL = (unsigned int *) 0x40053100;
|
||||
// LPC_RGU->RESET_CTRL0 @ 0x40053100
|
||||
// LPC_RGU->RESET_CTRL1 @ 0x40053104
|
||||
// Note that we do not use the CMSIS register access mechanism,
|
||||
// as there is no guarantee that the project has been configured
|
||||
// to use CMSIS.
|
||||
unsigned int *RESET_CONTROL = (unsigned int *) 0x40053100;
|
||||
// LPC_RGU->RESET_CTRL0 @ 0x40053100
|
||||
// LPC_RGU->RESET_CTRL1 @ 0x40053104
|
||||
// Note that we do not use the CMSIS register access mechanism,
|
||||
// as there is no guarantee that the project has been configured
|
||||
// to use CMSIS.
|
||||
|
||||
// Write to LPC_RGU->RESET_CTRL0
|
||||
*(RESET_CONTROL+0) = 0x10DF0000;
|
||||
// GPIO_RST|AES_RST|ETHERNET_RST|SDIO_RST|DMA_RST|
|
||||
// USB1_RST|USB0_RST|LCD_RST
|
||||
// Write to LPC_RGU->RESET_CTRL0
|
||||
*(RESET_CONTROL + 0) = 0x10DF1000;
|
||||
// GPIO_RST|AES_RST|ETHERNET_RST|SDIO_RST|DMA_RST|
|
||||
// USB1_RST|USB0_RST|LCD_RST|M0_SUB_RST
|
||||
|
||||
// Write to LPC_RGU->RESET_CTRL1
|
||||
*(RESET_CONTROL+1) = 0x01DFF7FF;
|
||||
// M0APP_RST|CAN0_RST|CAN1_RST|I2S_RST|SSP1_RST|SSP0_RST|
|
||||
// I2C1_RST|I2C0_RST|UART3_RST|UART1_RST|UART1_RST|UART0_RST|
|
||||
// DAC_RST|ADC1_RST|ADC0_RST|QEI_RST|MOTOCONPWM_RST|SCT_RST|
|
||||
// RITIMER_RST|TIMER3_RST|TIMER2_RST|TIMER1_RST|TIMER0_RST
|
||||
// Write to LPC_RGU->RESET_CTRL1
|
||||
*(RESET_CONTROL + 1) = 0x01DFF7FF;
|
||||
// M0APP_RST|CAN0_RST|CAN1_RST|I2S_RST|SSP1_RST|SSP0_RST|
|
||||
// I2C1_RST|I2C0_RST|UART3_RST|UART1_RST|UART1_RST|UART0_RST|
|
||||
// DAC_RST|ADC1_RST|ADC0_RST|QEI_RST|MOTOCONPWM_RST|SCT_RST|
|
||||
// RITIMER_RST|TIMER3_RST|TIMER2_RST|TIMER1_RST|TIMER0_RST
|
||||
|
||||
// Clear all pending interrupts in the NVIC
|
||||
volatile unsigned int *NVIC_ICPR = (unsigned int *) 0xE000E280;
|
||||
unsigned int irqpendloop;
|
||||
for (irqpendloop = 0; irqpendloop < 8; irqpendloop++) {
|
||||
*(NVIC_ICPR+irqpendloop)= 0xFFFFFFFF;
|
||||
}
|
||||
// Clear all pending interrupts in the NVIC
|
||||
volatile unsigned int *NVIC_ICPR = (unsigned int *) 0xE000E280;
|
||||
unsigned int irqpendloop;
|
||||
for (irqpendloop = 0; irqpendloop < 8; irqpendloop++) {
|
||||
*(NVIC_ICPR + irqpendloop) = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
// Reenable interrupts
|
||||
__asm volatile ("cpsie i");
|
||||
// equivalent to CMSIS '__enable_irq()' function
|
||||
// Reenable interrupts
|
||||
__asm volatile ("cpsie i");
|
||||
// equivalent to CMSIS '__enable_irq()' function
|
||||
|
||||
#endif // ifndef DONT_RESET_ON_RESTART
|
||||
// *************************************************************
|
||||
|
||||
#if defined (__USE_LPCOPEN)
|
||||
SystemInit();
|
||||
#endif
|
||||
|
||||
//
|
||||
// Copy the data sections from flash to SRAM.
|
||||
//
|
||||
unsigned int LoadAddr, ExeAddr, SectionLen;
|
||||
unsigned int *SectionTableAddr;
|
||||
unsigned int LoadAddr, ExeAddr, SectionLen;
|
||||
unsigned int *SectionTableAddr;
|
||||
|
||||
// Load base address of Global Section Table
|
||||
SectionTableAddr = &__data_section_table;
|
||||
// Load base address of Global Section Table
|
||||
SectionTableAddr = &__data_section_table;
|
||||
|
||||
// Copy the data sections from flash to SRAM.
|
||||
while (SectionTableAddr < &__data_section_table_end) {
|
||||
LoadAddr = *SectionTableAddr++;
|
||||
ExeAddr = *SectionTableAddr++;
|
||||
SectionLen = *SectionTableAddr++;
|
||||
data_init(LoadAddr, ExeAddr, SectionLen);
|
||||
}
|
||||
// At this point, SectionTableAddr = &__bss_section_table;
|
||||
// Zero fill the bss segment
|
||||
while (SectionTableAddr < &__bss_section_table_end) {
|
||||
ExeAddr = *SectionTableAddr++;
|
||||
SectionLen = *SectionTableAddr++;
|
||||
bss_init(ExeAddr, SectionLen);
|
||||
}
|
||||
while (SectionTableAddr < &__data_section_table_end) {
|
||||
LoadAddr = *SectionTableAddr++;
|
||||
ExeAddr = *SectionTableAddr++;
|
||||
SectionLen = *SectionTableAddr++;
|
||||
data_init(LoadAddr, ExeAddr, SectionLen);
|
||||
}
|
||||
// At this point, SectionTableAddr = &__bss_section_table;
|
||||
// Zero fill the bss segment
|
||||
while (SectionTableAddr < &__bss_section_table_end) {
|
||||
ExeAddr = *SectionTableAddr++;
|
||||
SectionLen = *SectionTableAddr++;
|
||||
bss_init(ExeAddr, SectionLen);
|
||||
}
|
||||
|
||||
#if !defined (__USE_LPCOPEN)
|
||||
// LPCOpen init code deals with FP and VTOR initialisation
|
||||
#if defined (__VFP_FP__) && !defined (__SOFTFP__)
|
||||
/*
|
||||
* Code to enable the Cortex-M4 FPU only included
|
||||
* if appropriate build options have been selected.
|
||||
* Code taken from Section 7.1, Cortex-M4 TRM (DDI0439C)
|
||||
*/
|
||||
// CPACR is located at address 0xE000ED88
|
||||
asm("LDR.W R0, =0xE000ED88");
|
||||
// Read CPACR
|
||||
asm("LDR R1, [R0]");
|
||||
// Set bits 20-23 to enable CP10 and CP11 coprocessors
|
||||
asm(" ORR R1, R1, #(0xF << 20)");
|
||||
// Write back the modified value to the CPACR
|
||||
asm("STR R1, [R0]");
|
||||
/*
|
||||
* Code to enable the Cortex-M4 FPU only included
|
||||
* if appropriate build options have been selected.
|
||||
* Code taken from Section 7.1, Cortex-M4 TRM (DDI0439C)
|
||||
*/
|
||||
// CPACR is located at address 0xE000ED88
|
||||
asm("LDR.W R0, =0xE000ED88");
|
||||
// Read CPACR
|
||||
asm("LDR R1, [R0]");
|
||||
// Set bits 20-23 to enable CP10 and CP11 coprocessors
|
||||
asm(" ORR R1, R1, #(0xF << 20)");
|
||||
// Write back the modified value to the CPACR
|
||||
asm("STR R1, [R0]");
|
||||
#endif // (__VFP_FP__) && !(__SOFTFP__)
|
||||
|
||||
// ******************************
|
||||
// Check to see if we are running the code from a non-zero
|
||||
// ******************************
|
||||
// Check to see if we are running the code from a non-zero
|
||||
// address (eg RAM, external flash), in which case we need
|
||||
// to modify the VTOR register to tell the CPU that the
|
||||
// vector table is located at a non-0x0 address.
|
||||
|
||||
// Note that we do not use the CMSIS register access mechanism,
|
||||
// as there is no guarantee that the project has been configured
|
||||
// to use CMSIS.
|
||||
unsigned int * pSCB_VTOR = (unsigned int *) 0xE000ED08;
|
||||
if ((unsigned int *)g_pfnVectors!=(unsigned int *) 0x00000000) {
|
||||
// CMSIS : SCB->VTOR = <address of vector table>
|
||||
*pSCB_VTOR = (unsigned int)g_pfnVectors;
|
||||
}
|
||||
// Note that we do not use the CMSIS register access mechanism,
|
||||
// as there is no guarantee that the project has been configured
|
||||
// to use CMSIS.
|
||||
unsigned int * pSCB_VTOR = (unsigned int *) 0xE000ED08;
|
||||
if ((unsigned int *) g_pfnVectors != (unsigned int *) 0x00000000) {
|
||||
// CMSIS : SCB->VTOR = <address of vector table>
|
||||
*pSCB_VTOR = (unsigned int) g_pfnVectors;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __USE_CMSIS
|
||||
SystemInit();
|
||||
#if defined (__USE_CMSIS)
|
||||
SystemInit();
|
||||
#endif
|
||||
|
||||
#if defined (__cplusplus)
|
||||
//
|
||||
// Call C++ library initialisation
|
||||
//
|
||||
__libc_init_array();
|
||||
//
|
||||
// Call C++ library initialisation
|
||||
//
|
||||
__libc_init_array();
|
||||
#endif
|
||||
|
||||
#if defined (__REDLIB__)
|
||||
// Call the Redlib library, which in turn calls main()
|
||||
__main() ;
|
||||
// Call the Redlib library, which in turn calls main()
|
||||
__main();
|
||||
#else
|
||||
main();
|
||||
main();
|
||||
#endif
|
||||
|
||||
//
|
||||
// main() shouldn't return, but if it does, we'll just enter an infinite loop
|
||||
//
|
||||
while (1) {
|
||||
;
|
||||
}
|
||||
//
|
||||
// main() shouldn't return, but if it does, we'll just enter an infinite loop
|
||||
//
|
||||
while (1) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
@ -422,66 +451,48 @@ ResetISR(void) {
|
||||
// handler routines in your application code.
|
||||
//*****************************************************************************
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
void NMI_Handler(void)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
void NMI_Handler(void) {
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
void HardFault_Handler(void)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
void HardFault_Handler(void) {
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
void MemManage_Handler(void)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
void MemManage_Handler(void) {
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
void BusFault_Handler(void)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
void BusFault_Handler(void) {
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
void UsageFault_Handler(void)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
void UsageFault_Handler(void) {
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
void SVC_Handler(void)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
void SVC_Handler(void) {
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
void DebugMon_Handler(void)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
void DebugMon_Handler(void) {
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
void PendSV_Handler(void)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
void PendSV_Handler(void) {
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
void SysTick_Handler(void)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
void SysTick_Handler(void) {
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
||||
@ -492,9 +503,7 @@ void SysTick_Handler(void)
|
||||
//
|
||||
//*****************************************************************************
|
||||
__attribute__ ((section(".after_vectors")))
|
||||
void IntDefaultHandler(void)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
void IntDefaultHandler(void) {
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -119,6 +119,9 @@
|
||||
#error TUSB_CFG_ATTR_USBRAM is not defined, please help me know how to place data in accessible RAM for usb controller
|
||||
#endif
|
||||
|
||||
#ifndef TUSB_OS_NONE
|
||||
#define TUSB_CFG_OS TUSB_OS_NONE
|
||||
#endif
|
||||
|
||||
#if (TUSB_CFG_OS != TUSB_OS_NONE) && !defined (TUSB_CFG_OS_TASK_PRIO)
|
||||
#error TUSB_CFG_OS_TASK_PRIO need to be defined (hint: use the highest if possible)
|
||||
|
Loading…
x
Reference in New Issue
Block a user