Audio#

The hardware abstraction layer only supports a minimal audio interface. It is only possible to play a single short tone. Any platform that wants to support audio should implement this function.

Functions#

Functions

void audioTone(uint32_t frequency)#

Plays a tone.

Each hardware platform that supports playing audio should implement this method to play a short tone of a given frequency. This is the only supported audio playback. Configuration for a “silent mode” is not covered by this function and should be checked by the caller.

Parameters:
  • frequency[in] the frequency of the note to play in mHz

void fnSetVolume(uint16_t volume)#

Set Buzzer volume on the calculator.

Only relevant for the DMCP version, not used for the simulator Input : volume level from 0 to 11

void fnGetVolume(uint16_t volume)#

Get Buzzer volume on the calculator.

Only relevant for the DMCP version, not used for the simulator Output : volume level from 0 to 11

void fnVolumeUp(uint16_t unusedButMandatoryParameter)#

Increase Buzzer volume on the calculator.

Only relevant for the DMCP version, not used for the simulator

void fnVolumeDown(uint16_t unusedButMandatoryParameter)#

Decrease Buzzer volume on the calculator.

Only relevant for the DMCP version, not used for the simulator

void squeak()#

DM42 squeak sound Only relevant for the DMCP version, not used for the simulator.

void fnBuzz(uint16_t unusedButMandatoryParameter)#

Play a sound on the buzzer whose frequency is in Y and duration in X.

Only relevant for the DMCP version, not used for the simulator

void fnPlay(uint16_t regist)#

Play a melody on the buzzer whose notes frequency and durations are in a Nx2 matrix.

Only relevant for the DMCP version, not used for the simulator

uint16_t getBeepVolume()#

Example#

To play the note C with frequency 277.183Hz, you would call

audioTone(277183);

Note that frequencies are in mHz.