UM2264
IO wakeup: demonstrates device wakeup from standby mode using the GPIO interrupt.
The PUSH1 button (IO13) is configured to generate the interrupt event on both edges
of the input signal. LED DL2 is toggled, the system becomes active and LED DL1 is
toggled by the systick interrupt service routine every 500 ms.
Once the device is in standby, there is no way to open a connection with the debug tool or
download new code as the clocks are down and the system voltages are at their minimum
values. It is necessary to wake-up the system first, which is why the IO9 (SDW clock
signal) is wake-up event. In this case, any connection attempt from the debugger wakes up
the system.
15.3
I²C examples
In all of the following examples, I²C is configured in master mode and its clock frequency is
set to 10 kHz.
Master polling: I²C communication is controlled by polling the I²C status register content.
This example involves a master board with Master_Polling firmware code and a slave
board with Slave_Polling firmware.
The Master board has a small command line interface through UART (USB-to-SERIAL
must be connected to the PC), which you can use to read and change the LED status of
the slave board. I²C is used to transfer the information and change the status of the LEDs
on the slave board.
Slave polling: I²C communication is controlled by polling the I²C status register content.
This also involves a master and a slave board with respective Master_Polling and
Slave_Polling firmware. The slave board receives read and change requests for the LEDs
via I²C.
Master sensor: I²C communication is controlled by polling of I²C status register content,
interrupts or DMA (three different configurations). In this example, the environmental
sensor LPS25HB is configured to provide output data at 1 Hz. The BlueNRG-1 polls the
status register of the sensor and prints available pressure and temperature data via UART
(USB-to-SERIAL must be connected to the PC).
15.4
Micro examples
Hello world: example for the basic 'BlueNRG-1 Hello World' application. Connect the
BlueNRG-1 platform to a PC USB port and open a specific PC tool/program (like Tera
Term): the "Hello World: BlueNRG-1 is here!" message is displayed.
Sleep test: this test provides an example for the following BlueNRG-1 sleep modes:
SLEEPMODE_WAKETIMER places the BlueNRG-1 in deep sleep with the timer clock
sources running. The wakeup sources are typing any character on the keyboard, the
PUSH1 button or the sleep timer configured with a timeout of 5 s.
The SLEEPMODE_NOTIMER places the BlurNRG-1 in deep sleep with the sleep
timer clock sources turned off. The only wakeup sources are typing any character on
the keyboard and the PUSH1 button.
The demo supports some user commands:
s: SLEEPMODE_NOTIMER - wake on UART/PUSH1
t: SLEEPMODE_WAKETIMER - wake on UART/timeout 5 s/PUSH1
l: Toggle led DL1
p: Print the 'Hello World' message
r: Reset the BlueNRG-1 device
?: Display this help menu
DocID030868 Rev 1
BlueNRG-1 peripheral driver examples
43/55
Need help?
Do you have a question about the STEVAL-IDB007V1M SPBTLE-1S and is the answer not in the manual?