/////////////////////////////////////////////////////////////////////
//                                                                 //
// file: autoGen_USBSystemClass_CCA.h                              //
//                                                                 //
/////////////////////////////////////////////////////////////////////
//                                                                 //
// Copyright (c) 2026 Acroname Inc. - All Rights Reserved          //
//                                                                 //
// This file is part of the BrainStem release. See the license.txt //
// file included with this package or go to                        //
// https://acroname.com/software/brainstem-development-kit         //
// for full license details.                                       //
/////////////////////////////////////////////////////////////////////

#ifndef __AUTOGEN_USBSYSTEM_CCA_H__
#define __AUTOGEN_USBSYSTEM_CCA_H__

// This file was auto-generated. Do not modify.

#include "CCA_Core.h"

#ifdef __GNUC__
#define DEPRECATED(...) __attribute__((deprecated(__VA_ARGS__)))
#elif defined(_MSC_VER)
#define DEPRECATED(...) __declspec(deprecated(__VA_ARGS__))
#else
#define DEPRECATED(...)
#pragma message("DEPRECATED is not defined for this compiler")
#endif

/// \defgroup USBSystemEntity USBSystem Entity
/// The USBSystem class provides high level control of the lower level Port Class.
///

#ifdef __cplusplus
extern "C" {
#endif

/// Gets the upstream port.
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
///     \li value: The current upstream port.
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code and the requested value if successful.
/// \param index The index of the entity in question.
/// 
aLIBEXPORT void __stdcall usbsystem_getUpstream(unsigned int* id, struct Result* result, const int index);

/// Sets the upstream port.
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code.
/// \param index The index of the entity in question.
/// \param port The upstream port to set.
/// 
aLIBEXPORT void __stdcall usbsystem_setUpstream(unsigned int* id, struct Result* result, const int index, const unsigned char port);

/// Gets the inter-port enumeration delay in milliseconds.
/// Delay is applied upon hub enumeration.
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
///     \li value: the current inter-port delay in milliseconds.
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code and the requested value if successful.
/// \param index The index of the entity in question.
/// 
aLIBEXPORT void __stdcall usbsystem_getEnumerationDelay(unsigned int* id, struct Result* result, const int index);

/// Sets the inter-port enumeration delay in milliseconds.
/// Delay is applied upon hub enumeration.
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code.
/// \param index The index of the entity in question.
/// \param msDelay The delay in milliseconds to be applied between port enables
/// 
aLIBEXPORT void __stdcall usbsystem_setEnumerationDelay(unsigned int* id, struct Result* result, const int index, const unsigned int msDelay);

/// Gets the data role of all ports with a single call
/// Equivalent to calling PortClass::getDataRole() on each individual port.
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
///     \li value: A bit packed representation of the data role for all ports.
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code and the requested value if successful.
/// \param index The index of the entity in question.
/// 
aLIBEXPORT void __stdcall usbsystem_getDataRoleList(unsigned int* id, struct Result* result, const int index);

/// Gets the current enabled status of all ports with a single call.
/// Equivalent to calling PortClass::setEnabled() on each port.
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
///     \li value: Bit packed representation of the enabled status for all ports.
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code and the requested value if successful.
/// \param index The index of the entity in question.
/// 
aLIBEXPORT void __stdcall usbsystem_getEnabledList(unsigned int* id, struct Result* result, const int index);

/// Sets the enabled status of all ports with a single call.
/// Equivalent to calling PortClass::setEnabled() on each port.
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code.
/// \param index The index of the entity in question.
/// \param enabledList Bit packed representation of the enabled status for all ports to be
///        applied.
/// 
aLIBEXPORT void __stdcall usbsystem_setEnabledList(unsigned int* id, struct Result* result, const int index, const unsigned int enabledList);

/// Gets the current mode of all ports with a single call.
/// Equivalent to calling PortClass:getMode() on each port.
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
///     \li value: Length that was actually received and filled.
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code and the requested value if successful.
/// \param index The index of the entity in question.
/// \param buffer pointer to the start of a c style buffer to be filled
/// \param bufferLength Length of the buffer to be filed
/// 
aLIBEXPORT void __stdcall usbsystem_getModeList(unsigned int* id, struct Result* result, const int index, unsigned int* buffer, const unsigned int bufferLength);

/// Sets the mode of all ports with a single call.
/// Equivalent to calling PortClass::setMode() on each port
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code.
/// \param index The index of the entity in question.
/// \param buffer Pointer to the start of a c style buffer to be transferred.
/// \param bufferLength Length of the buffer to be transferred.
/// 
aLIBEXPORT void __stdcall usbsystem_setModeList(unsigned int* id, struct Result* result, const int index, const unsigned int* buffer, const unsigned int bufferLength);

/// Gets the state for all ports with a single call.
/// Equivalent to calling PortClass::getState() on each port.
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
///     \li value: Length that was actually received and filled.
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code and the requested value if successful.
/// \param index The index of the entity in question.
/// \param buffer pointer to the start of a c style buffer to be filled
/// \param bufferLength Length of the buffer to be filed
/// 
aLIBEXPORT void __stdcall usbsystem_getStateList(unsigned int* id, struct Result* result, const int index, unsigned int* buffer, const unsigned int bufferLength);

/// Gets the behavior of the power manager.
/// The power manager is responsible for budgeting the power of the system, i.e. What happens
///   when requested power greater than available power.
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
///     \li value: Variable to be filled with an enumerated representation of behavior.
///              Available behaviors are product specific. See the reference documentation.
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code and the requested value if successful.
/// \param index The index of the entity in question.
/// 
aLIBEXPORT void __stdcall usbsystem_getPowerBehavior(unsigned int* id, struct Result* result, const int index);

/// Sets the behavior of how available power is managed, i.e. What happens when requested
///   power is greater than available power.
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code.
/// \param index The index of the entity in question.
/// \param behavior An enumerated representation of behavior.
///        Available behaviors are product specific. See the reference documentation.
/// 
aLIBEXPORT void __stdcall usbsystem_setPowerBehavior(unsigned int* id, struct Result* result, const int index, const unsigned char behavior);

/// Gets the current power behavior configuration.
/// Certain power behaviors use a list of ports to determine priority when budgeting power.
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
///     \li value: Length that was actually received and filled.
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code and the requested value if successful.
/// \param index The index of the entity in question.
/// \param buffer pointer to the start of a c style buffer to be filled
/// \param bufferLength Length of the buffer to be filed
/// 
aLIBEXPORT void __stdcall usbsystem_getPowerBehaviorConfig(unsigned int* id, struct Result* result, const int index, unsigned int* buffer, const unsigned int bufferLength);

/// Sets the current power behavior configuration.
/// Certain power behaviors use a list of ports to determine priority when budgeting power.
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code.
/// \param index The index of the entity in question.
/// \param buffer Pointer to the start of a c style buffer to be transferred.
/// \param bufferLength Length of the buffer to be transferred.
/// 
aLIBEXPORT void __stdcall usbsystem_setPowerBehaviorConfig(unsigned int* id, struct Result* result, const int index, const unsigned int* buffer, const unsigned int bufferLength);

/// Gets the behavior of how upstream and downstream ports are determined, i.e. How do you
///   manage requests for data role swaps and new upstream connections.
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
///     \li value: Variable to be filled with an enumerated representation of behavior.
///              Available behaviors are product specific. See the reference documentation.
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code and the requested value if successful.
/// \param index The index of the entity in question.
/// 
aLIBEXPORT void __stdcall usbsystem_getDataRoleBehavior(unsigned int* id, struct Result* result, const int index);

/// Sets the behavior of how upstream and downstream ports are determined, i.e. How do you
///   manage requests for data role swaps and new upstream connections.
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code.
/// \param index The index of the entity in question.
/// \param behavior An enumerated representation of behavior.
///        Available behaviors are product specific. See the reference documentation.
/// 
aLIBEXPORT void __stdcall usbsystem_setDataRoleBehavior(unsigned int* id, struct Result* result, const int index, const unsigned char behavior);

/// Gets the current data role behavior configuration.
/// Certain data role behaviors use a list of ports to determine priority host priority.
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
///     \li value: Length that was actually received and filled.
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code and the requested value if successful.
/// \param index The index of the entity in question.
/// \param buffer pointer to the start of a c style buffer to be filled
/// \param bufferLength Length of the buffer to be filed
/// 
aLIBEXPORT void __stdcall usbsystem_getDataRoleBehaviorConfig(unsigned int* id, struct Result* result, const int index, unsigned int* buffer, const unsigned int bufferLength);

/// Sets the current data role behavior configuration.
/// Certain data role behaviors use a list of ports to determine host priority.
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code.
/// \param index The index of the entity in question.
/// \param buffer Pointer to the start of a c style buffer to be transferred.
/// \param bufferLength Length of the buffer to be transferred.
/// 
aLIBEXPORT void __stdcall usbsystem_setDataRoleBehaviorConfig(unsigned int* id, struct Result* result, const int index, const unsigned int* buffer, const unsigned int bufferLength);

/// Gets the current mode of the selector input.
/// This mode determines what happens and in what order when the external selector input is
///   used.
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
///     \li value: Variable to be filled with the selector mode
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code and the requested value if successful.
/// \param index The index of the entity in question.
/// 
aLIBEXPORT void __stdcall usbsystem_getSelectorMode(unsigned int* id, struct Result* result, const int index);

/// Sets the current mode of the selector input.
/// This mode determines what happens and in what order when the external selector input is
///   used.
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code.
/// \param index The index of the entity in question.
/// \param mode Mode to be set.
/// 
aLIBEXPORT void __stdcall usbsystem_setSelectorMode(unsigned int* id, struct Result* result, const int index, const unsigned char mode);

/// Gets the USB HighSpeed upstream port.
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
///     \li value: The current upstream port.
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code and the requested value if successful.
/// \param index The index of the entity in question.
/// 
aLIBEXPORT void __stdcall usbsystem_getUpstreamHS(unsigned int* id, struct Result* result, const int index);

/// Sets the USB HighSpeed upstream port.
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code.
/// \param index The index of the entity in question.
/// \param port The upstream port to set.
/// 
aLIBEXPORT void __stdcall usbsystem_setUpstreamHS(unsigned int* id, struct Result* result, const int index, const unsigned char port);

/// Gets the USB SuperSpeed upstream port.
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
///     \li value: The current upstream port.
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code and the requested value if successful.
/// \param index The index of the entity in question.
/// 
aLIBEXPORT void __stdcall usbsystem_getUpstreamSS(unsigned int* id, struct Result* result, const int index);

/// Sets the USB SuperSpeed upstream port.
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code.
/// \param index The index of the entity in question.
/// \param port The upstream port to set.
/// 
aLIBEXPORT void __stdcall usbsystem_setUpstreamSS(unsigned int* id, struct Result* result, const int index, const unsigned char port);

/// Gets the current enabled overrides
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
///     \li value: Bit mapped representation of the current override configuration.
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code and the requested value if successful.
/// \param index The index of the entity in question.
/// 
aLIBEXPORT void __stdcall usbsystem_getOverride(unsigned int* id, struct Result* result, const int index);

/// Sets the current enabled overrides
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code.
/// \param index The index of the entity in question.
/// \param overrides Overrides to be set in a bit mapped representation.
/// 
aLIBEXPORT void __stdcall usbsystem_setOverride(unsigned int* id, struct Result* result, const int index, const unsigned int overrides);

/// Sets the USB HighSpeed Max datarate
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code.
/// \param index The index of the entity in question.
/// \param datarate Maximum datarate for the USB HighSpeed signals.
/// 
aLIBEXPORT void __stdcall usbsystem_setDataHSMaxDatarate(unsigned int* id, struct Result* result, const int index, const unsigned int datarate);

/// Gets the USB HighSpeed Max datarate
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
///     \li value: Current maximum datarate for the USB HighSpeed signals.
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code and the requested value if successful.
/// \param index The index of the entity in question.
/// 
aLIBEXPORT void __stdcall usbsystem_getDataHSMaxDatarate(unsigned int* id, struct Result* result, const int index);

/// Sets the USB SuperSpeed Max datarate
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code.
/// \param index The index of the entity in question.
/// \param datarate Maximum datarate for the USB SuperSpeed signals.
/// 
aLIBEXPORT void __stdcall usbsystem_setDataSSMaxDatarate(unsigned int* id, struct Result* result, const int index, const unsigned int datarate);

/// Gets the USB SuperSpeed Max datarate
/// 
/// The result parameter will output the following fields:
///     \li error: \ref EntityReturnValues common entity return value
///     \li value: Current maximum datarate for the USB SuperSpeed signals.
/// 
/// \param id ID assigned through "module_createStem"
/// \param result Output object containing result code and the requested value if successful.
/// \param index The index of the entity in question.
/// 
aLIBEXPORT void __stdcall usbsystem_getDataSSMaxDatarate(unsigned int* id, struct Result* result, const int index);


#ifdef __cplusplus
}
#endif

#endif // __AUTOGEN_USBSYSTEM_CCA_H__