diff -r bc7c05011d69 -r 45647136ec95 components/esp32-owb/include/owb.h --- a/components/esp32-owb/include/owb.h Mon Oct 29 11:32:03 2018 +0100 +++ b/components/esp32-owb/include/owb.h Mon Oct 29 12:16:37 2018 +0100 @@ -46,11 +46,11 @@ // ROM commands -#define OWB_ROM_SEARCH 0xF0 -#define OWB_ROM_READ 0x33 -#define OWB_ROM_MATCH 0x55 -#define OWB_ROM_SKIP 0xCC -#define OWB_ROM_SEARCH_ALARM 0xEC +#define OWB_ROM_SEARCH 0xF0 ///< Command ROM search +#define OWB_ROM_READ 0x33 ///< ROM read +#define OWB_ROM_MATCH 0x55 ///< ROM address match +#define OWB_ROM_SKIP 0xCC ///< Skip device +#define OWB_ROM_SEARCH_ALARM 0xEC ///< Search device with alarm set #define OWB_ROM_CODE_STRING_LENGTH (17) ///< Typical length of OneWire bus ROM ID as ASCII hex string, including null terminator @@ -100,15 +100,18 @@ int last_device_flag; } OneWireBus_SearchState; +/** + * @brief Status codes + */ typedef enum { - OWB_STATUS_OK, - OWB_STATUS_NOT_INITIALIZED, - OWB_STATUS_PARAMETER_NULL, - OWB_STATUS_DEVICE_NOT_RESPONDING, - OWB_STATUS_CRC_FAILED, - OWB_STATUS_TOO_MANY_BITS, - OWB_STATUS_HW_ERROR + OWB_STATUS_OK, ///< Ok + OWB_STATUS_NOT_INITIALIZED, ///< Init error + OWB_STATUS_PARAMETER_NULL, ///< NULL parameter + OWB_STATUS_DEVICE_NOT_RESPONDING, ///< Device does not respond + OWB_STATUS_CRC_FAILED, ///< CRC error + OWB_STATUS_TOO_MANY_BITS, ///< Too many bits + OWB_STATUS_HW_ERROR ///< Hardware error } owb_status; /** NOTE: Driver assumes that (*init) was called prior to any other methods */ @@ -133,6 +136,8 @@ /** * @brief call to release resources after completing use of the OneWireBus + * @param[in] bus Pointer to initialised bus instance. + * @return status */ owb_status owb_uninitialize(OneWireBus * bus); @@ -164,7 +169,7 @@ /** * @brief Reset the 1-Wire bus. * @param[in] bus Pointer to initialised bus instance. - * @param[out] is_present set to true if at least one device is present on the bus + * @param[out] a_device_present set to true if at least one device is present on the bus * @return status */ owb_status owb_reset(const OneWireBus * bus, bool* a_device_present);