The Raspberry Pi 4 was once sold at sky-high prices, becoming a financial product, while domestic “similar products” have sprung up like mushrooms after rain, with many domestic Pi alternatives emerging.
Raspberry Pi 3B Alternative BIGTREETECH PI Development Board
Raspberry Pi 3B Alternative BIGTREETECH PI Development Board
Unboxing Review
Graphics Card Performance Test
-
Check Audio Devices
-
Play Music
-
Control Audio Volume
USB Camera Test
CAN Transceiver Test
SPI Transceiver Test
Testing Game Play
Connecting to Smart Hub via MQTT
Edge Detection and Video Streaming (zmj)
Bear Pi Foldable Development Board BearPi-HM Micro
Bear Pi Foldable Development Board BearPi-HM Micro
Unboxing Review
Serial Interaction Output
import("//build/lite/config/component/lite_component.gni")
executable("generated_library_name") { output_name = "executable_file_name" sources = [ "source_file" ] include_dirs = [] defines = [] cflags_c = [] ldflags = []}
lite_component("lite_component_name") { features = [ ":library_file", ]}
Using HDF Driver Framework to Implement LED Blinking
int32_t LedDriverDispatch(struct HdfDeviceIoClient *client, int cmdCode, struct HdfSBuf *data, struct HdfSBuf *reply){ uint8_t contrl; HDF_LOGE("Led driver dispatch"); if (client == NULL || client->device == NULL) { HDF_LOGE("Led driver device is NULL"); return HDF_ERR_INVALID_OBJECT; }
switch (cmdCode) { /* Receive LED_WRITE_READ command sent from user space */ case LED_WRITE_READ: /* Read data from data and assign to contrl */ HdfSbufReadUint8(data,&contrl); switch (contrl) { /* Turn on light */ case LED_ON: GpioWrite(g_Stm32Mp1ILed.gpioNum, GPIO_VAL_LOW); status = 1; break; /* Turn off light */ case LED_OFF: GpioWrite(g_Stm32Mp1ILed.gpioNum, GPIO_VAL_HIGH); status = 0; break; /* Toggle status */ case LED_TOGGLE: if(status == 0) { GpioWrite(g_Stm32Mp1ILed.gpioNum, GPIO_VAL_LOW); status = 1; } else { GpioWrite(g_Stm32Mp1ILed.gpioNum, GPIO_VAL_HIGH); status = 0; } break; default: break; } /* Write the LED status value to reply, which can be brought to the user program */ if (!HdfSbufWriteInt32(reply, status)) { HDF_LOGE("replay is fail"); return HDF_FAILURE; } break; default: break; } return HDF_SUCCESS;}
Trial Summary
Leave a Comment
Your email address will not be published. Required fields are marked *