Ralph Yamamoto
Published © MIT

Personalized Home Automation Controller

A home automation controller that adapts to the preferences of the current user. It identifies the user by reading an NFC key tag.

IntermediateShowcase (no instructions)20 hours265

Things used in this project

Hardware components

Rapid IoT Prototyping Kit
NXP Rapid IoT Prototyping Kit
×1
MikroElektronika NFC Click
×1
MikroElektronika Hexiwear Battery Pack
×1
NFC Key Tag
×7

Software apps and online services

NXP Rapid IoT Studio IDE
Atmosphere IoT IDE
Maker service
IFTTT Maker service
Pushbullet

Story

Read more

Schematics

Hexiwear Battery Pack

Interfaces Rapid IoT module with NFC Click module

NFC Click Schematic

Shows connections to Hexiwear Battery Pack

Rapid IoT module extension connector

Shows connections to Hexiwear Battery Pack

Code

Home Controller .atmo file

C/C++
Remove .json file extension and import into Rapid IoT Studio
{
  "name": "Home Controller Project",
  "createVersion": "2017-08-12",
  "description": "Personalized Home Controller",
  "lastModified": "2019-01-13T01:14:57.477Z",
  "created": "2019-01-13T01:14:57.477Z",
  "meta": {
    "projectTypeName": "NXP Rapid IoT",
    "projectTypeId": "NxpRpk"
  },
  "planes": {
    "NXP Rapid IoT": {
      "type": "mcuxpresso",
      "compilerVersion": "latest",
      "variants": [
        "NxpRpk"
      ],
      "meta": {},
      "elements": [
        {
          "name": "GetTimeStr",
          "type": "EmbeddedFunction",
          "variants": [
            "embedded",
            "triggers",
            "abilities",
            "properties",
            "variables"
          ],
          "properties": {
            "errorData": {},
            "code": {
              "trigger": "\t\n\tchar dateTimeStr[128];\n\tchar dateStr[12];\n\tchar timeStr[6];\n\n\tATMO_DateTime_GetDateTimeIsoStr(0, dateTimeStr, sizeof(dateTimeStr));\n\tsscanf(dateTimeStr,\"%11c %5c\",dateStr,timeStr);\n\tATMO_CreateValueString(out, timeStr);\n\t\n\treturn ATMO_Status_Success;"
            },
            "variables": {},
            "embeddedPropertyConversions": {},
            "codeUserChanged": {
              "trigger": true
            }
          },
          "meta": {
            "editorX": 152,
            "editorY": 490,
            "lastTrigger": "triggered"
          },
          "triggers": {
            "triggered": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "StartPage",
                "targetAbility": "setLine3Text"
              }
            ]
          },
          "interruptAbilities": {
            "trigger": false
          },
          "abilities": [
            {
              "name": "trigger",
              "triggers": [
                "triggered"
              ]
            }
          ]
        },
        {
          "name": "IntervalStatus",
          "type": "EmbeddedInterval",
          "variants": [
            "embedded",
            "triggers",
            "abilities",
            "properties",
            "variables"
          ],
          "properties": {
            "errorData": {},
            "code": {
              "trigger": "\treturn ATMO_Status_Success;",
              "setup": "\n\tATMO_INTERVAL_Handle_t intervalHandle;\n    ATMO_INTERVAL_AddAbilityInterval(\n\t\tATMO_PROPERTY(IntervalStatus, instance), \n\t\tATMO_ABILITY(IntervalStatus, interval), \n\t\tATMO_PROPERTY(IntervalStatus, time), \n\t\t&intervalHandle\n\t);\n\t\n\treturn ATMO_Status_Success;\n\t",
              "interval": "\treturn ATMO_Status_Success;"
            },
            "variables": {},
            "embeddedPropertyConversions": {},
            "codeUserChanged": {
              "setup": false,
              "interval": false
            },
            "instance": "ATMO_DRIVERINSTANCE_INTERVAL_INTERVAL1",
            "time": 1000
          },
          "meta": {
            "editorX": 49,
            "editorY": 390,
            "lastTrigger": "interval"
          },
          "triggers": {
            "triggered": [],
            "interval": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "GetTimeStr",
                "targetAbility": "trigger"
              },
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "GetBatteryLevel",
                "targetAbility": "trigger"
              }
            ]
          },
          "interruptAbilities": {
            "trigger": false,
            "setup": false,
            "interval": true
          },
          "abilities": [
            {
              "name": "trigger",
              "triggers": [
                "triggered"
              ]
            },
            {
              "name": "setup",
              "triggers": []
            },
            {
              "name": "interval",
              "triggers": [
                "interval"
              ]
            }
          ]
        },
        {
          "name": "StartPage",
          "type": "EmbeddedIconLinesDisplay",
          "variants": [
            "embedded",
            "triggers",
            "abilities",
            "properties",
            "variables",
            "rpk"
          ],
          "properties": {
            "errorData": {},
            "code": {
              "trigger": "\treturn ATMO_Status_Success;",
              "displayPage": "\n\tATMO_UI_Page_DisplayPageByCoord(ATMO_PROPERTY(StartPage, x), ATMO_PROPERTY(StartPage, y), false);\n\treturn ATMO_Status_Success;\n\t",
              "onDisplayed": "\n\treturn ATMO_Status_Success;\n    ",
              "onLeave": "\n\treturn ATMO_Status_Success;\n\t",
              "setIconLabelAndColor": "\n    struct {\n        char str[32];\n        GUI_COLOR color;\n    } icon_data;\n \n    ATMO_GetBinary(in, &icon_data, sizeof(icon_data));\n    ATMO_UI_ICONLINES_SetIconLabelColor(ATMO_VARIABLE(StartPage, pageHandle), icon_data.str, icon_data.color);\n    return ATMO_Status_Success;\n    ",
              "setIconLabel": "\n    char str[32];\n    ATMO_GetString(in, str, 32);\n    ATMO_UI_ICONLINES_SetIconLabel(ATMO_VARIABLE(StartPage, pageHandle), str);\n    return ATMO_Status_Success;\n    ",
              "setup": "\n    ATMO_UI_PAGE_Config_t config;\n    config.hidden = ATMO_PROPERTY(StartPage, pageHidden);\n    config.textColor = ATMO_PROPERTY(StartPage, textColor);\n    config.activeButtons = ATMO_UI_Page_GetButtonMask(ATMO_PROPERTY(StartPage, topRightButtonEnabled),\n    ATMO_PROPERTY(StartPage,bottomRightButtonEnabled), ATMO_PROPERTY(StartPage, topLeftButtonEnabled), ATMO_PROPERTY(StartPage, bottomLeftButtonEnabled));\n\tconfig.x = ATMO_PROPERTY(StartPage, x);\n    config.y = ATMO_PROPERTY(StartPage, y);\n\tstrncpy(config.topLeftButtonLabel, ATMO_PROPERTY(StartPage, topLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.topRightButtonLabel, ATMO_PROPERTY(StartPage, topRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomLeftButtonLabel, ATMO_PROPERTY(StartPage, bottomLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomRightButtonLabel, ATMO_PROPERTY(StartPage, bottomRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n    config.spanX = ATMO_PROPERTY(StartPage, spanX);\n\tconfig.spanY = ATMO_PROPERTY(StartPage, spanY);\n    config.title = ATMO_PROPERTY(StartPage, pageTitle);\n    config.titleHidden = ATMO_PROPERTY(StartPage, titleHidden);\n\tATMO_UI_ICONLINES_Init(&config, ATMO_PROPERTY(StartPage, numLines), false);\n\tATMO_VARIABLE(StartPage, pageHandle) = config.templateInstance;\n    ATMO_UI_ICONLINES_SetMainText(config.templateInstance, 0, ATMO_PROPERTY(StartPage, line1Text));\n    ATMO_UI_ICONLINES_SetMainText(config.templateInstance, 1, ATMO_PROPERTY(StartPage, line2Text));\n    ATMO_UI_ICONLINES_SetMainText(config.templateInstance, 2, ATMO_PROPERTY(StartPage, line3Text));\n    ATMO_UI_ICONLINES_SetMainText(config.templateInstance, 3, ATMO_PROPERTY(StartPage, line4Text));\n    ATMO_UI_ICONLINES_SetIconLabel(config.templateInstance, ATMO_PROPERTY(StartPage, iconLabel));\n    ATMO_UI_ICONLINES_RegisterButtonAbilityHandle(ATMO_VARIABLE(StartPage,pageHandle), 1, ATMO_ABILITY(StartPage, topRightButtonPressed));\n\tATMO_UI_ICONLINES_RegisterButtonAbilityHandle(ATMO_VARIABLE(StartPage,pageHandle), 2, ATMO_ABILITY(StartPage, bottomRightButtonPressed));\n\tATMO_UI_ICONLINES_RegisterButtonAbilityHandle(ATMO_VARIABLE(StartPage,pageHandle), 3, ATMO_ABILITY(StartPage, topLeftButtonPressed));\n    ATMO_UI_ICONLINES_RegisterButtonAbilityHandle(ATMO_VARIABLE(StartPage,pageHandle), 4, ATMO_ABILITY(StartPage, bottomLeftButtonPressed));\n    ATMO_UI_ICONLINES_SetIcon(config.templateInstance, ATMO_PROPERTY(StartPage, icon));\n    ATMO_UI_ICONLINES_RegisterOnDisplayedAbilityHandle(ATMO_VARIABLE(StartPage,pageHandle), ATMO_ABILITY(StartPage, onDisplayed));\n    ATMO_UI_ICONLINES_RegisterOnLeaveAbilityHandle(config.templateInstance, ATMO_ABILITY(StartPage, onLeave));\n    return ATMO_Status_Success;\n    ",
              "setLine1Text": "\n    char label[32];\n    if(ATMO_GetString(in, label, 32) == ATMO_Status_Success)\n    {\n        ATMO_UI_ICONLINES_SetMainText(ATMO_VARIABLE(StartPage,pageHandle), 0, label);\n    }\n    else\n    {\n        return ATMO_Status_Fail;\n    }\n\n    return ATMO_Status_Success;\n    ",
              "setLine2Text": "\n    char label[32];\n    if(ATMO_GetString(in, label, 32) == ATMO_Status_Success)\n    {\n        ATMO_UI_ICONLINES_SetMainText(ATMO_VARIABLE(StartPage,pageHandle), 1, label);\n    }\n    else\n    {\n        return ATMO_Status_Fail;\n    }\n\n    return ATMO_Status_Success;\n    ",
              "setLine3Text": "\n    char label[32];\n    if(ATMO_GetString(in, label, 32) == ATMO_Status_Success)\n    {\n        ATMO_UI_ICONLINES_SetMainText(ATMO_VARIABLE(StartPage,pageHandle), 2, label);\n    }\n    else\n    {\n        return ATMO_Status_Fail;\n    }\n\n    return ATMO_Status_Success;\n    ",
              "setLine4Text": "\n    char label[32];\n    if(ATMO_GetString(in, label, 32) == ATMO_Status_Success)\n    {\n        ATMO_UI_ICONLINES_SetMainText(ATMO_VARIABLE(StartPage,pageHandle), 3, label);\n    }\n    else\n    {\n        return ATMO_Status_Fail;\n    }\n\n    return ATMO_Status_Success;\n    ",
              "topRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
              "bottomRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
              "topLeftButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
              "bottomLeftButtonPressed": "\n\treturn ATMO_Status_Success;\n\t"
            },
            "variables": {
              "pageHandle": {
                "type": "ATMO_DriverInstanceHandle_t"
              }
            },
            "embeddedPropertyConversions": {
              "pageTitle": "string",
              "topRightButtonLabel": "string",
              "bottomRightButtonLabel": "string",
              "topLeftButtonLabel": "string",
              "bottomLeftButtonLabel": "string",
              "iconLabel": "string",
              "line1Text": "string",
              "line2Text": "string",
              "line3Text": "string",
              "line4Text": "string"
            },
            "codeUserChanged": {
              "displayPage": false,
              "onDisplayed": false,
              "onLeave": false,
              "setIconLabelAndColor": false,
              "setIconLabel": false,
              "setup": false,
              "setLine1Text": false,
              "setLine2Text": false,
              "setLine3Text": false,
              "setLine4Text": false,
              "topRightButtonPressed": false,
              "bottomRightButtonPressed": false,
              "topLeftButtonPressed": false,
              "bottomLeftButtonPressed": false
            },
            "textColor": "GUI_BLACK",
            "pageTitle": "Home Control",
            "titleHidden": false,
            "pageHidden": false,
            "topRightButtonLabel": "",
            "topRightButtonEnabled": false,
            "bottomRightButtonLabel": "",
            "bottomRightButtonEnabled": false,
            "topLeftButtonLabel": "",
            "topLeftButtonEnabled": false,
            "bottomLeftButtonLabel": "",
            "bottomLeftButtonEnabled": false,
            "x": 0,
            "y": 0,
            "spanX": 1,
            "spanY": 1,
            "icon": "icon_settings_sensortag",
            "iconLabel": "",
            "numLines": 4,
            "line1Text": "",
            "line2Text": "Batt",
            "line3Text": "Time",
            "line4Text": "User"
          },
          "meta": {
            "editorX": 401,
            "editorY": 391,
            "lastTrigger": "onDisplayed"
          },
          "triggers": {
            "triggered": [],
            "onDisplayed": [],
            "onLeave": [],
            "topRightButtonPressed": [],
            "bottomRightButtonPressed": [],
            "topLeftButtonPressed": [],
            "bottomLeftButtonPressed": []
          },
          "interruptAbilities": {
            "trigger": false,
            "displayPage": false,
            "onDisplayed": false,
            "onLeave": false,
            "setIconLabelAndColor": false,
            "setIconLabel": false,
            "setup": false,
            "setLine1Text": false,
            "setLine2Text": false,
            "setLine3Text": false,
            "setLine4Text": false,
            "topRightButtonPressed": false,
            "bottomRightButtonPressed": false,
            "topLeftButtonPressed": false,
            "bottomLeftButtonPressed": false
          },
          "abilities": [
            {
              "name": "trigger",
              "triggers": [
                "triggered"
              ]
            },
            {
              "name": "displayPage",
              "triggers": []
            },
            {
              "name": "onDisplayed",
              "triggers": [
                "onDisplayed"
              ]
            },
            {
              "name": "onLeave",
              "triggers": [
                "onLeave"
              ]
            },
            {
              "name": "setIconLabelAndColor",
              "triggers": []
            },
            {
              "name": "setIconLabel",
              "triggers": []
            },
            {
              "name": "setup",
              "triggers": []
            },
            {
              "name": "setLine1Text",
              "triggers": []
            },
            {
              "name": "setLine2Text",
              "triggers": []
            },
            {
              "name": "setLine3Text",
              "triggers": []
            },
            {
              "name": "setLine4Text",
              "triggers": []
            },
            {
              "name": "topRightButtonPressed",
              "triggers": [
                "topRightButtonPressed"
              ]
            },
            {
              "name": "bottomRightButtonPressed",
              "triggers": [
                "bottomRightButtonPressed"
              ]
            },
            {
              "name": "topLeftButtonPressed",
              "triggers": [
                "topLeftButtonPressed"
              ]
            },
            {
              "name": "bottomLeftButtonPressed",
              "triggers": [
                "bottomLeftButtonPressed"
              ]
            }
          ]
        },
        {
          "name": "GetBatteryLevel",
          "type": "EmbeddedFunction",
          "variants": [
            "embedded",
            "triggers",
            "abilities",
            "properties",
            "variables"
          ],
          "properties": {
            "errorData": {},
            "code": {
              "trigger": "\tuint8_t battLevel, chargingState;\n\tBatterySensor_GetState(&battLevel, &chargingState);\n\tATMO_CreateValueUnsignedInt(out, battLevel);\n\treturn ATMO_Status_Success;"
            },
            "variables": {},
            "embeddedPropertyConversions": {},
            "codeUserChanged": {
              "trigger": true
            }
          },
          "meta": {
            "editorX": 149,
            "editorY": 390,
            "lastTrigger": "triggered"
          },
          "triggers": {
            "triggered": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "GetBattStr",
                "targetAbility": "trigger"
              }
            ]
          },
          "interruptAbilities": {
            "trigger": false
          },
          "abilities": [
            {
              "name": "trigger",
              "triggers": [
                "triggered"
              ]
            }
          ]
        },
        {
          "name": "GetBattStr",
          "type": "EmbeddedFunction",
          "variants": [
            "embedded",
            "triggers",
            "abilities",
            "properties",
            "variables"
          ],
          "properties": {
            "errorData": {},
            "code": {
              "trigger": "\tfloat temp = 0;\n\tATMO_GetFloat(in, &temp);\n\tchar str[32];\n\tsprintf(str, \"%.0f%%\", temp);\n\tATMO_CreateValueString(out, str);\n\treturn ATMO_Status_Success;"
            },
            "variables": {},
            "embeddedPropertyConversions": {},
            "codeUserChanged": {
              "trigger": true
            }
          },
          "meta": {
            "editorX": 249,
            "editorY": 391,
            "lastTrigger": "triggered"
          },
          "triggers": {
            "triggered": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "StartPage",
                "targetAbility": "setLine2Text"
              }
            ]
          },
          "interruptAbilities": {
            "trigger": false
          },
          "abilities": [
            {
              "name": "trigger",
              "triggers": [
                "triggered"
              ]
            }
          ]
        },
        {
          "name": "BLEConnection",
          "type": "EmbeddedBLEConnection",
          "variants": [
            "embedded",
            "triggers",
            "abilities",
            "properties",
            "variables",
            "ble"
          ],
          "properties": {
            "errorData": {},
            "code": {
              "trigger": "\treturn ATMO_Status_Success;",
              "setup": "\n\tATMO_BLE_PairingCfg_t pairingCfg;\n\tpairingCfg.pairingKey = ATMO_PROPERTY(BLEConnection, pairingKey);\n\tpairingCfg.type = ATMO_PROPERTY(BLEConnection, pairingType);\n\tATMO_BLE_GAPPairingCfg(ATMO_PROPERTY(BLEConnection, instance), &pairingCfg);\n\n\tATMO_BLE_RegisterEventAbilityHandle(ATMO_PROPERTY(BLEConnection, instance), ATMO_BLE_EVENT_Connected, ATMO_ABILITY(BLEConnection, connected));\n\tATMO_BLE_RegisterEventAbilityHandle(ATMO_PROPERTY(BLEConnection, instance), ATMO_BLE_EVENT_Disconnected, ATMO_ABILITY(BLEConnection, disconnected));\n\tATMO_BLE_RegisterEventAbilityHandle(ATMO_PROPERTY(BLEConnection, instance), ATMO_BLE_EVENT_PairingRequested, ATMO_ABILITY(BLEConnection, pairingRequested));\n\tATMO_BLE_RegisterEventAbilityHandle(ATMO_PROPERTY(BLEConnection, instance), ATMO_BLE_EVENT_PairingSuccess, ATMO_ABILITY(BLEConnection, pairingSucceeded));\n\tATMO_BLE_RegisterEventAbilityHandle(ATMO_PROPERTY(BLEConnection, instance), ATMO_BLE_EVENT_PairingFailed, ATMO_ABILITY(BLEConnection, pairingFailed));\n\t\n\treturn ATMO_Status_Success;\n\t",
              "disconnect": "\n\tATMO_BLE_GAPDisconnect(ATMO_PROPERTY(BLEConnection, instance));\n\treturn ATMO_Status_Success;\n\t",
              "connected": "\n\treturn ATMO_Status_Success;\n\t",
              "disconnected": "\n\treturn ATMO_Status_Success;\n\t",
              "pairingRequested": "\n\tATMO_CreateValueCopy(out, in);\n\treturn ATMO_Status_Success;\n\t",
              "pairingSucceeded": "\n\treturn ATMO_Status_Success;\n\t",
              "pairingFailed": "\n\treturn ATMO_Status_Success;\n\t"
            },
            "variables": {},
            "embeddedPropertyConversions": {},
            "codeUserChanged": {
              "setup": false,
              "disconnect": false,
              "connected": false,
              "disconnected": false,
              "pairingRequested": false,
              "pairingSucceeded": false,
              "pairingFailed": false
            },
            "instance": "ATMO_DRIVERINSTANCE_BLE_BLE1",
            "pairingType": "ATMO_BLE_PairingType_RandomKey",
            "pairingKey": "999999"
          },
          "meta": {
            "editorX": 51,
            "editorY": 287,
            "lastTrigger": "pairingSucceeded"
          },
          "triggers": {
            "triggered": [],
            "connected": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "SetBLEText",
                "targetAbility": "trigger"
              }
            ],
            "disconnected": [],
            "pairingRequested": [],
            "pairingSucceeded": [],
            "pairingFailed": []
          },
          "interruptAbilities": {
            "trigger": false,
            "setup": false,
            "disconnect": false,
            "connected": false,
            "disconnected": false,
            "pairingRequested": false,
            "pairingSucceeded": false,
            "pairingFailed": false
          },
          "abilities": [
            {
              "name": "trigger",
              "triggers": [
                "triggered"
              ]
            },
            {
              "name": "setup",
              "triggers": []
            },
            {
              "name": "disconnect",
              "triggers": []
            },
            {
              "name": "connected",
              "triggers": [
                "connected"
              ]
            },
            {
              "name": "disconnected",
              "triggers": [
                "disconnected"
              ]
            },
            {
              "name": "pairingRequested",
              "triggers": [
                "pairingRequested"
              ]
            },
            {
              "name": "pairingSucceeded",
              "triggers": [
                "pairingSucceeded"
              ]
            },
            {
              "name": "pairingFailed",
              "triggers": [
                "pairingFailed"
              ]
            }
          ]
        },
        {
          "name": "SetBLEText",
          "type": "EmbeddedFunction",
          "variants": [
            "embedded",
            "triggers",
            "abilities",
            "properties",
            "variables"
          ],
          "properties": {
            "errorData": {},
            "code": {
              "trigger": "\tATMO_CreateValueString(out, \"BLE\");\n\treturn ATMO_Status_Success;"
            },
            "variables": {},
            "embeddedPropertyConversions": {},
            "codeUserChanged": {
              "trigger": true
            }
          },
          "meta": {
            "editorX": 148,
            "editorY": 290,
            "lastTrigger": "triggered"
          },
          "triggers": {
            "triggered": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "StartPage",
                "targetAbility": "setLine1Text"
              }
            ]
          },
          "interruptAbilities": {
            "trigger": false
          },
          "abilities": [
            {
              "name": "trigger",
              "triggers": [
                "triggered"
              ]
            }
          ]
        },
        {
          "name": "PageController",
          "type": "EmbeddedPageController",
          "variants": [
            "embedded",
            "triggers",
            "abilities",
            "properties",
            "variables",
            "rpk"
          ],
          "properties": {
            "errorData": {},
            "code": {
              "trigger": "\treturn ATMO_Status_Success;",
              "setup": "\n\tATMO_UI_PAGE_CONTROLLER_Config_t config;\n\tconfig.enableUpDownNavLabels = ATMO_PROPERTY(PageController, upDownNavigationLabelsEnabled);\n\tconfig.enableLeftRightNavLabels = ATMO_PROPERTY(PageController, leftRightNavigationLabelsEnabled);\n\tATMO_UI_Page_SetConfiguration(&config);\n    return ATMO_Status_Success;\n\t",
              "displayRootPage": "\n\t\n\tATMO_UI_Page_DisplayRootPage();\n\treturn ATMO_Status_Success;\n\t",
              "navigateUp": "\n\tATMO_UI_Page_ProcessNavButton(ATMO_UI_PAGE_NAV_UP);\n\treturn ATMO_Status_Success;\n\t",
              "navigateDown": "\n\tATMO_UI_Page_ProcessNavButton(ATMO_UI_PAGE_NAV_DOWN);\n\treturn ATMO_Status_Success;\n\t",
              "navigateLeft": "\n\tATMO_UI_Page_ProcessNavButton(ATMO_UI_PAGE_NAV_LEFT);\n\treturn ATMO_Status_Success;\n\t",
              "navigateRight": "\n\tATMO_UI_Page_ProcessNavButton(ATMO_UI_PAGE_NAV_RIGHT);\n\treturn ATMO_Status_Success;\n\t",
              "processTopRightButton": "\n\tATMO_UI_Page_ProcessUserButton(1);\n\treturn ATMO_Status_Success;\n\t",
              "processBottomRightButton": "\n\tATMO_UI_Page_ProcessUserButton(2);\n\treturn ATMO_Status_Success;\n\t",
              "processTopLeftButton": "\n\tATMO_UI_Page_ProcessUserButton(3);\n\treturn ATMO_Status_Success;\n\t",
              "processBottomLeftButton": "\n\tATMO_UI_Page_ProcessUserButton(4);\n\treturn ATMO_Status_Success;\n\t"
            },
            "variables": {},
            "embeddedPropertyConversions": {},
            "codeUserChanged": {
              "setup": false,
              "displayRootPage": false,
              "navigateUp": false,
              "navigateDown": false,
              "navigateLeft": false,
              "navigateRight": false,
              "processTopRightButton": false,
              "processBottomRightButton": false,
              "processTopLeftButton": false,
              "processBottomLeftButton": false
            },
            "upDownNavigationLabelsEnabled": true,
            "leftRightNavigationLabelsEnabled": true
          },
          "meta": {
            "editorX": 150,
            "editorY": 91,
            "lastTrigger": "triggered"
          },
          "triggers": {
            "triggered": [],
            "navigateUp": [],
            "navigateDown": [],
            "navigateLeft": [],
            "navigateRight": [],
            "processTopRightButton": [],
            "processBottomRightButton": [],
            "processTopLeftButton": [],
            "processBottomLeftButton": []
          },
          "interruptAbilities": {
            "trigger": false,
            "setup": false,
            "displayRootPage": false,
            "navigateUp": false,
            "navigateDown": false,
            "navigateLeft": false,
            "navigateRight": false,
            "processTopRightButton": false,
            "processBottomRightButton": false,
            "processTopLeftButton": false,
            "processBottomLeftButton": false
          },
          "abilities": [
            {
              "name": "trigger",
              "triggers": [
                "triggered"
              ]
            },
            {
              "name": "setup",
              "triggers": []
            },
            {
              "name": "displayRootPage",
              "triggers": []
            },
            {
              "name": "navigateUp",
              "triggers": [
                "navigateUp"
              ]
            },
            {
              "name": "navigateDown",
              "triggers": [
                "navigateDown"
              ]
            },
            {
              "name": "navigateLeft",
              "triggers": [
                "navigateLeft"
              ]
            },
            {
              "name": "navigateRight",
              "triggers": [
                "navigateRight"
              ]
            },
            {
              "name": "processTopRightButton",
              "triggers": [
                "processTopRightButton"
              ]
            },
            {
              "name": "processBottomRightButton",
              "triggers": [
                "processBottomRightButton"
              ]
            },
            {
              "name": "processTopLeftButton",
              "triggers": [
                "processTopLeftButton"
              ]
            },
            {
              "name": "processBottomLeftButton",
              "triggers": [
                "processBottomLeftButton"
              ]
            }
          ]
        },
        {
          "name": "SX9500Touch",
          "type": "EmbeddedSX9500",
          "variants": [
            "embedded",
            "triggers",
            "abilities",
            "properties",
            "variables"
          ],
          "properties": {
            "errorData": {},
            "code": {
              "trigger": "\treturn ATMO_Status_Success;",
              "setup": "\tATMO_SX9500_Config_t config;\n\tconfig.address = ATMO_PROPERTY(SX9500Touch, i2cAddress);\n\tconfig.i2cDriverInstance = ATMO_PROPERTY(SX9500Touch, i2cInstance);\n\tconfig.gpioDriverInstance = ATMO_PROPERTY(SX9500Touch, gpioInstance);\n\tconfig.interruptEnabled = ATMO_PROPERTY(SX9500Touch, interruptEnabled);\n\tconfig.interruptPin = ATMO_PROPERTY(SX9500Touch, interruptGpio);\n\tATMO_SX9500_Init(&config);\n\tATMO_SX9500_RegisterTouchedAbilityHandle(SX9500_Touched_Up, ATMO_ABILITY(SX9500Touch, pressUp));\n\tATMO_SX9500_RegisterTouchedAbilityHandle(SX9500_Touched_Down, ATMO_ABILITY(SX9500Touch, pressDown));\n\tATMO_SX9500_RegisterTouchedAbilityHandle(SX9500_Touched_Left, ATMO_ABILITY(SX9500Touch, pressLeft));\n\tATMO_SX9500_RegisterTouchedAbilityHandle(SX9500_Touched_Right, ATMO_ABILITY(SX9500Touch, pressRight));\n\treturn ATMO_Status_Success;",
              "getTouchData": "",
              "pressUp": "SX9500_TouchState_t touchState;\nATMO_GetBinary(in, &touchState, sizeof(touchState));\nATMO_CreateValueBinary(out, &touchState, sizeof(touchState));\nreturn ATMO_Status_Success;",
              "pressDown": "SX9500_TouchState_t touchState;\nATMO_GetBinary(in, &touchState, sizeof(touchState));\nATMO_CreateValueBinary(out, &touchState, sizeof(touchState));\nreturn ATMO_Status_Success;",
              "pressLeft": "SX9500_TouchState_t touchState;\nATMO_GetBinary(in, &touchState, sizeof(touchState));\nATMO_CreateValueBinary(out, &touchState, sizeof(touchState));\nreturn ATMO_Status_Success;",
              "pressRight": "SX9500_TouchState_t touchState;\nATMO_GetBinary(in, &touchState, sizeof(touchState));\nATMO_CreateValueBinary(out, &touchState, sizeof(touchState));\nreturn ATMO_Status_Success;"
            },
            "variables": {},
            "embeddedPropertyConversions": {},
            "codeUserChanged": {
              "setup": false,
              "getTouchData": false,
              "pressUp": false,
              "pressDown": false,
              "pressLeft": false,
              "pressRight": false
            },
            "i2cInstance": 1,
            "gpioInstance": 0,
            "interruptEnabled": true,
            "interruptGpio": "PTA9",
            "i2cAddress": "0x28"
          },
          "meta": {
            "editorX": 50,
            "editorY": 141,
            "lastTrigger": "rightPressed"
          },
          "triggers": {
            "triggered": [],
            "touchDataRead": [],
            "upPressed": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "PageController",
                "targetAbility": "navigateUp"
              }
            ],
            "downPressed": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "PageController",
                "targetAbility": "navigateDown"
              }
            ],
            "leftPressed": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "PageController",
                "targetAbility": "navigateLeft"
              }
            ],
            "rightPressed": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "PageController",
                "targetAbility": "navigateRight"
              }
            ]
          },
          "interruptAbilities": {
            "trigger": false,
            "setup": false,
            "getTouchData": false,
            "pressUp": false,
            "pressDown": false,
            "pressLeft": false,
            "pressRight": false
          },
          "abilities": [
            {
              "name": "trigger",
              "triggers": [
                "triggered"
              ]
            },
            {
              "name": "setup",
              "triggers": []
            },
            {
              "name": "getTouchData",
              "triggers": [
                "touchDataRead"
              ]
            },
            {
              "name": "pressUp",
              "triggers": [
                "upPressed",
                "touchDataRead"
              ]
            },
            {
              "name": "pressDown",
              "triggers": [
                "downPressed",
                "touchDataRead"
              ]
            },
            {
              "name": "pressLeft",
              "triggers": [
                "leftPressed",
                "touchDataRead"
              ]
            },
            {
              "name": "pressRight",
              "triggers": [
                "rightPressed",
                "touchDataRead"
              ]
            }
          ]
        },
        {
          "name": "UserButtons",
          "type": "EmbeddedNxpRpkUserButtons",
          "variants": [
            "embedded",
            "triggers",
            "abilities",
            "properties",
            "variables",
            "rpk"
          ],
          "properties": {
            "errorData": {},
            "code": {
              "trigger": "\treturn ATMO_Status_Success;",
              "setup": "\n    ATMO_MK64F_GPIO_EnableResetCombo(ATMO_PROPERTY(UserButtons, enableResetCombo));\n    ATMO_MK64F_GPIO_EnableDisplayToggleCombo(ATMO_PROPERTY(UserButtons, enableDisplayToggleCombo));\n    ATMO_MK64F_UserButton_RegisterAbilityHandle(ATMO_MK64F_SW1_Pushed, ATMO_ABILITY(UserButtons, topRightPushed));\n    ATMO_MK64F_UserButton_RegisterAbilityHandle(ATMO_MK64F_SW2_Pushed, ATMO_ABILITY(UserButtons, bottomRightPushed));\n    ATMO_MK64F_UserButton_RegisterAbilityHandle(ATMO_MK64F_SW3_Pushed, ATMO_ABILITY(UserButtons, topLeftPushed));\n    ATMO_MK64F_UserButton_RegisterAbilityHandle(ATMO_MK64F_SW4_Pushed, ATMO_ABILITY(UserButtons, bottomLeftPushed));\n\treturn ATMO_Status_Success;\n\t",
              "topRightPushed": "\n\treturn ATMO_Status_Success;\n    ",
              "bottomRightPushed": "\n\treturn ATMO_Status_Success;\n    ",
              "topLeftPushed": "\n\treturn ATMO_Status_Success;\n    ",
              "bottomLeftPushed": "\n\treturn ATMO_Status_Success;\n    "
            },
            "variables": {},
            "embeddedPropertyConversions": {},
            "codeUserChanged": {
              "setup": false,
              "topRightPushed": false,
              "bottomRightPushed": false,
              "topLeftPushed": false,
              "bottomLeftPushed": false
            },
            "enableResetCombo": true,
            "enableDisplayToggleCombo": true
          },
          "meta": {
            "editorX": 51,
            "editorY": 41,
            "lastTrigger": "bottomLeftPushed"
          },
          "triggers": {
            "triggered": [],
            "topRightPushed": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "PageController",
                "targetAbility": "processTopRightButton"
              }
            ],
            "bottomRightPushed": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "PageController",
                "targetAbility": "processBottomRightButton"
              }
            ],
            "topLeftPushed": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "PageController",
                "targetAbility": "processTopLeftButton"
              }
            ],
            "bottomLeftPushed": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "PageController",
                "targetAbility": "processBottomLeftButton"
              }
            ]
          },
          "interruptAbilities": {
            "trigger": false,
            "setup": false,
            "topRightPushed": false,
            "bottomRightPushed": false,
            "topLeftPushed": false,
            "bottomLeftPushed": false
          },
          "abilities": [
            {
              "name": "trigger",
              "triggers": [
                "triggered"
              ]
            },
            {
              "name": "setup",
              "triggers": []
            },
            {
              "name": "topRightPushed",
              "triggers": [
                "topRightPushed"
              ]
            },
            {
              "name": "bottomRightPushed",
              "triggers": [
                "bottomRightPushed"
              ]
            },
            {
              "name": "topLeftPushed",
              "triggers": [
                "topLeftPushed"
              ]
            },
            {
              "name": "bottomLeftPushed",
              "triggers": [
                "bottomLeftPushed"
              ]
            }
          ]
        },
        {
          "name": "Settings",
          "type": "EmbeddedIconLabelDisplay",
          "variants": [
            "embedded",
            "triggers",
            "abilities",
            "properties",
            "variables",
            "rpk"
          ],
          "properties": {
            "errorData": {},
            "code": {
              "trigger": "\treturn ATMO_Status_Success;",
              "displayPage": "\n\tATMO_UI_Page_DisplayPageByCoord(ATMO_PROPERTY(Settings, x), ATMO_PROPERTY(Settings, y), false);\n\treturn ATMO_Status_Success;\n\t",
              "onDisplayed": "\n\treturn ATMO_Status_Success;\n    ",
              "topRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
...

This file has been truncated, please download it to see its full contents.

Credits

Ralph Yamamoto

Ralph Yamamoto

2 projects • 6 followers

Comments