• 大小: 311KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-16
  • 语言: 其他
  • 标签: WS2812  SPI+DMA  STM32  

资源简介

STM32通过硬件SPI+DMA方式驱动WS2812灯珠的驱动程序,其中移植了Adafruit_NeoPixel库函数可以实现多种显示效果。main函数中保留了各种样式的测试函数,只需在头文件中配置灯珠个数,将控制引脚接到PA7即可。目前测试过程中未发现明显bug,若有问题欢迎指出!

资源截图

代码片段和文件信息

#include “beep.h“


   

//初始化PE8为输出口.并使能这个口的时钟     
//蜂鸣器初始化
void BEEP_Init(void)
{
 
 GPIO_InitTypeDef  GPIO_InitStructure;
 
 RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOE ENABLE);  //使能GPIOE端口时钟
 
 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;  //BEEP-->PE.4 端口配置
 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;   //推挽输出
 GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;  //速度为50MHz
 GPIO_Init(GPIOE &GPIO_InitStructure);  //根据参数初始化GPIOE.4
 
 GPIO_ResetBits(GPIOEGPIO_Pin_2);//输出0,关闭蜂鸣器输出


}
void BEEP_Ring(uint16_t time) //蜂鸣器短鸣
{
GPIO_SetBits(GPIOEGPIO_Pin_2);  
delay_ms(time);
GPIO_ResetBits(GPIOEGPIO_Pin_2);
}


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        727  2017-04-19 15:47  stm32f103c8t6_ws281x_spi+dma\Board\beep\beep.c

     文件        236  2017-04-19 15:47  stm32f103c8t6_ws281x_spi+dma\Board\beep\beep.h

     文件       8863  2017-01-12 11:00  stm32f103c8t6_ws281x_spi+dma\Board\flash\flash.c

     文件       2238  2018-01-29 17:05  stm32f103c8t6_ws281x_spi+dma\Board\flash\flash.h

     文件       9018  2017-01-12 05:27  stm32f103c8t6_ws281x_spi+dma\Board\flash\新建文件夹\flash.c

     文件       1890  2016-11-18 15:27  stm32f103c8t6_ws281x_spi+dma\Board\flash\新建文件夹\flash.h

     文件        534  2018-10-18 15:27  stm32f103c8t6_ws281x_spi+dma\Board\HC-SR501\human_induction.c

     文件        382  2018-10-18 15:25  stm32f103c8t6_ws281x_spi+dma\Board\HC-SR501\human_induction.h

     文件       2914  2018-09-29 11:37  stm32f103c8t6_ws281x_spi+dma\Board\JSN-SR04T\jsn-sr04t.c

     文件        586  2018-09-29 11:37  stm32f103c8t6_ws281x_spi+dma\Board\JSN-SR04T\jsn-sr04t.h

     文件       2455  2017-02-18 15:00  stm32f103c8t6_ws281x_spi+dma\Board\key\key.c

     文件        610  2017-02-15 16:41  stm32f103c8t6_ws281x_spi+dma\Board\key\key.h

     文件        632  2016-11-25 18:30  stm32f103c8t6_ws281x_spi+dma\Board\led\led.c

     文件        249  2016-11-18 16:02  stm32f103c8t6_ws281x_spi+dma\Board\led\led.h

     文件       1571  2018-08-15 23:32  stm32f103c8t6_ws281x_spi+dma\Board\max6675\max6675.c

     文件        403  2018-08-15 23:27  stm32f103c8t6_ws281x_spi+dma\Board\max6675\max6675.h

     文件        524  2018-10-18 12:52  stm32f103c8t6_ws281x_spi+dma\Board\photoresistor\photoresistor.c

     文件        346  2018-10-18 16:03  stm32f103c8t6_ws281x_spi+dma\Board\photoresistor\photoresistor.h

     文件        567  2018-10-18 14:39  stm32f103c8t6_ws281x_spi+dma\Board\relay\relay.c

     文件        296  2018-10-19 09:55  stm32f103c8t6_ws281x_spi+dma\Board\relay\relay.h

     文件       6558  2018-10-28 10:05  stm32f103c8t6_ws281x_spi+dma\Board\ws2812\ws2812.c

     文件        934  2018-10-28 12:12  stm32f103c8t6_ws281x_spi+dma\Board\ws2812\ws2812.h

     文件        426  2018-01-29 15:57  stm32f103c8t6_ws281x_spi+dma\Chip\chip\chip.c

     文件       3287  2018-01-29 16:12  stm32f103c8t6_ws281x_spi+dma\Chip\chip\chip.h

     文件       1404  2016-11-17 10:22  stm32f103c8t6_ws281x_spi+dma\Chip\delay\delay.c

     文件        175  2018-01-29 16:33  stm32f103c8t6_ws281x_spi+dma\Chip\delay\delay.h

     文件       3023  2018-08-15 23:27  stm32f103c8t6_ws281x_spi+dma\Chip\spi\spi.c

     文件        237  2018-08-15 23:05  stm32f103c8t6_ws281x_spi+dma\Chip\spi\spi.h

     文件       6108  2018-10-18 10:19  stm32f103c8t6_ws281x_spi+dma\Chip\timer\timer.c

     文件        413  2018-01-29 16:39  stm32f103c8t6_ws281x_spi+dma\Chip\timer\timer.h

............此处省略107个文件信息

评论

共有 条评论