|
| 1 | +Title: as6212_sample |
| 2 | + |
| 3 | +Description: |
| 4 | + |
| 5 | +An AS6212 Digital Temperature Alert sensor sample to demonstrate the |
| 6 | +capabilities of the T-Mobile DevEdge dev kit. |
| 7 | + |
| 8 | +Overview: |
| 9 | + |
| 10 | +This sample is provided as an example to demonstrate the high accuracy AS6212 |
| 11 | +Digital Temperature sensor with Alert functionality. The sample uses the |
| 12 | +AS6212's temperature high/low alerting mechanism to generate interrupts that |
| 13 | +awaken threads, which report the temperature data to the console and |
| 14 | +subsequently enter EM2 sleep mode. |
| 15 | + |
| 16 | +The alert-sourced interrupts, demonstrate the AS6212's temperature High and Low |
| 17 | +threshold alerting capability. |
| 18 | + |
| 19 | +- AS6212 Digital Temperature with Alert functionality. |
| 20 | + |
| 21 | +-------------------------------------------------------------------------------- |
| 22 | + |
| 23 | +Requirements |
| 24 | +************ |
| 25 | + |
| 26 | +-A T-Mobile DevEdge dev kit (https://devedge.t-mobile.com/) |
| 27 | +-A Zephyr build environment (https://docs.zephyrproject.org/latest/develop/getting_started/index.html) |
| 28 | + |
| 29 | +Building and Running Project: |
| 30 | + |
| 31 | +How this project can be built: |
| 32 | + |
| 33 | +-Checkout the T-Mobile downstream zephyr repo: |
| 34 | + cd ~/zephyrproject |
| 35 | + git clone https://github.com/tmobile/DevEdge-IoTDevKit-ZephyrRTOS zephyr |
| 36 | + |
| 37 | +-Checkout the T-Mobile zephyr-tmo-sdk repo: |
| 38 | + cd ~/zephyrproject |
| 39 | + git clone https://github.com/tmobile/DevEdge-IoTDevKit-ZephyrSDK tmo-zephyr-sdk |
| 40 | + |
| 41 | +-Run 'west update' |
| 42 | + cd ~/zephyrproject |
| 43 | + west update |
| 44 | + |
| 45 | +-Build this sample: |
| 46 | + cd ~/zephyrproject |
| 47 | + west build ~/zephyrproject/DevEdge-IoTDevKit-ZephyrSDK/samples/as6212_sample -p -b tmo_dev_edge |
| 48 | + (substitute your home folder for '<home folder>' in the command above) |
| 49 | + |
| 50 | +-Connect DevEdge dev kit: |
| 51 | + Connect the USB-C port furthest from the pushbutton to your computer. (The |
| 52 | + other USB-C port can be connected; however, it's not used for this sample.) |
| 53 | + |
| 54 | +-Flash as6212_sample |
| 55 | + cd ~/zephyrproject |
| 56 | + west flash |
| 57 | + |
| 58 | +Sample Output |
| 59 | +============= |
| 60 | + |
| 61 | +.. code-block:: console |
| 62 | +*** Booting Zephyr OS build 4d07b602dd77 *** |
| 63 | + |
| 64 | + Welcome to T-Mobile DevEdge! |
| 65 | + |
| 66 | +This application aims to demonstrate the Gecko's Energy Mode 2 (EM2) (Deep Sleep |
| 67 | +Mode) and Wake capabilities in conjunction with the temperature interrupt |
| 68 | +of DevEdge's (tmo_dev_edge) AMS OSRAM AS6212 Digital Temperature Sensor. |
| 69 | + |
| 70 | + Set SENSOR_ATTR_UPPER_THRESH (44) |
| 71 | + Set SENSOR_ATTR_LOWER_THRESH (38) |
| 72 | + |
| 73 | + Set temperature_alert |
| 74 | + |
| 75 | + Call enable_temp_alerts |
| 76 | + get_temperature(): temperature is 29.2656C |
| 77 | + |
| 78 | + as6212_thread1(): running |
| 79 | + get_temperature(): temperature is 29.2656C |
| 80 | + |
| 81 | + as6212_thread2(): running |
| 82 | + get_temperature(): temperature is 29.2656C |
| 83 | + |
| 84 | + |
| 85 | +Awaiting the AS6212 temperature threshold-high/threshold-low (interrupt) alerts. |
| 86 | + |
| 87 | +While observing the console output, use a hair dryer (or similar forced air |
| 88 | +heat source) to momentarily raise the temperature of DevEdge board, triggering |
| 89 | +the AS6212 temperature-high alert. Remove the heat source and wait for the |
| 90 | +AS6212 temperature-low alert. |
| 91 | + |
| 92 | + |
| 93 | +as6212_intr_callback(): Received AS6212 Temperature Sensor ALERT Interrupt (1) |
| 94 | + as6212_thread1(): running |
| 95 | + get_temperature(): temperature is 44.0312C |
| 96 | + |
| 97 | + as6212_thread2(): running |
| 98 | + get_temperature(): temperature is 44.0312C |
| 99 | + |
| 100 | + |
| 101 | +as6212_intr_callback(): Received AS6212 Temperature Sensor ALERT Interrupt (2) |
| 102 | + as6212_thread1(): running |
| 103 | + get_temperature(): temperature is 37.9766C |
| 104 | + |
| 105 | + as6212_thread2(): running |
| 106 | + get_temperature(): temperature is 37.9766C |
| 107 | + |
0 commit comments