Skip to content

Commit 9325de2

Browse files
authored
Merge pull request #3 from ams-OSRAM/v4.0
upgraded to evm_2.2.6 v4
2 parents 97a11dc + b2b547f commit 9325de2

8 files changed

Lines changed: 24 additions & 10 deletions

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
1.0 first released version
33
2.0 arduino zmq server improved
44
3.0 hexfile changed; support for _hv_cp_overload_detect, i2c_slave_address
5+
4.0 in stop measurement check for device is wake up; for standby timed mode

tmf8829/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
1.0 first released version
33
2.0 arduino zmq server improved
44
3.0 hexfile changed; support for _hv_cp_overload_detect, i2c_slave_address
5+
4.0 in stop measurement check for device is wake up; for standby timed mode

tmf8829/tmf8829_application.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Tmf8829Application(Tmf8829Bootloader, Tmf8829AppCommon):
2424
"""The TMF8829 application class for the Shield Evm Board.
2525
"""
2626

27-
VERSION = 1.12
27+
VERSION = 1.13
2828
"""Version log
2929
- 1.0 First version
3030
- 1.1 add FP mode 48x32
@@ -39,6 +39,7 @@ class Tmf8829Application(Tmf8829Bootloader, Tmf8829AppCommon):
3939
- 1.10 added support for dual mode
4040
- 1.11 splitted up tmf8829_application to tmf8829_application_common and tmf8829_application
4141
- 1.12 support for motion detection and proximity
42+
- 1.13 check in stop Measurement if device is wakeup; for standby timed mode
4243
"""
4344

4445
def __init__(self, hal:HalRegisterIo, gpio_hal:HalRegisterIo=None ):
@@ -122,6 +123,10 @@ def stopMeasure(self):
122123
Return:
123124
int: the read-back response
124125
"""
126+
127+
if not self.isDeviceWakeup():
128+
self.wakeUp()
129+
125130
self.enableInt( 0 ) # disable all interrupts
126131
self.clearIntStatus( 0xFF ) # clear any old pending interrupts
127132
return self.sendCommand(cmd=Tmf8829AppRegs.TMF8829_CMD_STAT._cmd_stat._CMD_STOP, wait_only_for_ok=True)

tmf8829/tmf8829_application_registers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# * *
55
# *FOR FULL LICENSE TEXT SEE LICENSES-MIT.TXT *
66
# *****************************************************************************
7+
78
import ctypes
89

910
class Tmf8829_application_registers:

tmf8829/tmf8829_conv.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,25 @@
2727
TOF_GPIO5 = 1 << corefw_c.evm_h5.PioId.IXC2_SDA
2828
TOF_GPIO6 = 1 << corefw_c.evm_h5.PioId.GPIO0
2929

30-
def createTmf8829( use_spi=True, i2c_slave_addr=FRESNEL_I2C_ADDR, spi_mode= 0, log=False):
30+
def createTmf8829( use_spi=True, i2c_slave_addr=FRESNEL_I2C_ADDR, spi_mode=0, log=False, use_i3c=False ):
3131
"""Function creates the needed communication """
3232
import sys
3333
from tmf8829_application import Tmf8829Application
3434

3535
print(sys.path)
3636

3737
com = Host( log=log )
38-
if use_spi:
39-
from aos_com.spi_hal_register_io import SpiHalRegisterIo as Hal
40-
hal = Hal( ic_com=com, spi_mode=spi_mode)
41-
else:
42-
from aos_com.i2c_hal_register_io import I2cHalRegisterIo as Hal
38+
39+
if use_i3c:
40+
from aos_com.i3c_hal_register_io import I3cHalRegisterIo as Hal
4341
hal = Hal( ic_com=com, dev_addr = i2c_slave_addr )
42+
else:
43+
if use_spi:
44+
from aos_com.spi_hal_register_io import SpiHalRegisterIo as Hal
45+
hal = Hal( ic_com=com, spi_mode=spi_mode)
46+
else:
47+
from aos_com.i2c_hal_register_io import I2cHalRegisterIo as Hal
48+
hal = Hal( ic_com=com, dev_addr = i2c_slave_addr )
4449

4550
return Tmf8829Application( hal=hal, gpio_hal=hal )
4651

tmf8829/zeromq/tmf8829_host_com_reg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class Union(ctypes.Union, AsDictMixin):
134134
TMF8829_ZEROMQ_HOST_H5_BOARD = 4 # macro
135135
TMF8829_ZEROMQ_HEADER_INFO_SIZE = 64 # macro
136136
TMF8829_ZEROMQ_IDENTIFY_INFO_SIZE = 56 # macro
137-
EVM_VERSION = "2.2.5 " # macro
137+
EVM_VERSION = "2.2.6 " # macro
138138
class struct__tmf8829ZmqDeviceInfo(Structure):
139139
pass
140140

tmf8829/zeromq/tmf8829_zeromq_server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ class ZeroMqEVMServer(ZeroMqServer):
3131
to allow to configure the device.
3232
The data socket provides unidirectional measurement results and optional histograms.
3333
"""
34-
VERSION = 0x0003
34+
VERSION = 0x0004
3535
"""Version
3636
- 1 First zeromq server release version
3737
- 2 Second zeromq server release version
3838
SET_PRE_CONFIGURATION added
3939
- 3 Dual mode support
4040
- EVM Version 2.2.5 Set wakeup with startup
41+
- 4 for standby timed mode: check in stop measurement if device is Wakeup
4142
"""
4243

4344
APPLICATION_ID = 0x01

tmf8829/zeromq/tmf8829_zeromq_server_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def stop(self) -> None:
317317
def process(self):
318318
"""Function checks on both sockets if there are things to be done. """
319319
_time = time.time()
320-
if not self._meas_running or self._last_cmd_poll + self._cmd_poll_interval < _time: # when not running poll faster for commands
320+
if (not self._meas_running) or ((self._last_cmd_poll + self._cmd_poll_interval) < _time): # when not running poll faster for commands
321321
if self._cmd_socket.poll(timeout=1) != 0: # events queued within our time limit
322322
request = Tmf8829zeroMQRequestMessage(client_id=TMF8829_ZEROMQ_CLIENT_NOT_IDENTIFIED,buffer=self._cmd_socket.recv())
323323
logger.debug("Received: %s", request)

0 commit comments

Comments
 (0)