this works with the old SUS
This commit is contained in:
parent
451729b103
commit
95f09469d1
@ -24,7 +24,7 @@ debugging. */
|
|||||||
#define TEST_SUS_HANDLER 1
|
#define TEST_SUS_HANDLER 1
|
||||||
#define TEST_PLOC_HANDLER 0
|
#define TEST_PLOC_HANDLER 0
|
||||||
|
|
||||||
#define TE0720 1
|
#define TE0720 0
|
||||||
#define TE0720_HEATER_TEST 0
|
#define TE0720_HEATER_TEST 0
|
||||||
|
|
||||||
#define P60DOCK_DEBUG 0
|
#define P60DOCK_DEBUG 0
|
||||||
|
@ -31,9 +31,14 @@ void SusHandler::doShutDown(){
|
|||||||
|
|
||||||
ReturnValue_t SusHandler::buildNormalDeviceCommand(
|
ReturnValue_t SusHandler::buildNormalDeviceCommand(
|
||||||
DeviceCommandId_t * id) {
|
DeviceCommandId_t * id) {
|
||||||
if (communicationStep == CommunicationStep::PERFORM_CONVERSIONS) {
|
if (communicationStep == CommunicationStep::WRITE_SETUP) {
|
||||||
*id = SUS::PERFORM_CONVERSIONS;
|
*id = SUS::WRITE_SETUP;
|
||||||
communicationStep = CommunicationStep::REQUEST_TEMP;
|
communicationStep = CommunicationStep::REQUEST_TEMP;
|
||||||
|
// communicationStep = CommunicationStep::PERFORM_CONVERSIONS;
|
||||||
|
}
|
||||||
|
else if (communicationStep == CommunicationStep::PERFORM_CONVERSIONS) {
|
||||||
|
*id = SUS::PERFORM_CONVERSIONS;
|
||||||
|
communicationStep = CommunicationStep::WRITE_SETUP;
|
||||||
// communicationStep = CommunicationStep::PERFORM_CONVERSIONS;
|
// communicationStep = CommunicationStep::PERFORM_CONVERSIONS;
|
||||||
}
|
}
|
||||||
else if (communicationStep == CommunicationStep::REQUEST_TEMP) {
|
else if (communicationStep == CommunicationStep::REQUEST_TEMP) {
|
||||||
@ -63,6 +68,7 @@ ReturnValue_t SusHandler::buildCommandFromCommand(
|
|||||||
size_t commandDataLen) {
|
size_t commandDataLen) {
|
||||||
switch(deviceCommand) {
|
switch(deviceCommand) {
|
||||||
case(SUS::WRITE_SETUP): {
|
case(SUS::WRITE_SETUP): {
|
||||||
|
gpioComIF->pullLow(chipSelectId);
|
||||||
cmdBuffer[0] = SUS::SETUP_DEFINITION;
|
cmdBuffer[0] = SUS::SETUP_DEFINITION;
|
||||||
rawPacket = cmdBuffer;
|
rawPacket = cmdBuffer;
|
||||||
rawPacketLen = 1;
|
rawPacketLen = 1;
|
||||||
@ -76,11 +82,11 @@ ReturnValue_t SusHandler::buildCommandFromCommand(
|
|||||||
* The sun sensor ADC is shutdown when CS is pulled high so each time requesting a
|
* The sun sensor ADC is shutdown when CS is pulled high so each time requesting a
|
||||||
* measurement the setup has to be rewritten
|
* measurement the setup has to be rewritten
|
||||||
*/
|
*/
|
||||||
cmdBuffer[0] = SUS::RESET_FIFO;
|
// cmdBuffer[0] = SUS::RESET_FIFO;
|
||||||
cmdBuffer[1] = SUS::SETUP_DEFINITION;
|
// cmdBuffer[1] = SUS::SETUP_DEFINITION;
|
||||||
// wirte one dummy byte here
|
// wirte one dummy byte here
|
||||||
// cmdBuffer[2] = SUS::CONVERT_TEMPERATURE;
|
// cmdBuffer[2] = SUS::CONVERT_TEMPERATURE;
|
||||||
cmdBuffer[2] = SUS::CONVERT_DIFF_CHANNEL_1;
|
cmdBuffer[0] = SUS::CONVERT_DIFF_CHANNEL_1;
|
||||||
|
|
||||||
// cmdBuffer[0] = SUS::SETUP_DEFINITION;
|
// cmdBuffer[0] = SUS::SETUP_DEFINITION;
|
||||||
// cmdBuffer[1] = SUS::UNIPOLAR_CONFIG;
|
// cmdBuffer[1] = SUS::UNIPOLAR_CONFIG;
|
||||||
@ -90,7 +96,7 @@ ReturnValue_t SusHandler::buildCommandFromCommand(
|
|||||||
// cmdBuffer[30] = SUS::CONVERT_DIFF_CHANNEL_4_5;
|
// cmdBuffer[30] = SUS::CONVERT_DIFF_CHANNEL_4_5;
|
||||||
rawPacket = cmdBuffer;
|
rawPacket = cmdBuffer;
|
||||||
// rawPacketLen = SUS::SIZE_PERFORM_CONVERSIONS;
|
// rawPacketLen = SUS::SIZE_PERFORM_CONVERSIONS;
|
||||||
rawPacketLen = 5;
|
rawPacketLen = 3;
|
||||||
return RETURN_OK;
|
return RETURN_OK;
|
||||||
}
|
}
|
||||||
case(SUS::RQUEST_TEMP): {
|
case(SUS::RQUEST_TEMP): {
|
||||||
|
@ -43,7 +43,8 @@ private:
|
|||||||
enum class CommunicationStep {
|
enum class CommunicationStep {
|
||||||
PERFORM_CONVERSIONS,
|
PERFORM_CONVERSIONS,
|
||||||
REQUEST_TEMP,
|
REQUEST_TEMP,
|
||||||
READ_TEMP
|
READ_TEMP,
|
||||||
|
WRITE_SETUP
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class InternalState {
|
enum class InternalState {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user