From 7a7da3b8356b6e0f740d5b34b8f7e4a8e22b66d9 Mon Sep 17 00:00:00 2001 From: Alexandru Tiniuc Date: Mon, 22 May 2023 11:08:27 +0100 Subject: [PATCH] Cascoda SDK patch release v0.23-5 Make battery monitoring dynamic, removing a devboard config option Update documentation KNX-IoT port bugfixes --- baremetal/cascoda-bm-devboard/CMakeLists.txt | 8 + baremetal/cascoda-bm-devboard/README.md | 5 +- .../examples/devboard_app_batt.c | 61 +- .../examples/devboard_app_click_batt.c | 522 ++++++++++++++++++ .../include/devboard_batt.h | 35 +- .../source/devboard_batt.c | 63 ++- baremetal/cascoda-bm-driver/CMakeLists.txt | 2 +- .../cascoda-bm-driver/source/chili_test.c | 10 +- baremetal/platform/chili2/CMakeLists.txt | 7 +- .../chili2/port/include/cascoda_chili.h | 13 +- .../chili2/port/include/cascoda_chili_gpio.h | 26 +- .../chili2/port/source/cascoda_bsp_chili.c | 6 +- .../chili2/port/source/cascoda_chili.c | 26 +- .../chili2/port/source/cascoda_chili_secure.c | 2 +- .../chili2/port/source/cascoda_gpio_chili.c | 8 +- .../port/source/cascoda_sensorif_secure.c | 2 +- baremetal/sensorif/include/sif_il3820.h | 4 +- baremetal/sensorif/include/sif_ssd1681.h | 4 +- docs/guides/border-router-setup.md | 8 +- .../img/border-router/border_router.jpg | Bin 0 -> 15099 bytes docs/how-to/howto-knxiot.md | 19 +- docs/reference/cmake-configuration.md | 1 - etc/options.cmake | 4 +- 23 files changed, 751 insertions(+), 85 deletions(-) create mode 100644 baremetal/cascoda-bm-devboard/examples/devboard_app_click_batt.c create mode 100644 docs/guides/img/border-router/border_router.jpg diff --git a/baremetal/cascoda-bm-devboard/CMakeLists.txt b/baremetal/cascoda-bm-devboard/CMakeLists.txt index fe2d343..d5ed30a 100644 --- a/baremetal/cascoda-bm-devboard/CMakeLists.txt +++ b/baremetal/cascoda-bm-devboard/CMakeLists.txt @@ -73,3 +73,11 @@ add_executable(devboard-gfx-1-54 target_link_libraries(devboard-gfx-1-54 cascoda-bm test15-4-api cascoda-bm-devboard mikrosdk-click sensorif eink-driver-1-54-half-res) cascoda_make_binary(devboard-gfx-1-54 CASCODA_BUILD_BINARIES) cascoda_put_subdir(devboard devboard-gfx-1-54) + +add_executable(devboard-click-batt + ${PROJECT_SOURCE_DIR}/examples/devboard_app_click_batt.c +) + +target_link_libraries(devboard-click-batt cascoda-bm cascoda-bm-devboard mikrosdk-click) +cascoda_make_binary(devboard-click-batt CASCODA_BUILD_BINARIES) +cascoda_put_subdir(devboard devboard-click-batt) diff --git a/baremetal/cascoda-bm-devboard/README.md b/baremetal/cascoda-bm-devboard/README.md index bc1e9bd..ea94c42 100644 --- a/baremetal/cascoda-bm-devboard/README.md +++ b/baremetal/cascoda-bm-devboard/README.md @@ -14,6 +14,7 @@ This module contains example applications to demonstrate the use of the APIs for | devboard-gfx-x-x | `examples/devboard_app_gfx_x_x.c` | Example app demonstrating how the devboard can show graphics (menu) on an eink display (where x-x is replaced by the size, e.g. 2-9 meaning 2.9 inches). | | devboard-sleep | `examples/devboard_app_sleep.c` | Example app demonstrating the sleep modes. | | devboard-batt | `examples/devboard_app_batt.c` | Example app demonstrating the battery monitoring functions. | +| devboard-click-batt | `examples/devboard_app_click_batt.c` | Example app demonstrating combined use of peripherals and battery monitoring. | ## Building instructions Assuming that you have already [set up your build directories](../../README.md#building), in order to get the devboard example binaries to build, you need to change the CMake configuration as follows: @@ -21,10 +22,6 @@ Assuming that you have already [set up your build directories](../../README.md#b ```CMake CASCODA_CHILI2_CONFIG_STRING:STRING=DEV_BOARD ``` -When using the Battry monitoring functions on the Development Board, the following configuration should be used: -```CMake -CASCODA_CHILI2_CONFIG_STRING:STRING=DEV_BOARD_BATT -``` The recommended method of doing this is [using the tools that come with CMake](https://cmake.org/runningcmake/). However, if you know what you are doing, then you can alternatively edit the `CMakeCache.txt` file yourself to make those changes. After building, the example binaries will be found in `bin/devboard/` in your build directory. \ No newline at end of file diff --git a/baremetal/cascoda-bm-devboard/examples/devboard_app_batt.c b/baremetal/cascoda-bm-devboard/examples/devboard_app_batt.c index fff86d3..626c2a2 100644 --- a/baremetal/cascoda-bm-devboard/examples/devboard_app_batt.c +++ b/baremetal/cascoda-bm-devboard/examples/devboard_app_batt.c @@ -20,6 +20,10 @@ #include "devboard_batt.h" #include "devboard_btn.h" +#define GET_CHARGE_STAT 1 +#define GET_VOLTS 1 +#define GET_USB_PRESENT 1 + /* reporting period in [ms] */ #define REPORT_TIME 5000 @@ -42,22 +46,42 @@ static ca_error ReportBattStatus(void *aContext) u8_t charging = 0; u8_t vbusconnected = 0; - charging = DVBD_BattGetChargingStatus(); - vbatt = DVBD_BattGetVoltage(); - vbusconnected = DVBD_BattGetVbusConnected(); + if (GET_CHARGE_STAT) + charging = DVBD_BattGetChargeStat(); + if (GET_VOLTS) + vbatt = DVBD_BattGetVolts(); + if (GET_USB_PRESENT) + vbusconnected = DVBD_BattGetUSBPresent(); printf("%4us BattStatus: ", (TIME_ReadAbsoluteTime() / 1000)); - printf("Vbatt: %2d.%02u V;", (vbatt / 100), abs(vbatt % 100)); - printf(" %s;", ((charging == CHARGING) ? "charging" : "not charging")); - printf(" %s;", ((vbusconnected == CONNECTED) ? "+5V connected" : "+5V not connected")); + if (GET_VOLTS) + printf("Vbatt: %2d.%02u V;", (vbatt / 100), abs(vbatt % 100)); + if (GET_CHARGE_STAT) + printf(" %s;", ((charging == CHARGING) ? "charging" : "not charging")); + if (GET_USB_PRESENT) + printf(" %s;", ((vbusconnected == CONNECTED) ? "+5V connected" : "+5V not connected")); printf("\n"); TASKLET_ScheduleDelta(&g_report_batt_tasklet, REPORT_TIME, NULL); + if (vbusconnected) + DVBD_SetLED(LED_BTN_1, LED_ON); + else + DVBD_SetLED(LED_BTN_1, LED_OFF); + + if (charging) + DVBD_SetLED(LED_BTN_2, LED_ON); + else + DVBD_SetLED(LED_BTN_2, LED_OFF); + +#if defined(USE_USB) if (vbusconnected) g_go_sleep = 0; else g_go_sleep = 1; +#else + g_go_sleep = 1; +#endif // USE_USB return CA_ERROR_SUCCESS; } @@ -76,9 +100,28 @@ static void hardware_init(void) printf("Failed to register SW4\n"); DVBD_SetLED(LED_BTN_0, LED_ON); - DVBD_SetLED(LED_BTN_1, LED_ON); - DVBD_SetLED(LED_BTN_2, LED_ON); - DVBD_SetLED(LED_BTN_3, LED_ON); + DVBD_SetLED(LED_BTN_1, LED_OFF); + DVBD_SetLED(LED_BTN_2, LED_OFF); + DVBD_SetLED(LED_BTN_3, LED_OFF); + + if (GET_CHARGE_STAT) + { + /* initialise CHARGE_STAT */ + if (DVBD_BattInitChargeStat()) + printf("Failed to initialise CHARGE_STAT\n"); + } + if (GET_VOLTS) + { + /* initialise VOLTS and VOLTS_TEST */ + if (DVBD_BattInitVolts()) + printf("Failed to initialise VOLTS/VOLTS_TEST\n"); + } + if (GET_USB_PRESENT) + { + /* initialise USB_PRESENT */ + if (DVBD_BattInitUSBPresent()) + printf("Failed to initialise USB_PRESENT\n"); + } TASKLET_Init(&g_report_batt_tasklet, &ReportBattStatus); TASKLET_ScheduleDelta(&g_report_batt_tasklet, REPORT_TIME, NULL); diff --git a/baremetal/cascoda-bm-devboard/examples/devboard_app_click_batt.c b/baremetal/cascoda-bm-devboard/examples/devboard_app_click_batt.c new file mode 100644 index 0000000..1e99ecc --- /dev/null +++ b/baremetal/cascoda-bm-devboard/examples/devboard_app_click_batt.c @@ -0,0 +1,522 @@ +/** + * @file + * @brief test15_4 main program loop and supporting functions + */ +/* + * Copyright (c) 2022, Cascoda Ltd. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holder nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +/* + * Example application for external click sensor interfaces +*/ +#include +#include + +#include "cascoda-bm/cascoda_evbme.h" +#include "cascoda-bm/cascoda_interface.h" +#include "cascoda-bm/cascoda_types.h" +#include "cascoda-util/cascoda_tasklet.h" +#include "cascoda-util/cascoda_time.h" +#include "ca821x_api.h" + +/* Insert Application-Specific Includes here */ +#include "cascoda-bm/test15_4_evbme.h" + +#include "devboard_batt.h" +#include "devboard_btn.h" +#include "devboard_click.h" + +#include "airquality4_click.h" +#include "ambient8_click.h" +#include "environment2_click.h" +#include "fan_click.h" +#include "hvac_click.h" +#include "motion_click.h" +#include "relay_click.h" +#include "sht_click.h" +#include "thermo3_click.h" +#include "thermo_click.h" + +/* change if using handlers other trhan default */ +#include "devboard_click_handlers_default.h" + +/* mikrobus click interface 1 and 2 configuration */ +#define CLICK1_TYPE STYPE_THERMO3 +#define CLICK2_TYPE STYPE_NONE + +/* battery monitoring options */ +#define GET_CHARGE_STAT 1 +#define GET_VOLTS 1 +#define GET_USB_PRESENT 0 + +/* sleep (1) or stay awake (0) */ +#define USE_SLEEP_MODE 1 + +/* use power control (crowbar) for isolating click boards during power-down (vdd33 off) */ +/* note: jumper has to be populated when 1 */ +#define USE_POWER_CONTROL_ON_POWERDOWN 1 + +/* use additional wakeup button (button SW3) */ +#define USE_ADDITIONAL_WAKEUP_BUTTON 0 + +/* no LED in active mode to minimise power consumption */ +#define NO_LED 0 + +/* measurement period in [ms] */ +#if ((((CLICK1_TYPE == STYPE_THERMO3) || (CLICK2_TYPE == STYPE_THERMO3)) && (THERMO3_USE_INTERRUPT)) || \ + (((CLICK1_TYPE == STYPE_SHT) || (CLICK2_TYPE == STYPE_SHT)) && (SHT_USE_INTERRUPT)) || \ + (((CLICK1_TYPE == STYPE_MOTION) || (CLICK2_TYPE == STYPE_MOTION)) && (MOTION_USE_INTERRUPT)) || \ + (((CLICK1_TYPE == STYPE_FAN) || (CLICK2_TYPE == STYPE_FAN)) && (FAN_USE_INTERRUPT))) +#define MEASUREMENT_PERIOD DVBD_MAX_SLEEP_TIME +#else +#define MEASUREMENT_PERIOD 5000 +#endif + +/* initialisation functions for all clicks - have to be in correct order */ +static ca_error (*click_init_function[])(void) = {NULL, + CLICK_THERMO_initialise, + CLICK_THERMO3_initialise, + CLICK_AIRQUALITY4_initialise, + CLICK_ENVIRONMENT2_initialise, + CLICK_SHT_initialise, + CLICK_HVAC_initialise, + CLICK_MOTION_initialise, + CLICK_RELAY_initialise, + CLICK_AMBIENT8_initialise, + CLICK_FAN_initialise}; + +/* handler functions for all clicks (including acquisition) - have to be in correct order */ +static ca_error (*click_handler_function[])(void) = {NULL, + CLICK_Handler_Default_THERMO, + CLICK_Handler_Default_THERMO3, + CLICK_Handler_Default_AIRQUALITY4, + CLICK_Handler_Default_ENVIRONMENT2, + CLICK_Handler_Default_SHT, + CLICK_Handler_Default_HVAC, + CLICK_Handler_Default_MOTION, + CLICK_Handler_Default_RELAY, + CLICK_Handler_Default_AMBIENT8, + CLICK_Handler_Default_FAN}; + +/* alarm functions for all clicks - have to be in correct order */ +static ca_error (*click_alarm_function[])(void) = {NULL, + NULL, + MIKROSDK_THERMO3_alarm_triggered, + NULL, + NULL, + MIKROSDK_SHT_alarm_triggered, + NULL, + MIKROSDK_MOTION_alarm_triggered, + NULL, + NULL, + MIKROSDK_FAN_alarm_triggered}; +/* for reporting */ +extern const char *click_name_default[]; + +/* sensors have been handled after wakeup */ +static bool g_sensors_handled = true; +/* hardware error */ +static bool g_hw_error = false; +/* scheduling tasklet for wakeup */ +static ca_tasklet g_sensor_wakeup_tasklet; + +/* This has to be declared if sgp40 voc index algorithm is used (ENVIRONMENT2 click) */ +u32_t sgp40_sampling_interval = MEASUREMENT_PERIOD; + +// Reporting Battery Status +static ca_error ReportBattStatus(void) +{ + u16_t vbatt = 0; + u8_t charging = 0; + u8_t vbusconnected = 0; + + if (GET_CHARGE_STAT) + charging = DVBD_BattGetChargeStat(); + if (GET_VOLTS) + vbatt = DVBD_BattGetVolts(); + if (GET_USB_PRESENT) + vbusconnected = DVBD_BattGetUSBPresent(); + + if (GET_VOLTS || GET_CHARGE_STAT || GET_USB_PRESENT) + printf("%4us BattStatus : ", (TIME_ReadAbsoluteTime() / 1000)); + if (GET_VOLTS) + printf("Vbatt: %2d.%02u V;", (vbatt / 100), abs(vbatt % 100)); + if (GET_CHARGE_STAT) + printf(" %s;", ((charging == CHARGING) ? "charging" : "not charging")); + if (GET_USB_PRESENT) + printf(" %s;", ((vbusconnected == CONNECTED) ? "+5V connected" : "+5V not connected")); + printf("\n"); + + return CA_ERROR_SUCCESS; +} + +/* isr for relay 1 (button SW1) */ +static void relay1_isr(void *context) +{ + (void)context; + /* toggle state */ + g_relay_1_state = (1 - g_relay_1_state); + g_sensors_handled = false; +} + +/* isr for relay 2 (button SW2) */ +static void relay2_isr(void *context) +{ + (void)context; + /* toggle state */ + g_relay_2_state = (1 - g_relay_2_state); + g_sensors_handled = false; +} + +/* isr 1 for fan (button SW3) */ +static void fan1_isr(void *context) +{ + (void)context; +#if (FAN_MODE == FAN_MODE_CLOSED_LOOP) + /* increase speed 0 rpm to max. rpm */ + if (g_fan_speed_tach_rpm < (FAN_MAX_SPEED + 1000)) /* +1000 to check drive fail alert */ + g_fan_speed_tach_rpm += 1000; + else + g_fan_speed_tach_rpm = 0; +#else + /* increase speed 0% to 100% */ + if (g_fan_speed_pwm_percent < 100) + g_fan_speed_pwm_percent += 10; + else + g_fan_speed_pwm_percent = 0; +#endif + g_sensors_handled = false; +} + +/* isr 1 for fan (button SW3) long press */ +static void fan1_isr_long(void *context) +{ + (void)context; +#if (FAN_MODE == FAN_MODE_CLOSED_LOOP) + /* on-off */ + if (g_fan_speed_tach_rpm == FAN_MAX_SPEED) + g_fan_speed_tach_rpm = 0; + else + g_fan_speed_tach_rpm = FAN_MAX_SPEED; +#else + /* on-off */ + if (g_fan_speed_pwm_percent == 100) + g_fan_speed_pwm_percent = 0; + else + g_fan_speed_pwm_percent = 100; +#endif + g_sensors_handled = false; +} + +/* isr 2 for fan (button SW2) */ +static void fan2_isr(void *context) +{ + (void)context; + g_sensors_handled = false; +} + +/* isr for additional wakeup (button SW3) */ +static void wakeup_isr(void *context) +{ + (void)context; + g_sensors_handled = false; +} + +/* set hardware error */ +static void set_hw_error(void) +{ + g_hw_error = true; +} + +/* check sensor alarm status */ +static void check_alarms(void) +{ + /* check alarm status for specific click boards */ + + /* CLICK 1 alarm check */ + if (click_alarm_function[CLICK1_TYPE]) + { + if (click_alarm_function[CLICK1_TYPE]()) + { + g_sensors_handled = false; + } + } + + /* CLICK 2 alarm check */ + if (click_alarm_function[CLICK2_TYPE]) + { + if (click_alarm_function[CLICK2_TYPE]()) + { + g_sensors_handled = false; + } + } +} + +// wakeup tasklet function - schedule next period +static ca_error sensor_wakeup(void *aContext) +{ + u8_t pinstate; + + if (!g_hw_error) + { + g_sensors_handled = false; + TASKLET_ScheduleDelta(&g_sensor_wakeup_tasklet, MEASUREMENT_PERIOD, NULL); + } + else + { + DVBD_Sense(LED_BTN_3, &pinstate); + DVBD_SetLED(LED_BTN_3, !pinstate); + TASKLET_ScheduleDelta(&g_sensor_wakeup_tasklet, 400, NULL); + } + return CA_ERROR_SUCCESS; +} + +// application initialisation +void hardware_init(void) +{ + /* Application-Specific Button/LED Initialisation Routines */ + /* SW4 BTN/LED is LED output; static for power-on */ + DVBD_RegisterLEDOutput(LED_BTN_3, JUMPER_POS_2); + #if(NO_LED) + DVBD_SetLED(LED_BTN_3, LED_OFF); + #else + DVBD_SetLED(LED_BTN_3, LED_ON); + #endif + + if ((CLICK1_TYPE == STYPE_RELAY) || (CLICK2_TYPE == STYPE_RELAY)) + { + /* register buttons for RELAY */ + /* SW1 BTN/LED is button for toggling relay_1 */ + /* SW2 BTN/LED is button for toggling relay_2 */ + DVBD_RegisterButtonIRQInput(LED_BTN_0, JUMPER_POS_2); + DVBD_RegisterButtonIRQInput(LED_BTN_1, JUMPER_POS_2); + DVBD_SetButtonShortPressCallback(LED_BTN_0, &relay1_isr, NULL, BTN_SHORTPRESS_PRESSED); + DVBD_SetButtonShortPressCallback(LED_BTN_1, &relay2_isr, NULL, BTN_SHORTPRESS_PRESSED); + } + else if ((CLICK1_TYPE == STYPE_FAN) || (CLICK2_TYPE == STYPE_FAN)) + { + /* register buttons for FAN */ + /* SW3 BTN/LED for increasing speed */ + DVBD_RegisterButtonIRQInput(LED_BTN_2, JUMPER_POS_2); + DVBD_SetButtonShortPressCallback(LED_BTN_2, &fan1_isr, NULL, BTN_SHORTPRESS_RELEASED); + DVBD_SetButtonLongPressCallback(LED_BTN_2, &fan1_isr_long, NULL, 1000); + /* SW3 BTN/LED for additional wake-up interrupt */ + DVBD_RegisterButtonIRQInput(LED_BTN_1, JUMPER_POS_2); + DVBD_SetButtonShortPressCallback(LED_BTN_1, &fan2_isr, NULL, BTN_SHORTPRESS_PRESSED); + } + else + { +#if (USE_ADDITIONAL_WAKEUP_BUTTON == 1) + /* register buttons for other sensors */ + /* SW3 BTN/LED for additional wake-up interrupt */ + DVBD_RegisterButtonIRQInput(LED_BTN_2, JUMPER_POS_2); + DVBD_SetButtonShortPressCallback(LED_BTN_2, &wakeup_isr, NULL, BTN_SHORTPRESS_PRESSED); +#endif + } + +/* power up click interfaces if power control is used */ +#if (USE_POWER_CONTROL_ON_POWERDOWN) + if (DVBD_click_power_init()) + printf("No access to power control pin for mikrobus interfaces\n"); +#endif + + printf("Initialising devices:\n"); + printf("Interface 1: %s\n", click_name_default[CLICK1_TYPE]); + printf("Interface 2: %s\n", click_name_default[CLICK2_TYPE]); + + /* CLICK 1 initialisation */ + if (click_init_function[CLICK1_TYPE]) + { + if (click_init_function[CLICK1_TYPE]()) + { + printf("Click Sensor Number 1 (%s): Initialisation failed\n", click_name_default[CLICK1_TYPE]); + set_hw_error(); + } + } + + /* CLICK 2 initialisation */ + if (click_init_function[CLICK2_TYPE]) + { + if (click_init_function[CLICK2_TYPE]()) + { + printf("Click Sensor Number 2 (%s): Initialisation failed\n", click_name_default[CLICK2_TYPE]); + set_hw_error(); + } + } + + if (GET_CHARGE_STAT) + { + /* initialise CHARGE_STAT */ + if (DVBD_BattInitChargeStat()) + printf("Failed to initialise CHARGE_STAT\n"); + } + if (GET_VOLTS) + { + /* initialise VOLTS and VOLTS_TEST */ + if (DVBD_BattInitVolts()) + printf("Failed to initialise VOLTS/VOLTS_TEST\n"); + } + if (GET_USB_PRESENT) + { + /* initialise USB_PRESENT */ + if (DVBD_BattInitUSBPresent()) + printf("Failed to initialise USB_PRESENT\n"); + } + + /* init scheduling, and trigger first calls (after 100 ms) to initialise click sensor interface in handlers */ + TASKLET_Init(&g_sensor_wakeup_tasklet, &sensor_wakeup); + TASKLET_ScheduleDelta(&g_sensor_wakeup_tasklet, 100, NULL); +} + +// application polling function +void hardware_poll(void) +{ + /* check buttons */ + DVBD_PollButtons(); + + /* click sensor handlers */ + check_alarms(); + + if (!g_sensors_handled) + { + /* CLICK 1 handler */ + if (click_handler_function[CLICK1_TYPE]) + { + /* de-assert NRESET to SHT if shared with VOLTS_TEST */ + if ((CLICK1_TYPE == STYPE_SHT) && (GET_VOLTS)) + BSP_ModuleSetGPIOPin(CLICK_RST_PIN, 1); + + /* call handler */ + if (click_handler_function[CLICK1_TYPE]()) + { + printf("Error in Handler 1 (%s)\n", click_name_default[CLICK1_TYPE]); + set_hw_error(); + } + } + + /* CLICK 2 handler */ + if (click_handler_function[CLICK2_TYPE]) + { + /* de-assert NRESET to SHT if shared with VOLTS_TEST */ + if ((CLICK2_TYPE == STYPE_SHT) && (GET_VOLTS)) + BSP_ModuleSetGPIOPin(CLICK_RST_PIN, 1); + + /* call handler */ + if (click_handler_function[CLICK2_TYPE]()) + { + printf("Error in Handler 2 (%s)\n", click_name_default[CLICK2_TYPE]); + set_hw_error(); + } + } + + ReportBattStatus(); + g_sensors_handled = true; + } +} + +// application level check if device can go to sleep +bool hardware_can_sleep(void) +{ + if (!DVBD_CanSleep()) + return false; + + if (g_hw_error) + return false; + + return true; +} + +// application sleep (power-down) function +void hardware_sleep(struct ca821x_dev *pDeviceRef) +{ + uint32_t taskletTimeLeft = MEASUREMENT_PERIOD; + + /* schedule wakeup */ + TASKLET_GetTimeToNext(&taskletTimeLeft); + + /* check that it's worth going to sleep */ + if ((taskletTimeLeft > 100) && USE_SLEEP_MODE) + { + /* and sleep */ + DVBD_DevboardSleep(taskletTimeLeft, pDeviceRef); + } +} + +// application reinitialise after wakeup +void hardware_reinitialise(void) +{ +} + +// re-initialise after wakeup from sleep +static int reinitialise_after_wakeup(struct ca821x_dev *pDeviceRef) +{ + (void)pDeviceRef; + + /* for OpenThread: */ + //otLinkSyncExternalMac(OT_INSTANCE); + + /* reinitialise hardware (application-specific) */ + hardware_reinitialise(); + + return 0; +} + +// sleep if possible +static void sleep_if_possible(struct ca821x_dev *pDeviceRef) +{ + /* for OpenThread: */ + //if (!PlatformCanSleep(OT_INSTANCE)) + // return; + + /* check for hardware (application-specific) */ + if (!hardware_can_sleep()) + return; + + hardware_sleep(pDeviceRef); +} + +// main loop +int main(void) +{ + struct ca821x_dev dev; + + ca821x_api_init(&dev); + cascoda_reinitialise = reinitialise_after_wakeup; + + EVBMEInitialise(CA_TARGET_NAME, &dev); + + hardware_init(); + + /* Endless Polling Loop */ + while (1) + { + cascoda_io_handler(&dev); + hardware_poll(); + sleep_if_possible(&dev); + } /* while(1) */ + + return 0; +} diff --git a/baremetal/cascoda-bm-devboard/include/devboard_batt.h b/baremetal/cascoda-bm-devboard/include/devboard_batt.h index 70c3a0c..93c3c4c 100644 --- a/baremetal/cascoda-bm-devboard/include/devboard_batt.h +++ b/baremetal/cascoda-bm-devboard/include/devboard_batt.h @@ -46,25 +46,52 @@ enum dvbd_vbus_state CONNECTED = 1, }; +/* devboard pin assignments (chili2 pins) for battery functions */ +#define BATT_USB_PRESENT_PIN 5 +#define BATT_VOLTS_TEST_PIN 6 +#define BATT_VOLTS_PIN 35 +#define BATT_CHARGE_STAT_PIN 36 + /** * \brief read the battery voltage * \return vbatt * 100 (10mV resolution) * */ -uint16_t DVBD_BattGetVoltage(void); +uint16_t DVBD_BattGetVolts(void); /** * \brief get the battery charging status + * \return NOT_CHARGING (0) or CHARGING (1) + * + */ +uint8_t DVBD_BattGetChargeStat(void); + +/** + * \brief check if +5V (USB Vbus or external) is connected + * \return NOT_CONNECTED (0) or CONNECTED (1) + * + */ +uint8_t DVBD_BattGetUSBPresent(void); + +/** + * \brief initialise CHARGE_STAT + * \return status + * + */ +ca_error DVBD_BattInitChargeStat(void); + +/** + * \brief initialise VOLTS and VOLTS_TEST * \return status * */ -uint8_t DVBD_BattGetChargingStatus(void); +ca_error DVBD_BattInitVolts(void); /** - * \brief check if +5V (USV Vbus or external) is connected + * \brief initialise USB_PRESENT * \return status * */ -uint8_t DVBD_BattGetVbusConnected(void); +ca_error DVBD_BattInitUSBPresent(void); #endif // DEVBOARD_BATT_H diff --git a/baremetal/cascoda-bm-devboard/source/devboard_batt.c b/baremetal/cascoda-bm-devboard/source/devboard_batt.c index e913fc0..c7399e2 100644 --- a/baremetal/cascoda-bm-devboard/source/devboard_batt.c +++ b/baremetal/cascoda-bm-devboard/source/devboard_batt.c @@ -31,9 +31,11 @@ #include "cascoda-util/cascoda_time.h" #include "devboard_btn.h" +#include "devboard_batt.h" + // get the battery voltage // Vbatt[V] = uint16_t / 100 -uint16_t DVBD_BattGetVoltage(void) +uint16_t DVBD_BattGetVolts(void) { uint32_t adcval; uint16_t vbatt; @@ -50,13 +52,68 @@ uint16_t DVBD_BattGetVoltage(void) } // get the battery charging status -uint8_t DVBD_BattGetChargingStatus(void) +uint8_t DVBD_BattGetChargeStat(void) { return (BSP_GetChargeStat()); } // check if +5V (Vbus or external) is connected -uint8_t DVBD_BattGetVbusConnected(void) +uint8_t DVBD_BattGetUSBPresent(void) { return (BSP_GetVBUSConnected()); } + +// initialise CHARGE_STAT +ca_error DVBD_BattInitChargeStat(void) +{ + struct gpio_input_args args; + + /* input, pull-up, debounced */ + args.mpin = BATT_CHARGE_STAT_PIN; + args.pullup = MODULE_PIN_PULLUP_ON; + args.debounce = MODULE_PIN_DEBOUNCE_ON; + args.irq = MODULE_PIN_IRQ_OFF; + + return BSP_ModuleRegisterGPIOInput(&args); +} + +// initialise VOLTS (and VOLTS_TEST) +ca_error DVBD_BattInitVolts(void) +{ + ca_error status; + struct gpio_input_args args; + + /* VOLTS_TEST */ + /* output, no pull-up, permanent, set to 0 */ + if ((status = BSP_ModuleRegisterGPIOOutput(BATT_VOLTS_TEST_PIN, MODULE_PIN_TYPE_GENERIC))) + return status; + BSP_ModuleSetGPIOPin(BATT_VOLTS_TEST_PIN, 0); + BSP_ModuleSetGPIOOutputPermanent(BATT_VOLTS_TEST_PIN); + + /* VOLTS */ + /* input, no pull-up */ + /* ADC input (analog) is switched in dynamically */ + args.mpin = BATT_VOLTS_PIN; + args.pullup = MODULE_PIN_PULLUP_OFF; + args.debounce = MODULE_PIN_DEBOUNCE_OFF; + args.irq = MODULE_PIN_IRQ_OFF; + if ((status = BSP_ModuleRegisterGPIOInput(&args))) + return status; + + return CA_ERROR_SUCCESS; +} + +// initialise USB_PRESENT +ca_error DVBD_BattInitUSBPresent(void) +{ + struct gpio_input_args args; + + /* USB_PRESENT (VBUS_CONNECTED) */ + /* input, no pull-up */ + args.mpin = BATT_USB_PRESENT_PIN; + args.pullup = MODULE_PIN_PULLUP_OFF; + args.debounce = MODULE_PIN_DEBOUNCE_ON; + args.irq = MODULE_PIN_IRQ_OFF; + + return BSP_ModuleRegisterGPIOInput(&args); +} diff --git a/baremetal/cascoda-bm-driver/CMakeLists.txt b/baremetal/cascoda-bm-driver/CMakeLists.txt index dd763e7..fcc4025 100755 --- a/baremetal/cascoda-bm-driver/CMakeLists.txt +++ b/baremetal/cascoda-bm-driver/CMakeLists.txt @@ -74,7 +74,7 @@ target_link_libraries(cascoda-bm mbedcrypto ) -if((CASCODA_CHILI2_CONFIG_STRING STREQUAL "DEV_BOARD") OR (CASCODA_CHILI2_CONFIG_STRING STREQUAL "DEV_BOARD_BATT")) +if(CASCODA_CHILI2_CONFIG_STRING STREQUAL "DEV_BOARD") target_link_libraries(cascoda-bm PUBLIC cascoda-bm-devboard diff --git a/baremetal/cascoda-bm-driver/source/chili_test.c b/baremetal/cascoda-bm-driver/source/chili_test.c index 6daea62..9ad4cfe 100644 --- a/baremetal/cascoda-bm-driver/source/chili_test.c +++ b/baremetal/cascoda-bm-driver/source/chili_test.c @@ -42,7 +42,7 @@ #include "cascoda-util/cascoda_time.h" #include "ca821x_api.h" #include "cascoda_chili_config.h" -#if (CASCODA_CHILI2_CONFIG == 2 || CASCODA_CHILI2_CONFIG == 3) +#if (CASCODA_CHILI2_CONFIG == 2) #include "devboard_btn.h" #endif @@ -75,7 +75,7 @@ static ca_error CHILI_TEST_MLME_COMM_STATUS_indication(struct MLME_COMM_STATUS_i static void CHILI_TEST_RegisterCallbacks(struct ca821x_dev *pDeviceRef); static void CHILI_TEST_LEDComplete(uint8_t status); -#if (CASCODA_CHILI2_CONFIG == 2 || CASCODA_CHILI2_CONFIG == 3) +#if (CASCODA_CHILI2_CONFIG == 2) static void CHILI_TEST_LEDInit(void); static void CHILI_TEST_LEDResult(uint8_t status); #endif @@ -160,7 +160,7 @@ static void CHILI_TEST_TestInit(struct ca821x_dev *pDeviceRef) CHILI_TEST_RESULT = 0xFF; /* dynamically register callbacks */ CHILI_TEST_RegisterCallbacks(pDeviceRef); -#if (CASCODA_CHILI2_CONFIG == 2 || CASCODA_CHILI2_CONFIG == 3) +#if (CASCODA_CHILI2_CONFIG == 2) if (CHILI_TEST_MODE != CHILI_TEST_REF) CHILI_TEST_LEDInit(); #endif @@ -609,7 +609,7 @@ static void CHILI_TEST_LEDComplete(uint8_t status) /* this is hanging up intentionally - nothing to do after test */ while (1) { -#if (CASCODA_CHILI2_CONFIG == 2 || CASCODA_CHILI2_CONFIG == 3) +#if (CASCODA_CHILI2_CONFIG == 2) CHILI_TEST_LEDResult(status); #else (void)status; @@ -620,7 +620,7 @@ static void CHILI_TEST_LEDComplete(uint8_t status) } // Cascoda Devboard specific -#if (CASCODA_CHILI2_CONFIG == 2 || CASCODA_CHILI2_CONFIG == 3) +#if (CASCODA_CHILI2_CONFIG == 2) static void CHILI_TEST_LEDInit(void) { /* All LEDs on */ diff --git a/baremetal/platform/chili2/CMakeLists.txt b/baremetal/platform/chili2/CMakeLists.txt index ec30d30..ac33329 100644 --- a/baremetal/platform/chili2/CMakeLists.txt +++ b/baremetal/platform/chili2/CMakeLists.txt @@ -15,15 +15,14 @@ endif() # hardware platform configuration cascoda_dropdown(CASCODA_CHILI2_CONFIG_STRING "The hardware configuration of the Chili 2" - ONE_SIDED TWO_SIDED DEV_BOARD DEV_BOARD_BATT NUMAKER_SPI1_CTR NUMAKER_SPI0_NU6 + ONE_SIDED TWO_SIDED DEV_BOARD NUMAKER_SPI1_CTR NUMAKER_SPI0_NU6 ) cascoda_map(${CASCODA_CHILI2_CONFIG_STRING} CASCODA_CHILI2_CONFIG ONE_SIDED 0 TWO_SIDED 1 DEV_BOARD 2 - DEV_BOARD_BATT 3 - NUMAKER_SPI1_CTR 4 - NUMAKER_SPI0_NU6 5 + NUMAKER_SPI1_CTR 3 + NUMAKER_SPI0_NU6 4 ) cascoda_mark_important("CASCODA_CHILI2_CONFIG_STRING") diff --git a/baremetal/platform/chili2/port/include/cascoda_chili.h b/baremetal/platform/chili2/port/include/cascoda_chili.h index 05f6e8d..73cc061 100644 --- a/baremetal/platform/chili2/port/include/cascoda_chili.h +++ b/baremetal/platform/chili2/port/include/cascoda_chili.h @@ -334,20 +334,23 @@ void cascoda_isr_secure_init(void); /** function to kick the linker into including strong ISR overrides */ void cascoda_isr_chili_init(void); -#if ((CASCODA_CHILI2_CONFIG == 0) || (CASCODA_CHILI2_CONFIG == 1)) /* Chili2 */ +/* Chili2 */ +#if ((CASCODA_CHILI2_CONFIG == 0) || (CASCODA_CHILI2_CONFIG == 1)) #define SPI SPI0 #define SPI_MODULE SPI0_MODULE #define SPI_NUM 0 -#elif ((CASCODA_CHILI2_CONFIG == 2) || (CASCODA_CHILI2_CONFIG == 3)) /* Chili2 devboard */ +/* Chili2 devboard */ +#elif (CASCODA_CHILI2_CONFIG == 2) #define SPI SPI0 #define SPI_MODULE SPI0_MODULE #define SPI_NUM 0 -#elif (CASCODA_CHILI2_CONFIG == \ - 4) /* NuMaker-PFM-M2351 dev. board with arduino-style breakout - center SPI connection */ +/* NuMaker-PFM-M2351 dev. board with arduino-style breakout - center SPI connection */ +#elif (CASCODA_CHILI2_CONFIG == 3) #define SPI SPI1 #define SPI_MODULE SPI1_MODULE #define SPI_NUM 1 -#elif (CASCODA_CHILI2_CONFIG == 5) /* NuMaker-PFM-M2351 dev. board with arduino-style breakout - SIP connect D10-D13 */ +/* NuMaker-PFM-M2351 dev. board with arduino-style breakout - SIP connect D10-D13 */ +#elif (CASCODA_CHILI2_CONFIG == 4) #define SPI SPI0 #define SPI_MODULE SPI0_MODULE #define SPI_NUM 0 diff --git a/baremetal/platform/chili2/port/include/cascoda_chili_gpio.h b/baremetal/platform/chili2/port/include/cascoda_chili_gpio.h index c03c06e..aa2690c 100644 --- a/baremetal/platform/chili2/port/include/cascoda_chili_gpio.h +++ b/baremetal/platform/chili2/port/include/cascoda_chili_gpio.h @@ -72,14 +72,17 @@ typedef enum enPortnum /* MFP definitions (need to be checked when changing pins or package!) */ #define PMFP_GPIO 0 #define PMFP_ADC 1 -#if ((CASCODA_CHILI2_CONFIG == 0) || (CASCODA_CHILI2_CONFIG == 1)) /* Chili2 */ +/* Chili2 */ +#if ((CASCODA_CHILI2_CONFIG == 0) || (CASCODA_CHILI2_CONFIG == 1)) #define PMFP_SPI 4 -#elif ((CASCODA_CHILI2_CONFIG == 2) || (CASCODA_CHILI2_CONFIG == 3)) /* Chili2 devboard */ +/* Chili2 devboard */ +#elif (CASCODA_CHILI2_CONFIG == 2) #define PMFP_SPI 4 -#elif (CASCODA_CHILI2_CONFIG == \ - 4) /* NuMaker-PFM-M2351 dev. board with arduino-style breakout - center SPI connection */ +/* NuMaker-PFM-M2351 dev. board with arduino-style breakout - center SPI connection */ +#elif (CASCODA_CHILI2_CONFIG == 3) #define PMFP_SPI 6 -#elif (CASCODA_CHILI2_CONFIG == 5) /* NuMaker-PFM-M2351 dev. board with arduino-style breakout - SIP connect D10-D13 */ +/* NuMaker-PFM-M2351 dev. board with arduino-style breakout - SIP connect D10-D13 */ +#elif (CASCODA_CHILI2_CONFIG == 4) #define PMFP_SPI 5 #endif /* CASCODA_CHILI2_CONFIG */ #if defined(USE_UART) @@ -111,7 +114,8 @@ typedef enum enPortnum * PORTNAME_PVAL: port value for r/w, i.e. PA20 */ -#if ((CASCODA_CHILI2_CONFIG == 0) || (CASCODA_CHILI2_CONFIG == 1)) /* Chili2 */ +/* Chili2 */ +#if ((CASCODA_CHILI2_CONFIG == 0) || (CASCODA_CHILI2_CONFIG == 1)) #if (CASCODA_CHILI_DISABLE_CA821x == 0) /* ZIG_RESET: PC.1 */ #define ZIG_RESET_PORT PC @@ -156,7 +160,8 @@ typedef enum enPortnum #define SPI_CS_PNUM PN_A #define SPI_CS_PIN 3 #define SPI_CS_PVAL PA3 -#elif ((CASCODA_CHILI2_CONFIG == 2) || (CASCODA_CHILI2_CONFIG == 3)) /* Chili2 devboard */ +/* Chili2 devboard */ +#elif (CASCODA_CHILI2_CONFIG == 2) #if (CASCODA_CHILI_DISABLE_CA821x == 0) /* ZIG_RESET: PC.1 */ #define ZIG_RESET_PORT PC @@ -201,8 +206,8 @@ typedef enum enPortnum #define SPI_CS_PNUM PN_A #define SPI_CS_PIN 3 #define SPI_CS_PVAL PA3 -#elif (CASCODA_CHILI2_CONFIG == \ - 4) /* NuMaker-PFM-M2351 dev. board with arduino-style breakout - center SPI connection */ +/* NuMaker-PFM-M2351 dev. board with arduino-style breakout - center SPI connection */ +#elif (CASCODA_CHILI2_CONFIG == 3) /* ZIG_RESET: PC.10 */ #define ZIG_RESET_PORT PC #define ZIG_RESET_PNUM PN_C @@ -234,7 +239,8 @@ typedef enum enPortnum #define SPI_CS_PNUM PN_H #define SPI_CS_PIN 9 #define SPI_CS_PVAL PH9 -#elif (CASCODA_CHILI2_CONFIG == 5) /* NuMaker-PFM-M2351 dev. board with arduino-style breakout - SIP connect D10-D13 */ +/* NuMaker-PFM-M2351 dev. board with arduino-style breakout - SIP connect D10-D13 */ +#elif (CASCODA_CHILI2_CONFIG == 4) /* ZIG_RESET: PC.10 */ #define ZIG_RESET_PORT PC #define ZIG_RESET_PNUM PN_C diff --git a/baremetal/platform/chili2/port/source/cascoda_bsp_chili.c b/baremetal/platform/chili2/port/source/cascoda_bsp_chili.c index 680f93d..be2b820 100644 --- a/baremetal/platform/chili2/port/source/cascoda_bsp_chili.c +++ b/baremetal/platform/chili2/port/source/cascoda_bsp_chili.c @@ -311,7 +311,7 @@ i32_t BSP_GetTemperature(void) return tempval; } -#if (CASCODA_CHILI2_CONFIG == 1 || CASCODA_CHILI2_CONFIG == 3) +#if (CASCODA_CHILI2_CONFIG == 1 || CASCODA_CHILI2_CONFIG == 2) u8_t BSP_GetChargeStat(void) { u8_t charging; @@ -334,7 +334,7 @@ u8_t BSP_GetChargeStat(void) } #endif -#if (CASCODA_CHILI2_CONFIG == 1 || CASCODA_CHILI2_CONFIG == 3) +#if (CASCODA_CHILI2_CONFIG == 1 || CASCODA_CHILI2_CONFIG == 2) u8_t BSP_GetVBUSConnected(void) { u8_t connected; @@ -353,7 +353,7 @@ u8_t BSP_GetVBUSConnected(void) } #endif -#if (CASCODA_CHILI2_CONFIG == 1 || CASCODA_CHILI2_CONFIG == 3) +#if (CASCODA_CHILI2_CONFIG == 1 || CASCODA_CHILI2_CONFIG == 2) u32_t BSP_ADCGetVolts(void) { u32_t voltsval; diff --git a/baremetal/platform/chili2/port/source/cascoda_chili.c b/baremetal/platform/chili2/port/source/cascoda_chili.c index 7d948f2..af333b8 100644 --- a/baremetal/platform/chili2/port/source/cascoda_chili.c +++ b/baremetal/platform/chili2/port/source/cascoda_chili.c @@ -218,17 +218,17 @@ void CHILI_GPIOInit(void) GPIO_SET_DEBOUNCE_TIME(PG, GPIO_DBCTL_DBCLKSRC_HCLK, GPIO_DBCTL_DBCLKSEL_8); GPIO_SET_DEBOUNCE_TIME(PH, GPIO_DBCTL_DBCLKSRC_HCLK, GPIO_DBCTL_DBCLKSEL_8); -#if defined(USE_USB) || (CASCODA_CHILI2_CONFIG == 1) +#if defined(USE_USB) /* disable pull-up on VBUS */ GPIO_SetPullCtl(VBUS_PORT, BITMASK(VBUS_PIN), GPIO_PUSEL_DISABLE); #endif -#if (CASCODA_CHILI2_CONFIG == 1 || CASCODA_CHILI2_CONFIG == 3) +#if (CASCODA_CHILI2_CONFIG == 1) /* devboard handled dynamically */ /* disable pull-up on VBUS_CONNECTED */ GPIO_SetPullCtl(VBUS_CONNECTED_PORT, BITMASK(VBUS_CONNECTED_PIN), GPIO_PUSEL_DISABLE); #endif -#if (CASCODA_CHILI2_CONFIG == 1 || CASCODA_CHILI2_CONFIG == 3) +#if (CASCODA_CHILI2_CONFIG == 1) /* devboard handled dynamically */ /* VOLTS_TEST */ /* output, no pull-up, set to 0 */ GPIO_SetMode(VOLTS_TEST_PORT, BITMASK(VOLTS_TEST_PIN), GPIO_MODE_OUTPUT); @@ -274,7 +274,7 @@ void CHILI_GPIOInit(void) EXTERNAL_SPI_FLASH_CS_PVAL = 1; #endif -#if (CASCODA_CHILI2_CONFIG == 1 || CASCODA_CHILI2_CONFIG == 3) +#if (CASCODA_CHILI2_CONFIG == 1) /* devboard handled dynamically */ /* CHARGE_STAT */ /* input, pull-up, debounced */ GPIO_SetMode(CHARGE_STAT_PORT, BITMASK(CHARGE_STAT_PIN), GPIO_MODE_INPUT); @@ -313,33 +313,23 @@ void CHILI_GPIOPowerDown(u8_t useGPIOforWakeup) GPIO_SetMode(SPI_CS_PORT, BITMASK(SPI_CS_PIN), GPIO_MODE_INPUT); GPIO_SetPullCtl(SPI_CS_PORT, BITMASK(SPI_CS_PIN), GPIO_PUSEL_PULL_UP); -#if (CASCODA_CHILI2_CONFIG == 1 || CASCODA_CHILI2_CONFIG == 3) - /* CHARGE_STAT */ - /* disable pull-up */ - GPIO_SetPullCtl(CHARGE_STAT_PORT, CHARGE_STAT_PIN, GPIO_PUSEL_DISABLE); -#endif - #if CASCODA_EXTERNAL_FLASHCHIP_PRESENT GPIO_SetMode(EXTERNAL_SPI_FLASH_CS_PORT, BITMASK(EXTERNAL_SPI_FLASH_CS_PIN), GPIO_MODE_INPUT); GPIO_SetPullCtl(EXTERNAL_SPI_FLASH_CS_PORT, BITMASK(EXTERNAL_SPI_FLASH_CS_PIN), GPIO_PUSEL_PULL_UP); #endif #if defined(USE_USB) - CHILI_ModuleSetMFP(VBUS_PNUM, VBUS_PIN, PMFP_GPIO); CHILI_ModuleSetMFP(PN_A, 13, PMFP_GPIO); CHILI_ModuleSetMFP(PN_A, 14, PMFP_GPIO); - GPIO_SetMode(VBUS_PORT, BITMASK(VBUS_PIN), GPIO_MODE_INPUT); GPIO_SetMode(PA, BITMASK(13), GPIO_MODE_INPUT); GPIO_SetMode(PA, BITMASK(14), GPIO_MODE_INPUT); - if ((CASCODA_CHILI2_CONFIG == 1 || CASCODA_CHILI2_CONFIG == 3) && (VBUS_CONNECTED_PVAL == 1)) + if ((CASCODA_CHILI2_CONFIG == 1 || CASCODA_CHILI2_CONFIG == 2) && (VBUS_CONNECTED_PVAL == 1)) { - GPIO_SetPullCtl(VBUS_PORT, BITMASK(VBUS_PIN), GPIO_PUSEL_DISABLE); GPIO_SetPullCtl(PA, BITMASK(13), GPIO_PUSEL_DISABLE); GPIO_SetPullCtl(PA, BITMASK(14), GPIO_PUSEL_DISABLE); } else { - GPIO_SetPullCtl(VBUS_PORT, BITMASK(VBUS_PIN), GPIO_PUSEL_PULL_UP); GPIO_SetPullCtl(PA, BITMASK(13), GPIO_PUSEL_PULL_UP); GPIO_SetPullCtl(PA, BITMASK(14), GPIO_PUSEL_PULL_UP); } @@ -369,12 +359,6 @@ void CHILI_GPIOPowerUp(u8_t useGPIOforWakeup) GPIO_SetMode(SPI_CS_PORT, BITMASK(SPI_CS_PIN), GPIO_MODE_OUTPUT); GPIO_SetPullCtl(SPI_CS_PORT, BITMASK(SPI_CS_PIN), GPIO_PUSEL_DISABLE); - /* CHARGE_STAT */ - /* enable pull-up */ -#if (CASCODA_CHILI2_CONFIG == 1 || CASCODA_CHILI2_CONFIG == 3) - GPIO_SetPullCtl(CHARGE_STAT_PORT, BITMASK(CHARGE_STAT_PIN), GPIO_PUSEL_PULL_UP); -#endif - /* dynamic GPIO handling */ CHILI_ModulePowerUpGPIOs(useGPIOforWakeup); } diff --git a/baremetal/platform/chili2/port/source/cascoda_chili_secure.c b/baremetal/platform/chili2/port/source/cascoda_chili_secure.c index 2bdd2ff..b33071a 100644 --- a/baremetal/platform/chili2/port/source/cascoda_chili_secure.c +++ b/baremetal/platform/chili2/port/source/cascoda_chili_secure.c @@ -924,7 +924,7 @@ __NONSECURE_ENTRY u32_t CHILI_PowerDownSecure(u32_t sleeptime_ms, u8_t use_timer CLK->PWRCTL &= ~(CLK_PWRCTL_HIRCEN_Msk); CLK->PWRCTL &= ~(CLK_PWRCTL_HIRC48EN_Msk); CLK_ENABLE_RTCWK(); - if ((CASCODA_CHILI2_CONFIG == 1 || CASCODA_CHILI2_CONFIG == 3) && (VBUS_CONNECTED_PVAL == 1)) + if ((CASCODA_CHILI2_CONFIG == 1 || CASCODA_CHILI2_CONFIG == 2) && (VBUS_CONNECTED_PVAL == 1)) { /* Enable SPD wakeup from pin */ CLK_EnableSPDWKPin(2, 0, CLK_SPDWKPIN_FALLING, CLK_SPDWKPIN_DEBOUNCEDIS); diff --git a/baremetal/platform/chili2/port/source/cascoda_gpio_chili.c b/baremetal/platform/chili2/port/source/cascoda_gpio_chili.c index 7872003..f4fc277 100644 --- a/baremetal/platform/chili2/port/source/cascoda_gpio_chili.c +++ b/baremetal/platform/chili2/port/source/cascoda_gpio_chili.c @@ -93,7 +93,7 @@ static const struct pinlist ModulePinList[] = { /* module pin */ /* port PX.Y */ /* adc channel */ -#if (CASCODA_CHILI2_CONFIG == 0 || CASCODA_CHILI2_CONFIG == 2 || CASCODA_CHILI2_CONFIG == 3) +#if (CASCODA_CHILI2_CONFIG == 0 || CASCODA_CHILI2_CONFIG == 2) {5, PN_B, 12, 12}, /* PB.12 */ {6, PN_B, 13, 13}, /* PB.13 */ {11, PN_A, 13, P_NA}, /* PA.13 */ @@ -104,7 +104,7 @@ static const struct pinlist ModulePinList[] = { #if (CASCODA_EXTERNAL_FLASHCHIP_PRESENT == 0) {15, PN_A, 15, P_NA}, /* PA.15 */ #endif -#if (CASCODA_CHILI2_CONFIG == 0 || CASCODA_CHILI2_CONFIG == 2 || CASCODA_CHILI2_CONFIG == 3) +#if (CASCODA_CHILI2_CONFIG == 0 || CASCODA_CHILI2_CONFIG == 2) {17, PN_A, 12, P_NA}, /* PA.12 */ #endif /* CASCODA_CHILI2_CONFIG */ #if (!CASCODA_CHILI_DISABLE_CA821x) @@ -113,7 +113,7 @@ static const struct pinlist ModulePinList[] = { {32, PN_B, 4, 4}, /* PB.4 */ {33, PN_B, 3, 3}, /* PB.3 */ {34, PN_B, 2, 2}, /* PB.2 */ -#if (CASCODA_CHILI2_CONFIG == 0 || CASCODA_CHILI2_CONFIG == 2 || CASCODA_CHILI2_CONFIG == 3) +#if (CASCODA_CHILI2_CONFIG == 0 || CASCODA_CHILI2_CONFIG == 2) {35, PN_B, 1, 1}, /* PB.1 */ {36, PN_B, 0, 0}, /* PB.0 */ #endif /* CASCODA_CHILI2_CONFIG */ @@ -132,7 +132,7 @@ struct ModuleSpecialPins BSP_GetModuleSpecialPins(void) { struct ModuleSpecialPins rval; memset(&rval, P_NA, sizeof(rval)); -#if (CASCODA_CHILI2_CONFIG == 1 || CASCODA_CHILI2_CONFIG == 3) +#if (CASCODA_CHILI2_CONFIG == 1 || CASCODA_CHILI2_CONFIG == 2) rval.USB_PRESENT = PIN_USB_PRESENT; #endif return rval; diff --git a/baremetal/platform/chili2/port/source/cascoda_sensorif_secure.c b/baremetal/platform/chili2/port/source/cascoda_sensorif_secure.c index e43b637..4f19c83 100644 --- a/baremetal/platform/chili2/port/source/cascoda_sensorif_secure.c +++ b/baremetal/platform/chili2/port/source/cascoda_sensorif_secure.c @@ -226,7 +226,7 @@ __NONSECURE_ENTRY void SENSORIF_I2C_Init(void) else if (SENSORIF_I2CNUM_S == 1) { -#if ((CASCODA_CHILI2_CONFIG == 2) || (CASCODA_CHILI2_CONFIG == 3)) /* Chili2 devboard */ +#if (CASCODA_CHILI2_CONFIG == 2) /* Chili2 devboard */ /* re-config PF.0 and PF.1 */ GPIO_ENABLE_DIGITAL_PATH(PF, BIT0); GPIO_ENABLE_DIGITAL_PATH(PF, BIT1); diff --git a/baremetal/sensorif/include/sif_il3820.h b/baremetal/sensorif/include/sif_il3820.h index ca94e4c..c92d54d 100644 --- a/baremetal/sensorif/include/sif_il3820.h +++ b/baremetal/sensorif/include/sif_il3820.h @@ -62,7 +62,7 @@ extern "C" { /* Pin configuration */ #define SIF_IL3820_BUSY_PIN 31 -#if ((CASCODA_CHILI2_CONFIG == 2) || (CASCODA_CHILI2_CONFIG == 3)) +#if (CASCODA_CHILI2_CONFIG == 2) #define SIF_IL3820_RST_PIN 5 #else #define SIF_IL3820_RST_PIN 15 @@ -157,7 +157,7 @@ ca_error SIF_IL3820_overlay_qr_code(const char *text, uint8_t *image, uint8_t sc * \brief Follows Routines for clearing, waiting and displaying the image. ******************************************************************************* * \param image - The image to be overlaid on the eink screen. - * \param mode - Whether or not the display will be cleared before the image + * \param mode - Whether or not the display will be cleared before the image * is displayed ******************************************************************************* ******************************************************************************/ diff --git a/baremetal/sensorif/include/sif_ssd1681.h b/baremetal/sensorif/include/sif_ssd1681.h index d854f0d..480e2bd 100644 --- a/baremetal/sensorif/include/sif_ssd1681.h +++ b/baremetal/sensorif/include/sif_ssd1681.h @@ -62,7 +62,7 @@ extern "C" { /* Pin configuration */ #define SIF_SSD1681_BUSY_PIN 31 -#if ((CASCODA_CHILI2_CONFIG == 2) || (CASCODA_CHILI2_CONFIG == 3)) +#if (CASCODA_CHILI2_CONFIG == 2) #define SIF_SSD1681_RST_PIN 5 #else #define SIF_SSD1681_RST_PIN 15 @@ -173,7 +173,7 @@ ca_error SIF_SSD1681_overlay_qr_code(const char *text, uint8_t *image, uint8_t s ******************************************************************************* * \param image - The image that is copied into the RAM. * \param full_resolution - Whether the image provided should be displayed - * in full resolution or half resolution. This is is ignored when + * in full resolution or half resolution. This is is ignored when * EPAPER_FULL_RESOLUTION is defined, and therefore only applies to binaries * built with half resolution in mind. This allows the option to display an * image (typically stored in flash) using full resolution, as an exception. diff --git a/docs/guides/border-router-setup.md b/docs/guides/border-router-setup.md index 13aeaaf..8e8b358 100644 --- a/docs/guides/border-router-setup.md +++ b/docs/guides/border-router-setup.md @@ -1,10 +1,14 @@ # Border Router Setup -This guide will walk you through everything you need to know to start using your [Cascoda Border Router](https://www.cascoda.com/products/border-router/). +This guide will walk you through everything you need to know to start using your [KNX IoT Hub](https://www.cascoda.com/products/knx-iot-hub/) as a Thread Border Router. + +

+ +Note: For the purposes of this guide, the KNX IoT Hub will only be used as a Thread Border Router. For that reason, it will simply be referred to as the "Border Router" from hereon. ## Required Hardware -- Cascoda Border Router +- Cascoda's KNX IoT Hub (Border Router) - 12V 1A Power Supply, with centre-positive barrel connector - Ethernet cable - A computer with an Ethernet socket diff --git a/docs/guides/img/border-router/border_router.jpg b/docs/guides/img/border-router/border_router.jpg new file mode 100644 index 0000000000000000000000000000000000000000..bc582ca7c94c3bd14b751c9b473e8f128e3ce340 GIT binary patch literal 15099 zcmeHucT^MW*8YUhq=NzJ9cj`*nwW^vI|wKuh#kUq7AAY#i?kI^Mg_DlRA{C?X2pX&AT)P!N-lkq}Xkk&;nSQkCMAhbHr7O3GgOe2(ss}>G`(wOZFO10#oO7!%lMv^`N@w!D54nVYrR2^3>(_A&KuL&m1Lp=5!Uo__LZFn8<9dJvv;hzF%ZY1#c|mZXxOn&k zglC9|!3#<#02~Muih~Qq!^6b|uYL%g2XHCzsMtiV;GfkoBVc!diTX#qCghMWtfkid zy2>eb*Y(jEBARowbo5;3xp{c`#3e3DN=eIHy{4e3q^zQ&qT-U$vhs?`y3h3ujZMuh zt=&DC-oE~U!J&!Csp*;7x%q{~we^k7t?ixNz5NrrAOQ4dvwpMe-|V6U?ZUyuh2j#N z*agAy1UD!pE*_f*KGhW+0yCGh?4tgJF!`w0g|%lm#B^7w@49{^qTv*u;95H|?I+9r zo?(yvSC;)|*uU%=0!W|`aPXj%036sP;sMf7|9|(J4{-91j!IwJTYZRCqCM<2)av zF$;!#$s|Qr__vY!hvV2jtn{K2LId#9|LpkUB_>8E#K~DUB1mWU$GWL<9oFg?$TNAO zj1vOzq@Kc#uQUy7lI(g6j6RK6Krl0LU$Eh=s@a4G=}h)*YZ>V5)BoT-9j}8!X}KGs z#gC{)D&N}EyX8MQm&XP8Sbeq_PU|=Z#$N6dEiIhdt?zm@9DX7h^UXH>5@P3k>A_Zd z9^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!Zv4&J+fD9PI9rB}^#Z+8F z;AI)<2J6ns^~W6>NLb(k(7oB+m~bYM2l}#q=f)yU|9rZ&Q^L-^pMF>4#Mj%JSLpD= zQT#wF_*s!hqxi1>$6HP~|6$7!Tx&)iihd(gl{-41!gymtCjX%|WXMQ^G*rjHm)y)$X!6rO+Q~kP1fy6vKrFe8=iT_SWvO7|2fOrT$cLhqPBJNzRcT_dgXNG zAJp8j-}z(q5`9?DM||#M3((}OaJrckwRb;{=S~pbFo_ENKD)o}usP@dYRv}%TuD+_ zWyj1MQ8_d@`V$V+BVd~RcE|<0@3xr$%stf%!N~}UX5yrJEw6Bv1I^6q$+s`2QfhTX|<>S37ev-xz`{y*`T2Z-(wVc0#B!dHIDi>!k{ z55yYHn!&-2l5(Q6!QSp1qImG$)vu&A@hVja;F@py#rd^PqgEcE8D(DsW$qnaFzit? zC%k1d6DfFx*ncnaH9fIYjz)h=nWUn_6+1~|Ebmd?@v&x9$kE|4j*+|K#-6&neeo0 zqmuN!g;+zEZO(b_C~>c+I|DmnBv-7bkv>|H$cTlT0kvtq&tJ`cQ>2}Wg)M(z^fi%={@V);gv2Z~y;EPs6b+$AkY5-uXuT literal 0 HcmV?d00001 diff --git a/docs/how-to/howto-knxiot.md b/docs/how-to/howto-knxiot.md index 5bc26fa..9850010 100644 --- a/docs/how-to/howto-knxiot.md +++ b/docs/how-to/howto-knxiot.md @@ -1 +1,18 @@ -# knx iot guide +# Getting Started with KNX IoT over Thread + +We offer a wide range of KNX IoT over Thread demo applications. You can find an exhaustive list of applications, along with instructions on how to build them [here](https://github.com/Cascoda/knx_iot_demos). Here are some of the applications available. + +## Applications + +| Application | Description | # Functions | Click/Hardware | +|--------------| ------------| ---------- | ------| +| EINK_HVAC | Eink display controlling RTS, RRHS and FA | RTC UHRS| EINK | +| EINK_LIGHTING| Eink display controlling LSAB/LDAB| LSSB LDSB| EINK | +| FA | Fan Actuator | FA | Fan | +| LSAB | Light Switching Actuator Basic | LSAB | - | +| LSSB | Light Switching Sensor Basic | LSSB | - | +| LDAB | Light Dimming Actuator Basic | LDAB | LED Driver 2 | +| LDSB | Light Dimming Sensor Basic | LDSB| - | +| PROD | Production executable | LSAB & LSSB (no feedback)| - | +| RTS | Room Temperature Sensor| RTS | Thermo 3 | +| RTS_RRHS | Room Temperture & Humidity Sensor | RTS RHHS | SHT | \ No newline at end of file diff --git a/docs/reference/cmake-configuration.md b/docs/reference/cmake-configuration.md index 07236fa..d6e1292 100644 --- a/docs/reference/cmake-configuration.md +++ b/docs/reference/cmake-configuration.md @@ -71,4 +71,3 @@ Set the target configuration for the firmware. | ONE_SIDED | Configured for the Chili2S | TWO_SIDED | Configured for the Chili2D | DEV_BOARD | Configured for the [Development Board](../how-to/howto-devboard.md) -| DEV_BOARD_BATT | Configured for the [Development Board](../how-to/howto-devboard.md) with Battery monitoring Functions diff --git a/etc/options.cmake b/etc/options.cmake index 074f503..57dfd56 100644 --- a/etc/options.cmake +++ b/etc/options.cmake @@ -25,8 +25,8 @@ if(CASCODA_BUILD_OCF AND CASCODA_BUILD_KNX) endif() if(CASCODA_BUILD_KNX) - if(NOT ((CASCODA_CHILI2_CONFIG_STRING STREQUAL "DEV_BOARD") OR (CASCODA_CHILI2_CONFIG_STRING STREQUAL "DEV_BOARD_BATT"))) - message(FATAL_ERROR "Not possible to enable CASCODA_BUILD_KNX, unless CASCODA_CHILI2_CONFIG_STRING is DEV_BOARD or DEV_BOARD_BATT") + if(NOT (CASCODA_CHILI2_CONFIG_STRING STREQUAL "DEV_BOARD")) + message(FATAL_ERROR "Not possible to enable CASCODA_BUILD_KNX, unless CASCODA_CHILI2_CONFIG_STRING is DEV_BOARD") endif() endif()