mirror of
https://github.com/Fishwaldo/bl_mcu_sdk.git
synced 2025-07-16 01:38:52 +00:00
[update] update lhal, soc and demos
* Add flash driver and init in boards. * Add timeout for all poll wait apis * Add 808 d0 startup to bringup * Update lhal device tables * Update demos
This commit is contained in:
parent
9f241971e3
commit
d6fab307bf
232 changed files with 26802 additions and 1471 deletions
|
@ -0,0 +1,9 @@
|
|||
cmake_minimum_required(VERSION 3.15)
|
||||
|
||||
include(proj.conf)
|
||||
|
||||
find_package(bouffalo_sdk REQUIRED HINTS $ENV{BL_SDK_BASE})
|
||||
|
||||
sdk_set_main_file(main.c)
|
||||
|
||||
project(gpio_input_output)
|
13
examples/peripherals/gpio/gpio_input_output/Makefile
Normal file
13
examples/peripherals/gpio/gpio_input_output/Makefile
Normal file
|
@ -0,0 +1,13 @@
|
|||
SDK_DEMO_PATH ?= .
|
||||
BL_SDK_BASE ?= $(SDK_DEMO_PATH)/../../../..
|
||||
|
||||
export BL_SDK_BASE
|
||||
|
||||
CHIP ?= bl616
|
||||
BOARD ?= bl616dk
|
||||
CROSS_COMPILE ?= riscv64-unknown-elf-
|
||||
|
||||
# add custom cmake definition
|
||||
#cmake_definition+=-Dxxx=sss
|
||||
|
||||
include $(BL_SDK_BASE)/project.build
|
25
examples/peripherals/gpio/gpio_input_output/main.c
Normal file
25
examples/peripherals/gpio/gpio_input_output/main.c
Normal file
|
@ -0,0 +1,25 @@
|
|||
#include "bflb_gpio.h"
|
||||
|
||||
struct bflb_device_s *gpio;
|
||||
|
||||
extern void board_init(void);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
board_init();
|
||||
|
||||
gpio = bflb_device_get_by_name("gpio");
|
||||
printf("gpio output\r\n");
|
||||
bflb_gpio_init(gpio, GPIO_PIN_0, GPIO_OUTPUT | GPIO_PULLUP | GPIO_SMT_EN | GPIO_DRV_0);
|
||||
bflb_gpio_init(gpio, GPIO_PIN_1, GPIO_INPUT | GPIO_PULLUP | GPIO_SMT_EN | GPIO_DRV_0);
|
||||
|
||||
while (1) {
|
||||
bflb_gpio_set(gpio, GPIO_PIN_0);
|
||||
printf("GPIO_PIN_1=%x\r\n", bflb_gpio_read(gpio, GPIO_PIN_1));
|
||||
bflb_mtimer_delay_ms(2000);
|
||||
|
||||
bflb_gpio_reset(gpio, GPIO_PIN_0);
|
||||
printf("GPIO_PIN_1=%x\r\n", bflb_gpio_read(gpio, GPIO_PIN_1));
|
||||
bflb_mtimer_delay_ms(2000);
|
||||
}
|
||||
}
|
1
examples/peripherals/gpio/gpio_input_output/proj.conf
Normal file
1
examples/peripherals/gpio/gpio_input_output/proj.conf
Normal file
|
@ -0,0 +1 @@
|
|||
set(CONFIG_COMPONENT1 1)
|
Loading…
Add table
Add a link
Reference in a new issue