The following steps show you how to create GSDK4.3.1/EmberZnet 7.3.1.0 Z3Light example with BRD4186C+BRD4001A and use sl_iostream_write/sl_iostream_read to output/read data to/from USART1 to EXP header pin11(RX PA06)/p13(TX PA07).
1. Add exp instance from software component
2. Add the following code to main.c
- #include "sl_iostream.h"
- sl_iostream_t * exp_iostream = NULL;
- uint8_t rbuffer[128];
- size_t bread;
-
- void app_init(void)
- {
- exp_iostream = sl_iostream_get_handle("exp");
- }
-
- void app_process_action(void)
- {
- sl_iostream_read(exp_iostream,rbuffer,128,&bread);
- if(bread>0){
- sl_iostream_write(exp_iostream,rbuffer,bread);
- }
- }
3. Build and run the example.
No comments:
Post a Comment