BNO055 and RF430CL331H source and header files and related code in boot.s and warp.h added.
Added new function to get the state of BME680
Added new functions to push and release IS25xp from a deep power-down state.
Pushed all components to sleep mode here
`#if (WARP_BUILD_ENABLE_GLAUX_VARIANT && WARP_BUILD_BOOT_TO_CSVSTREAM)
warpScaleSupplyVoltage(3300);
int timer = 0;
int rttKey = -1;
bool _originalWarpExtraQuietMode = gWarpExtraQuietMode;
gWarpExtraQuietMode = false;
releaseDeepPowerModeIS25xP();
warpPrint("Press any key to show menu...\n");
gWarpExtraQuietMode = _originalWarpExtraQuietMode;
if (rttKey < 0)
{
printBootSplash(gWarpCurrentSupplyVoltage, menuRegisterAddress, &powerManagerCallbackStructure);
warpPrint("About to loop with printSensorDataBME680()...\n");
while (1)
{
blinkLED(kGlauxPinLED);
for (int i = 0; i < kGlauxSensorRepetitionsPerSleepIteration; i++)
{
warpPrint("%d'n", i);
if (WARP_CSVSTREAM_TO_FLASH)
#if (WARP_BUILD_ENABLE_DEVIS25xP)
/*
* Release the Flash from deep power-down
*/
releaseDeepPowerModeIS25xP();
warpPrint("\r\n\tFlash status after releasing from deep power mode and before reading data from it\n");
flashStatusIS25xP();
#endif
writeAllSensorsToFlash(0 /* menuDelayBetweenEachRun */, 0 /* loopForever */);
}
#if (WARP_BUILD_ENABLE_DEVBME680)
warpPrint("About to configureSensorBME680() for sleep...\n");
status = configureSensorBME680( 0b00000000, /* payloadCtrl_Hum: Sleep */
0b00000000, /* payloadCtrl_Meas: No temperature samples, no pressure samples, sleep */
0b00001000 /* payloadGas_0: Turn off heater */
);
if (status != kWarpStatusOK)
{
warpPrint("configureSensorBME680() failed...\n");
}
StateBME680();
#endif
#if (WARP_BUILD_ENABLE_DEVBNO055)
configureSensorRegisterBNO055(0x00, 0x02);
StateBNO055();
#endif
#if (WARP_BUILD_ENABLE_DEVRF430CL331H)
warpPrint("\r\n\tRF430CL control register status before going to standby mode\n");
StatusRF430CL331H();
configureSensorRegisterRF430CL331H(0x0040);
warpPrint("\r\n\tRF430CL control register status after going to standby mode\n");
StatusRF430CL331H();
#endif
#if (WARP_BUILD_ENABLE_DEVIS25xP)
/*
* Put the Flash in deep power-down
*/
deepPowerModeIS25xP();
if (status != kWarpStatusOK)
{
warpPrint("\r\n\tError: communication failed");
}
warpPrint("\r\n\tFlash status after going into low power mode\n");
flashStatusIS25xP();
#endif
warpDisableI2Cpins();
blinkLED(kGlauxPinLED);
warpPrint("About to go into VLLS0...\n");
status = warpSetLowPowerMode(kWarpPowerModeVLLS0, kGlauxSleepSecondsBetweenSensorRepetitions /* sleep seconds */);
if (status != kWarpStatusOK)
{
warpPrint("warpSetLowPowerMode(kWarpPowerModeVLLS0, 10)() failed...\n");
}
warpPrint("Should not get here...");
}
}
endif`
**** bug **
To store correct BME680 results in the flash, temporarily comment sensorBitField for BNO055, RF430CL331H, and RV8803C7 in writeAllSensorsToFlash function in boot.c. Otherwise, it will store the wrong values. It's related to appendSensorDataBNO055, appendSensorDataRF430CL331H and appendSensorDataRV8803C7 functions.
Pushed all components to sleep mode here `#if (WARP_BUILD_ENABLE_GLAUX_VARIANT && WARP_BUILD_BOOT_TO_CSVSTREAM) warpScaleSupplyVoltage(3300); int timer = 0; int rttKey = -1;
bool _originalWarpExtraQuietMode = gWarpExtraQuietMode; gWarpExtraQuietMode = false; releaseDeepPowerModeIS25xP(); warpPrint("Press any key to show menu...\n"); gWarpExtraQuietMode = _originalWarpExtraQuietMode;
while (rttKey < 0 && timer < kWarpCsvstreamMenuWaitTimeMilliSeconds) { rttKey = SEGGER_RTT_GetKey(); OSA_TimeDelay(1); timer++; }
if (rttKey < 0) { printBootSplash(gWarpCurrentSupplyVoltage, menuRegisterAddress, &powerManagerCallbackStructure);
if (WARP_CSVSTREAM_TO_FLASH)
else
endif
}
endif`
**** bug ** To store correct BME680 results in the flash, temporarily comment sensorBitField for BNO055, RF430CL331H, and RV8803C7 in writeAllSensorsToFlash function in boot.c. Otherwise, it will store the wrong values. It's related to appendSensorDataBNO055, appendSensorDataRF430CL331H and appendSensorDataRV8803C7 functions.
`#if (WARP_BUILD_ENABLE_DEVBNO055) numberOfConfigErrors += configureSensorRegisterBNO055(0x00, 0x02);
endif`
`#if (WARP_BUILD_ENABLE_DEVRF430CL331H) numberOfConfigErrors += configureSensorRegisterRF430CL331H(0x0040);
endif`
`#if (WARP_BUILD_ENABLE_DEVRV8803C7) // sensorBitField = sensorBitField | kWarpFlashRV8803C7BitField;
endif`
`#if (WARP_BUILD_ENABLE_DEVBNO055) // bytesWrittenIndex += appendSensorDataBNO055(flashWriteBuf + bytesWrittenIndex);
endif`
`#if (WARP_BUILD_ENABLE_DEVRF430CL331H) // bytesWrittenIndex += appendSensorDataRF430CL331H(flashWriteBuf + bytesWrittenIndex);
endif`
Closes https://github.com/physical-computation/Warp-firmware/issues/131.