diff options
author | barthess <barthess@yandex.ru> | 2014-12-18 00:21:28 +0300 |
---|---|---|
committer | barthess <barthess@yandex.ru> | 2014-12-18 00:21:28 +0300 |
commit | 073d4d467f501f99334c43ef5583ae40888aa274 (patch) | |
tree | 05f01f08c62b00e33c0be78bea1b6937e2d08e59 /os/hal/include | |
parent | 99505cdea68069a3873e670ccc95cdc0f94d2319 (diff) | |
download | ChibiOS-Contrib-073d4d467f501f99334c43ef5583ae40888aa274.tar.gz ChibiOS-Contrib-073d4d467f501f99334c43ef5583ae40888aa274.tar.bz2 ChibiOS-Contrib-073d4d467f501f99334c43ef5583ae40888aa274.zip |
1-wire. STM32F1xx code tested
Diffstat (limited to 'os/hal/include')
-rw-r--r-- | os/hal/include/onewire.h | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/os/hal/include/onewire.h b/os/hal/include/onewire.h index b2c6462..dc82a67 100644 --- a/os/hal/include/onewire.h +++ b/os/hal/include/onewire.h @@ -80,13 +80,6 @@ typedef void (*onewire_pullup_release_t)(void); #endif /* ONEWIRE_USE_STRONG_PULLUP */ /** - * @brief 1-wire read bit callback type. - * - * @return Bit acquired directly from pin (0 or 1) - */ -typedef uint_fast8_t (*onewire_read_bit_t)(void); - -/** * @brief Driver state machine possible states. */ typedef enum { @@ -134,10 +127,29 @@ typedef struct { */ size_t sample_channel; /** - * @brief Pointer to function performing read of single bit. - * @note It must be callable from any context. + * @brief Port Identifier. + * @details This type can be a scalar or some kind of pointer, do not make + * any assumption about it, use the provided macros when populating + * variables of this type. + */ + ioportid_t port; + /** + * @brief Digital I/O port pad. + */ + ioportmask_t pad; +#if defined(STM32F1XX) + /** + * @brief Digital I/O mode for idle bus. + * @details This is a kind of workaround against F1x realization of alternate + * function. Alternate function mode will be activated only + * when you starts appropriate peripheral. + */ + iomode_t pad_mode_idle; +#endif + /** + * @brief Digital I/O mode for active bus. */ - onewire_read_bit_t readBitX; + iomode_t pad_mode_active; #if ONEWIRE_USE_STRONG_PULLUP /** * @brief Pointer to function asserting of strong pull up. |