Skip to content

Commit

Permalink
SRF02: Add config options for SRF02
Browse files Browse the repository at this point in the history
  • Loading branch information
Roadyweb committed Mar 31, 2014
1 parent 0690778 commit 15c473d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
18 changes: 18 additions & 0 deletions firmware/src_common/e2p_envsensor.h
Expand Up @@ -93,6 +93,24 @@ static inline TemperatureSensorTypeEnum e2p_envsensor_get_barometricsensortype(v
return eeprom_read_UIntValue8(66, 0, 8, 0, 255);
}

typedef enum {
ULTRASONICRANGEFINDERTYPE_NOSENSOR = 0,
ULTRASONICRANGEFINDERTYPE_SRF02 = 1
} UltrasonicRangeFinderTypeEnum;

static inline void e2p_envsensor_set_ultrasonicrangefindertype(UltrasonicRangeFinderTypeEnum val)
{
eeprom_write_UIntValue(67, 0, 8, val);
}

// Get TemperatureSensorType (EnumValue)
// Byte offset: 64, bit offset: 0, length bits 8
static inline UltrasonicRangeFinderTypeEnum e2p_envsensor_get_ultrasonicrangefindertype(void)
{
return eeprom_read_UIntValue8(67, 0, 8, 0, 255);
}



// Reserved area with 7664 bits

Expand Down
15 changes: 14 additions & 1 deletion tools/shc_e2p_editor/e2p_layout.xml
Expand Up @@ -144,8 +144,21 @@
<Name>BMP085</Name>
</Element>
</EnumValue>
<EnumValue>
<ID>UltrasonicRangeFinderType</ID>
<Description>You can choose one of the supported ultrasonic range finders.</Description>
<Bits>8</Bits>
<Element>
<Value>0</Value>
<Name>NoSensor</Name>
</Element>
<Element>
<Value>1</Value>
<Name>SRF02</Name>
</Element>
</EnumValue>
<Reserved>
<Bits>7656</Bits>
<Bits>7648</Bits>
</Reserved>
</Block>
<Block>
Expand Down

0 comments on commit 15c473d

Please sign in to comment.