forked from mjcross/esp32-owb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move to new esp rmt device driver: resolves DavidAntliff#28
- Loading branch information
mjcross
committed
Apr 6, 2023
1 parent
cdd344f
commit 0e1821c
Showing
5 changed files
with
682 additions
and
409 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Copyright (c) 2023 mjcross | ||
* | ||
* SPDX-License-Identifier: MIT | ||
**/ | ||
|
||
#include "owb_rmt_bus_timings.h" | ||
|
||
// RMT transmit channel symbols for the onewire bus signals and conditions | ||
// | ||
|
||
// basic bus levels | ||
// ---------------- | ||
// note: we configure the transmit channel to be hardware inverted, | ||
// so that the bus initialises in the 'released' state | ||
#define OWB_RMT_BUS_ASSERTED 1 | ||
#define OWB_RMT_BUS_RELEASED 0 | ||
|
||
// bus symbols as `rmt_symbol_word_t` | ||
// ---------------------------------- | ||
|
||
// send 'zero' bit | ||
#define OWB_RMT_SYMBOL_0BIT { \ | ||
.level0 = OWB_RMT_BUS_ASSERTED, \ | ||
.duration0 = OWB_TIMING_PARAM_C, \ | ||
.level1 = OWB_RMT_BUS_RELEASED, \ | ||
.duration1 = OWB_TIMING_PARAM_D } | ||
|
||
// send 'one' bit | ||
#define OWB_RMT_SYMBOL_1BIT { \ | ||
.level0 = OWB_RMT_BUS_ASSERTED, \ | ||
.duration0 = OWB_TIMING_PARAM_A, \ | ||
.level1 = OWB_RMT_BUS_RELEASED, \ | ||
.duration1 = OWB_TIMING_PARAM_B } | ||
|
||
// send bus reset | ||
#define OWB_RMT_SYMBOL_RESET { \ | ||
.level0 = OWB_RMT_BUS_ASSERTED, \ | ||
.duration0 = OWB_TIMING_PARAM_H, \ | ||
.level1 = OWB_RMT_BUS_RELEASED, \ | ||
.duration1 = OWB_TIMING_PARAM_I + OWB_TIMING_PARAM_J } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// onewire bus master timings | ||
|
||
// standard rate master timings recommended in the 1-Wire specification | ||
// the values below are the ones recommended by the specification. | ||
|
||
// for the meaning of each parameter, see the following document: | ||
// https://www.analog.com/en/technical-articles/1wire-communication-through-software.html | ||
|
||
// all values in microsec | ||
#define OWB_TIMING_PARAM_A 6 | ||
#define OWB_TIMING_PARAM_B 64 | ||
#define OWB_TIMING_PARAM_C 60 | ||
#define OWB_TIMING_PARAM_D 10 | ||
#define OWB_TIMING_PARAM_E 9 | ||
#define OWB_TIMING_PARAM_F 55 | ||
#define OWB_TIMING_PARAM_G 0 | ||
#define OWB_TIMING_PARAM_H 480 | ||
#define OWB_TIMING_PARAM_I 70 | ||
#define OWB_TIMING_PARAM_J 410 |
Oops, something went wrong.