UPS PIco HV3.0A Firmware Code 040 Print Date 18.08.2017
Designed and Manufactured by PiModules and ModMyPi
www.pimodules.com www.modmypi.com
UPS PIco HV3.0 HAT Sound Generation System
The
UPS PIco HV3.0 HAT
is equipped with Enhanced Sound Generation System. It is providing
a user interface on various states of UPS
PIco HV3.0 HAT
conditions, but it is also available for
dedicated user applications offering the whole range of acoustic frequencies full
programmable by user.
There are 2 registers that are responsible for the generating sound
bfreq
and
bdur
. To
generate sound user, need to program first the required frequency and then the required
duration is 10
th
of ms.
Current implementation need to program one be one sound when generated. The maximum
duration is 255 x 10 ms = 2.55 seconds
Additionally, it is possible to deactivate it permanently, by setting the bmode register to 0x00.
The default value is active
0x0D
bmode
Byte
Common
R/W
Integrated Sounder Mode
Read:
Anytime, Return actual
bmode
value
Write:
0x00
–
Unconditional Disable the Sounder
Write:
0x01
–
Unconditional Enable the Sounder
Default Value:
0x01
0x0E
bfreq
Word
Common
R/W
Frequency of sound in Hz
0x10
bdur
Byte
Common
R/W
Duration of sound in 10
th
of ms (10 = 100 ms)
Example of use
sudo i2cset -y 1 0x6D 0x00
Deactivate permanently the buzzer (no sunds wil be played)
sudo i2cset -y 1 0x6D 0x01 A
ctivate permanently the buzzer (default value)
In order to play sound buzzer need to be activated firstly.
sudo i2cset -y 1 0x6B 0x0e 1047 w
Set the frequency to C (1047 Hz) note
sudo i2cset -y 1 0x6B 0x10 100
Set the duration to 1 second
After Sound execution, the
bdur
register is 0 again.