CCAux  2.20.0.0
CCAux API reference
Functions
Buzzer functions

Functions

EXTERN_C CCAUXDLL_API BUZZERHANDLE CCAUXDLL_CALLING_CONV GetBuzzer (void)
 
EXTERN_C CCAUXDLL_API void CCAUXDLL_CALLING_CONV Buzzer_release (BUZZERHANDLE)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Buzzer_getFrequency (BUZZERHANDLE, uint16_t *frequency)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Buzzer_getVolume (BUZZERHANDLE, uint16_t *volume)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Buzzer_getScaledVolume (BUZZERHANDLE, uint8_t *volume)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Buzzer_getTrigger (BUZZERHANDLE, bool *trigger)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Buzzer_setFrequency (BUZZERHANDLE, uint16_t frequency)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Buzzer_setVolume (BUZZERHANDLE, uint16_t volume)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Buzzer_setScaledVolume (BUZZERHANDLE, uint8_t volume)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Buzzer_setTrigger (BUZZERHANDLE, bool trigger)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Buzzer_buzze (BUZZERHANDLE, int32_t time, bool blocking)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Buzzer_setActive (BUZZERHANDLE, ComponentLocation location)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Buzzer_getActive (BUZZERHANDLE, ComponentLocation *location)
 

Detailed Description

Functions in the Buzzer class

Function Documentation

◆ Buzzer_buzze()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Buzzer_buzze ( BUZZERHANDLE  ,
int32_t  time,
bool  blocking 
)

Buzzes for a specified time.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, VI2, V700, Yukon, V510, V710, V1000, V1200, X1200

Parameters
timeTime (ms) to buzz.
blockingBlocking or non-blocking function.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

err = Buzzer_setFrequency(pBuzzer, freq);
if (err != ERR_SUCCESS)
{
cout << "Error(" << err << ") in function setFrequency: " << GetErrorStringA(err) << endl;
}
else
{
err = Buzzer_buzze(pBuzzer, duration, true);
if (err != ERR_SUCCESS)
{
cout << "Error(" << err << ") in function buzze: " << GetErrorStringA(err) << endl;
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Buzzer_buzze(BUZZERHANDLE, int32_t time, bool blocking)
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Buzzer_setFrequency(BUZZERHANDLE, uint16_t frequency)
EXTERN_C CCAUXDLL_API char_t const *CCAUXDLL_CALLING_CONV GetErrorStringA(eErr errCode)
@ ERR_SUCCESS
Definition: CCAuxTypes.h:163

◆ Buzzer_getActive()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Buzzer_getActive ( BUZZERHANDLE  ,
ComponentLocation location 
)

Get active Buzzer

Supported Platform(s): Yukon, V510, V710, V1000, V1200

Parameters
locationLocation of the active Buzzer
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

◆ Buzzer_getFrequency()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Buzzer_getFrequency ( BUZZERHANDLE  ,
uint16_t frequency 
)

Get buzzer frequency.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, VI2, V700, Yukon, V510, V710, V1000, V1200, X1200

Parameters
frequencyCurrent frequency (700-10000 Hz).
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

◆ Buzzer_getScaledVolume()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Buzzer_getScaledVolume ( BUZZERHANDLE  ,
uint8_t volume 
)

Get scaled buzzer volume.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, VI2, V700, Yukon, V510, V710, V1000, V1200, X1200

Parameters
volumeCurrent volume 0-100%

Due limitation in HW, readback value may differ slightly from the value that was set.

Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

◆ Buzzer_getTrigger()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Buzzer_getTrigger ( BUZZERHANDLE  ,
bool *  trigger 
)

Get buzzer trigger. The Buzzer is enabled when the trigger is enabled.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, VI2, V700, Yukon, V510, V710, V1000, V1200, X1200

Parameters
triggerCurrent trigger status.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

◆ Buzzer_getVolume()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Buzzer_getVolume ( BUZZERHANDLE  ,
uint16_t volume 
)

Get buzzer volume.

Note: For platform compatibility, use Buzzer_getScaledVolume instead. This function may be removed in a future API version.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, VI2, V700, Yukon, V510, V710, V1000, V1200, X1200

Parameters
volumeCurrent volume (0-51) (VS: 0-2000) (VI2: 0-4095) (Yukon, V510, V710, V1000, V1200: 0-100).
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

err = Buzzer_getVolume(pBuzzer, &vol);
if (err == ERR_SUCCESS)
{
cout << "Buzzer volume was: " << vol << endl;
}
else
{
cout << "Error(" << err << ") in function getVolume: " << GetErrorStringA(err) << endl;
vol = 40;
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Buzzer_getVolume(BUZZERHANDLE, uint16_t *volume)

◆ Buzzer_release()

EXTERN_C CCAUXDLL_API void CCAUXDLL_CALLING_CONV CrossControl::Buzzer_release ( BUZZERHANDLE  )

Delete the Buzzer object.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, VI2, V700, Yukon, V510, V710, V1000, V1200, X1200

Returns
-

Example Usage:

assert(pBuzzer);
play_beeps(pBuzzer);
Buzzer_release(pBuzzer);
EXTERN_C CCAUXDLL_API BUZZERHANDLE CCAUXDLL_CALLING_CONV GetBuzzer(void)
EXTERN_C CCAUXDLL_API void CCAUXDLL_CALLING_CONV Buzzer_release(BUZZERHANDLE)
void * BUZZERHANDLE
Definition: Buzzer.h:32

◆ Buzzer_setActive()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Buzzer_setActive ( BUZZERHANDLE  ,
ComponentLocation  location 
)

Set active Buzzer.

Supported Platform(s): Yukon, V510, V710, V1000, V1200

Parameters
locationLocation of the Buzzer to set Active. Possible locations depends from platform.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

◆ Buzzer_setFrequency()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Buzzer_setFrequency ( BUZZERHANDLE  ,
uint16_t  frequency 
)

Set buzzer frequency.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, VI2, V700, Yukon, V510, V710, V1000, V1200, X1200

Parameters
frequencyFrequency to set (700-10000 Hz).
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

err = Buzzer_setFrequency(pBuzzer, freq);
if (err != ERR_SUCCESS)
{
cout << "Error(" << err << ") in function setFrequency: " << GetErrorStringA(err) << endl;
}
else
{
err = Buzzer_buzze(pBuzzer, duration, true);
if (err != ERR_SUCCESS)
{
cout << "Error(" << err << ") in function buzze: " << GetErrorStringA(err) << endl;
}

◆ Buzzer_setScaledVolume()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Buzzer_setScaledVolume ( BUZZERHANDLE  ,
uint8_t  volume 
)

Set scaled buzzer volume.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, VI2, V700, Yukon, V510, V710, V1000, V1200, X1200

Parameters
volumeVolume to set 0-100%.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

◆ Buzzer_setTrigger()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Buzzer_setTrigger ( BUZZERHANDLE  ,
bool  trigger 
)

Set buzzer trigger. The Buzzer is enabled when the trigger is enabled.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, VI2, V700, Yukon, V510, V710, V1000, V1200, X1200

Parameters
triggerStatus to set.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

◆ Buzzer_setVolume()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Buzzer_setVolume ( BUZZERHANDLE  ,
uint16_t  volume 
)

Set buzzer volume. Note: For platform compatibility, use Buzzer_setScaledVolume instead. This function may be removed in a future API version.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, VI2, V700, Yukon, V510, V710, V1000, V1200, X1200

Parameters
volumeVolume to set (0-51) (VS: 0-2000) (VI2: 0-4095) (V700: 0-50) (Yukon, V510, V710, V1000, V1200: 0-100)
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

err = Buzzer_setVolume(pBuzzer, 20);
if (err == ERR_SUCCESS)
{
cout << "Buzzer volume set to 20" << endl;
}
else
{
cout << "Error(" << err << ") in function setVolume: " << GetErrorStringA(err) << endl;
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Buzzer_setVolume(BUZZERHANDLE, uint16_t volume)

◆ GetBuzzer()

EXTERN_C CCAUXDLL_API BUZZERHANDLE CCAUXDLL_CALLING_CONV CrossControl::GetBuzzer ( void  )

Factory function that creates instances of the Buzzer object.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, VI2, V700, Yukon, V510, V710, V1000, V1200, X1200

Returns
BUZZERHANDLE to an allocated Buzzer object. The returned handle needs to be deallocated using the Buzzer_release(BUZZERHANDLE) method when it's no longer needed. Returns NULL if it fails to allocate memory.

Example Usage:

assert(pBuzzer);
play_beeps(pBuzzer);
Buzzer_release(pBuzzer);