Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Max32630_One_Wire_Interface
Diff: OneWire_Masters/GPIO/owgpio.h
- Revision:
- 9:641516a3f0dc
- Parent:
- 5:ce108eeb878d
- Child:
- 10:0df2cc66fc47
diff -r 7c7a0ea0c568 -r 641516a3f0dc OneWire_Masters/GPIO/owgpio.h
--- a/OneWire_Masters/GPIO/owgpio.h Thu Feb 25 06:03:23 2016 +0000
+++ b/OneWire_Masters/GPIO/owgpio.h Mon Feb 29 02:35:12 2016 +0000
@@ -56,6 +56,29 @@
{
public:
+ //1-wire timming constants for bit-bang.
+ //Tested on MAX32600MBED board, you will have to adjust if using a different board
+ //values in comments are real timming values
+
+ //Reset Pulse
+ static const uint16_t TRSTL_STD = (2250); //560us, from falling edge
+
+ //Master sample time for PD
+ static const uint16_t TMSP_STD = (250); //68us, from rising edge of reset pulse
+
+ //Write 0
+ static const uint16_t TW0L_STD = (240); //64us, from falling edge
+
+ //Write 1, Read low time
+ static const uint16_t TW1L_STD = (20); //8us, from falling edge
+
+ //Master sample time for bit
+ static const uint16_t TMSR_STD = (3); //12us, from falling edge
+
+ //make sure to use TSLOT for recoveries, 70us is greater than min value
+ static const uint16_t TSLOT_STD = (70); //70us, measured from falling to falling.
+
+
/**********************************************************//**
* @brief
*
@@ -129,7 +152,15 @@
DigitalInOut _ow_gpio;
DigitalOut _ext_spu;
+ OW_SPEED _ow_speed;
+ OW_LEVEL _ow_level;
+
+ // Search state
uint8_t _rom_number[ROMnumberLen];
+ uint8_t _last_discrepancy;
+ uint8_t _last_family_discrepancy;
+ uint8_t _last_device_flag;
+ uint8_t _crc8;
};
#endif /*OWGPIO_H*/