added xua_api.h for extern declaration of get/set_usb_to/from_device_rate/res APIs and removed from c/xc files

This commit is contained in:
Keith Au
2020-02-28 15:53:27 +08:00
parent d125860552
commit d3f2220be4
3 changed files with 21 additions and 13 deletions

18
lib_xua/api/xua_api.h Normal file
View File

@@ -0,0 +1,18 @@
// Copyright (c) 2017-2020, XMOS Ltd, All rights reserved
#ifndef __XUA_API_H__
#define __XUA_API_H__
#if __XC__
extern void set_usb_to_device_rate(uint32_t rate);
extern void set_device_to_usb_rate(uint32_t rate);
extern void set_usb_to_device_bit_res(uint32_t rate);
extern void set_device_to_usb_bit_res(uint32_t rate);
#endif
extern uint32_t get_usb_to_device_rate();
extern uint32_t get_device_to_usb_rate();
extern uint32_t get_usb_to_device_bit_res();
extern uint32_t get_device_to_usb_bit_res();
#endif //__XUA_API_H__

View File

@@ -7,6 +7,7 @@
#include "interrupt.h"
#include "xua_commands.h"
#include "xud.h"
#include "xua_api.h"
#ifdef NATIVE_DSD
#include "usbaudio20.h" /* Defines from the USB Audio 2.0 Specifications */
@@ -17,12 +18,6 @@
#endif
#define MAX(x,y) ((x)>(y) ? (x) : (y))
#if(defined XUA_USB_DESCRIPTOR_OVERWRITE_RATE_RES)
extern uint32_t get_usb_to_device_rate();
extern uint32_t get_device_to_usb_rate();
extern uint32_t get_usb_to_device_bit_res();
extern uint32_t get_device_to_usb_bit_res();
#endif
/* TODO use SLOTSIZE to potentially save memory */
/* Note we could improve on this, for one subslot is set to 4 */

View File

@@ -29,6 +29,8 @@
#include "dsd_support.h"
#endif
#include "xua_api.h"
#ifndef __XC__
/* Support for xCORE channels in C */
#define null 0
@@ -65,13 +67,6 @@ extern void device_reboot(void);
#include "xua_hid.h"
#endif
#if(defined XUA_USB_DESCRIPTOR_OVERWRITE_RATE_RES)
extern uint32_t get_usb_to_device_rate();
extern uint32_t get_device_to_usb_rate();
extern uint32_t get_usb_to_device_bit_res();
extern uint32_t get_device_to_usb_bit_res();
#endif
unsigned int DFU_mode_active = 0; // 0 - App active, 1 - DFU active
/* Global volume and mute tables */