546cc47121
* bmp180: comment typo * ds3231: minor code style fixes. Comment, on the week day start. * Reverse engineered ets_timers.o Switch from FreeRTOS queue to task notification. Removed unknown/unused code. Rename sdk_ets_handler_isr to process_pending_timers. Add function for microseconds Simplify time to ticks conversion * ets_timer: code for using the FreeRTOS timers, and remove from libs. * libc: update to a recent newlib version. * LwIP v2 support * spi_write: use uint32_t for the page iteration counter. The page counter was using an uint8_t which seems unnecessary and might wrap. * sysparam_get_bool: memcpy the binary values out. * FreeRTOS 9.0.1 * Add an argument to ISRs. Disable interrupts while masking them. * sysparam: reserve one more flash sector before placing the sysparams. This is to help work with recent SDKs that add a RF cal sector by default in the fifth last sector - just so the sysparam sectors do not jump around when using different SDK versions. * upnp example: strip down the lwipopts.h file * sysparam editor: accept newline to end a line of input. * Add Wificfg. Uses the sysparam store to save the wifi configuration. Adds a basic http server for configuration. * lwip: disable the tcpip_core_locking_input option. With this option enabled some lwip input processing occurs in the pp task which works well for some uses but some code uses a lot of stack (e.g. mdns) and will overflow the pp task stask, or might unnecessarily slow the critical pp task, so disable this by default and if not already defined. * sdk_cnx_add_rc: fix overflow of the table, when no match is found. Also adds source code for sdk_cnx_rc_search, adding a null pointer dereference. Check (that is not expected to be seen), and source code for sdk_cnx_remove_rc. * http_get example: fix compilation with ipv6 disabled. * lwip: update to master branch. * wificfg: allow the AP channel to be 1. * lwip: rework the tcp ooseq handling. It now accounts for the number of rx pool buffers used and the available memory when deciding the number of ooseq buffers to retain. Enable the TCP Selective ACK support which appears to help a lot on lossy wifi when using the OOSEQ option. * Update lwip, fixes losses of pcbs and associated problems. * lwip: revise the tcp ooseq limit calulations. Was making a mess of the calculation sign. Also added a COPY_PP_RX_PBUFS define to include appropriate limits for this option. * lwip: ooseq_max_bytes() - set a practical target memory size. * lwip: revise ooseq handling. Modified for lwip backwards compatibility based on upstream feedback. * lwip: update to the 2.0.3 release * lwip: merge upstream master. * libc: update to upstream master. * lwip: fix building without TCP_QUEUE_OOSEQ |
||
---|---|---|
.. | ||
bmp180.c | ||
bmp180.h | ||
component.mk | ||
LICENSE | ||
README.md |
Driver for BMP085/BMP180 digital pressure sensor
This driver is written for usage with the ESP8266 and FreeRTOS (esp-open-rtos and esp-open-rtos-driver-i2c).
Usage
Before using the BMP180 module, the function bmp180_init(SCL_PIN, SDA_PIN)
needs to be called to setup the I2C interface and do validation if the BMP180/BMP085 is accessible.
If the setup is sucessfully and a measurement is triggered, the result of the measurement is provided to the user as an event send via the qQueue
provided with bmp180_trigger_*measurement(pQueue);
Example
#define SCL_PIN GPIO_ID_PIN(0)
#define SDA_PIN GPIO_ID_PIN(2)
...
if (!bmp180_init(SCL_PIN, SDA_PIN)) {
// An error occured, while dong the init (E.g device not found etc.)
}
// Trigger a measurement
bmp180_trigger_measurement(pQueue);
Change queue event
Per default the event send to the user via the provided queue is of the type bmp180_result_t
. As this might not always be desired, a way is provided so that the user can provide a function, which creates and sends the event via the provided queue.
As all data aqquired from the BMP180/BMP085 is provided to the bmp180_informUser
function, it is also possible to calculate new informations (E.g altitude etc.)
Example
// Own BMP180 User Inform Implementation
bool my_informUser(const QueueHandle_t* resultQueue, uint8_t cmd, bmp180_temp_t temperature, bmp180_press_t pressure) {
my_event_t ev;
ev.event_type = MY_EVT_BMP180;
ev.bmp180_data.cmd = cmd;
ev.bmp180_data.temperature = temperature;
ev.bmp180_data.pressure = pressure;
return (xQueueSend(*resultQueue, &ev, 0) == pdTRUE);
}
...
// Use our user inform implementation
// needs to be set before first measurement is triggered
bmp180_informUser = my_informUser;