Added documentation, removed library from Makefile

Making the mqtt as a .a library is a project for a later date.
The recipe was broken and so was removed to avoid confusion.

Added the Mozilla License header to the new files. Also a few
small corrections and additions to the Doxygen documentation.

Signed-off-by: A.M. Rowsell <amrowsell@frozenelectronics.ca>
This commit is contained in:
A.M. Rowsell 2019-01-22 12:16:39 -05:00
commit 049573ad4b
Signed by: amr
GPG key ID: 0B6E2D8375CF79A9
4 changed files with 25 additions and 6 deletions

View file

@ -23,7 +23,3 @@ flash: $(P)-0x00000.bin
clean:
rm -f $(P) $(OBJ) $(P)-0x00000.bin $(P)-0x10000.bin *~
library:
$(CC) -c -fPIC $(CFLAGS) $(P).c -o $(P).o
$(AR) rcs lib$(P).a $(P).o

2
mqtt.h
View file

@ -100,7 +100,7 @@ void ICACHE_FLASH_ATTR reconnected_callback(void *arg, sint8 err);
/**
* A callback function which is called when TCP connection is successful.
* @param *arg A pointer to void, which needs to be cast to espconn *pConn
* @returns Void
* @return Void
*
* This function is called once the TCP connection to the server is completed. This allows us to register the callbacks for received and sent data, as well as enable TCP keepalive and set validConnection in mqtt_session_t to 1 to show the connection has been successful.
*/

View file

@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <stdint.h>
#include "os_type.h"
#include "osapi.h"
@ -5,7 +9,7 @@
#include "gpio.h"
#include "onewire.h"
#define OWBUS BIT5
#define OWBUS BIT5 /**< This define determines which pin is used */
sint8 ICACHE_FLASH_ATTR reset(void) {
uint32_t time;

View file

@ -1,7 +1,16 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <stdint.h>
#include "os_type.h"
#include "gpio.h"
/**
* @file
* @brief This is the header file for the one-wire library
*/
/**
* @struct oneWire_t
* Structure that holds all the information about onewire connections, including the 64-bit ROM address for each device and some buffer memory to read out the scratchpad
@ -29,5 +38,15 @@ typedef enum {
E2_RECALL = 0xB8
} ds18b20_cmds;
/**
* Function sends a reset pulse on the one-wire bus and checks for a presence pulse
* @return 0 if no presence, 1 if presence
*/
sint8 ICACHE_FLASH_ATTR reset(void);
/**
* Function which handles all one-wire communication besides the reset sequence.
* @param owDev A pointer to the oneWire_t variable for this device
* @param cmd One of the commands from ds18b20_cmds
*/
void ICACHE_FLASH_ATTR transact(oneWire_t *owDev, ds18b20_cmds cmd);