• 大小: 3.17MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-20
  • 语言: 其他
  • 标签: LMH6401  

资源简介

LMH6401-SPI增益可调,根据评估板的时序写的模拟SPI, stm32程序.

资源截图

代码片段和文件信息


#include “LMH6401.h“
#include “spi.h“


uint8_t LMH6401_ReadID(void)
{
  uint8_t ID = 0;
  SPI_CS_ENABLE;                                 
  SPI_WriteByte(0X80);               
  ID = SPI_ReadByte();
  SPI_CS_DISABLE;                             
  return ID;
}

uint8_t LMH6401_ReadGain(void)//读取增益寄存器
{
  uint8_t GAIN = 0;
  SPI_CS_ENABLE;                                 
  SPI_WriteByte(0X82);               
  GAIN = SPI_ReadByte();
  SPI_CS_DISABLE;                             
  return GAIN;
}

void LMH6401_WriteGain(uint8_t gain)//写增益寄存器
{
SPI_CS_ENABLE;                                
  SPI_WriteByte(0X02);               
SPI_WriteByte(gain); 
  SPI_CS_DISABLE; 
}

void LMH6401_Gain_Add()//加增益
{
uint8_t gain;
gain = LMH6401_ReadGain();
if(0x00<=gain<=0x20)
LMH6401_WriteGain(gain+1);
}

void LMH6401_Gain_Dec()//减增益
{
uint8_t gain;
gain = LMH6401_ReadGain();
if(0x00<=gain<=0x20)
LMH6401_WriteGain(gain-1);
}



/**** Copyright (C)2016 strongerHuang. All Rights Reserved **** END OF FILE ****/

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-08-05 20:26  LMH6401-SPI\
     目录           0  2017-07-18 14:05  LMH6401-SPI\LMH6401-模拟SPI\
     目录           0  2017-07-18 13:23  LMH6401-SPI\LMH6401-模拟SPI\App\
     文件        1094  2017-07-18 13:19  LMH6401-SPI\LMH6401-模拟SPI\App\LMH6401.c
     文件         547  2017-07-18 13:21  LMH6401-SPI\LMH6401-模拟SPI\App\LMH6401.h
     文件        1487  2017-07-18 13:23  LMH6401-SPI\LMH6401-模拟SPI\App\main.c
     文件        3259  2016-07-29 12:00  LMH6401-SPI\LMH6401-模拟SPI\App\stm32f10x_conf.h
     文件        4594  2016-07-29 12:00  LMH6401-SPI\LMH6401-模拟SPI\App\stm32f10x_it.c
     文件        2086  2016-07-29 12:00  LMH6401-SPI\LMH6401-模拟SPI\App\stm32f10x_it.h
     目录           0  2017-07-18 14:05  LMH6401-SPI\LMH6401-模拟SPI\Bsp\
     文件        3226  2017-07-18 13:24  LMH6401-SPI\LMH6401-模拟SPI\Bsp\bsp.c
     文件        1184  2016-07-29 12:00  LMH6401-SPI\LMH6401-模拟SPI\Bsp\bsp.h
     文件        3650  2017-07-18 14:05  LMH6401-SPI\LMH6401-模拟SPI\Bsp\spi.c
     文件        1451  2017-07-18 13:21  LMH6401-SPI\LMH6401-模拟SPI\Bsp\spi.h
     文件        2283  2017-07-18 13:24  LMH6401-SPI\LMH6401-模拟SPI\Bsp\timer.c
     文件        1305  2016-07-29 12:00  LMH6401-SPI\LMH6401-模拟SPI\Bsp\timer.h
     文件        5156  2017-07-18 13:24  LMH6401-SPI\LMH6401-模拟SPI\Bsp\usart.c
     文件         962  2016-07-29 12:00  LMH6401-SPI\LMH6401-模拟SPI\Bsp\usart.h
     目录           0  2017-07-18 13:12  LMH6401-SPI\LMH6401-模拟SPI\Doc\
     文件          80  2017-07-18 13:12  LMH6401-SPI\LMH6401-模拟SPI\Doc\ReadMe.txt
     文件       36319  2017-07-18 13:23  LMH6401-SPI\LMH6401-模拟SPI\JlinkLog.txt
     文件         650  2017-07-12 10:29  LMH6401-SPI\LMH6401-模拟SPI\JlinkSettings.ini
     目录           0  2017-07-17 16:53  LMH6401-SPI\LMH6401-模拟SPI\Libraries\
     目录           0  2017-07-17 16:53  LMH6401-SPI\LMH6401-模拟SPI\Libraries\CMSIS\
     目录           0  2017-07-17 16:53  LMH6401-SPI\LMH6401-模拟SPI\Libraries\CMSIS\CoreSupport\
     文件       17273  2010-06-07 10:25  LMH6401-SPI\LMH6401-模拟SPI\Libraries\CMSIS\CoreSupport\core_cm3.c
     文件       85714  2011-02-09 14:59  LMH6401-SPI\LMH6401-模拟SPI\Libraries\CMSIS\CoreSupport\core_cm3.h
     文件        8331  2013-06-24 11:04  LMH6401-SPI\LMH6401-模拟SPI\Libraries\CMSIS\CoreSupport\stdint.h
     目录           0  2017-07-17 16:53  LMH6401-SPI\LMH6401-模拟SPI\Libraries\CMSIS\DeviceSupport\
     目录           0  2017-07-17 16:53  LMH6401-SPI\LMH6401-模拟SPI\Libraries\CMSIS\DeviceSupport\startup\
     文件       15766  2011-03-10 10:52  LMH6401-SPI\LMH6401-模拟SPI\Libraries\CMSIS\DeviceSupport\startup\startup_stm32f10x_cl.s
............此处省略122个文件信息

评论

共有 条评论

相关资源