资源简介
STM8 SPI从机通讯程序,调试通过,直接可用。

代码片段和文件信息
/**
******************************************************************************
* @file GPIO_IOToggle_PollingMode\main.c
* @brief This file contains the main function for GPIO IOToggle_PollingMode example.
* @author STMicroelectronics - MCD Application Team
* @version V1.1.0
* @date 02/27/2009
******************************************************************************
*
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
* TIME. AS A RESULT STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
* DIRECT INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*
* © COPYRIGHT 2009 STMicroelectronics
* @image html logo.bmp
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include “stm8s.h“
#include “define.h“
#include “stm8s_gpio.h“
#include “stm8s_tim4.h“
#include “spi_slave.h“
/* Private macro -------------------------------------------------------------*/
//#define countof(a) (sizeof(a) / sizeof(*(a)))
//#define BufferSize (countof(Tx_Buffer))
/**
* @addtogroup IOToggle_PollingMode
* @{
*/
/* Private function prototypes -----------------------------------------------*/
void Delay (u16 nCount);
/* Private functions ---------------------------------------------------------*/
void Delay(u16 nCount)
{
/* Decrement nCount value */
while (nCount != 0)
{
nCount--;
}
}
/* Public functions ----------------------------------------------------------*/
/**
* @brief Example firmware main entry point.
* @par Parameters:
* None
* @retval void None
* @par Required preconditions:
* None
* @par Library functions called:
* - GPIO_Init()
* - GPIO_ReadInputData()
* - GPIO_WriteHigh()
* - GPIO_WriteLow()
*/
u8 spidata;
u8 i;
void main(void)
{
//悬浮输入
GPIO_Init(SPI_CS_PORT SPI_CS GPIO_MODE_IN_FL_NO_IT );
SPI_SLAVE_Init(); /* SPI初始化*/
i=1;
while (1)
{
//spidata=SPI_SLAVE_SendByte(8);/*必须要先发一个随机数目的让SPI能进中断*/
//Delay(100);
spidata=SPI_SLAVE_SendByte(i);/*必须要先发一个随机数目的让SPI能进中断*/
}
}
/**
* @brief Reports the name of the source file and the source line number where
* the assert error has occurred.
* User can add his own implementation to report the file name and line number.
* ex: printf(“Wrong parameters value: file %s on line %d\r\n“ file line)
* @retval void None
* @par Required preconditions:
* None
* @par Called functions:
* None
*/
#ifdef FULL_ASSERT
void assert_failed(u8 *file u16 line)
#else
void assert_failed(v
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1954 2015-03-23 13:46 STM_SPI_SLAVE\stm8_interrupt_vector.c
文件 292 2015-03-20 16:03 STM_SPI_SLAVE\checkres.spy
文件 1794 2015-03-27 10:59 STM_SPI_SLAVE\wirestm.dep
文件 13153 2015-03-20 16:03 STM_SPI_SLAVE\wirestm.stp
文件 203 2015-03-27 10:59 STM_SPI_SLAVE\WireSTM.stw
文件 906 2015-03-27 10:30 STM_SPI_SLAVE\wirestm.pdb
文件 96842 2009-03-02 10:00 STM_SPI_SLAVE\library\inc\stm8s.h
文件 13654 2009-03-02 10:00 STM_SPI_SLAVE\library\inc\stm8s_adc1.h
文件 11029 2009-03-02 10:00 STM_SPI_SLAVE\library\inc\stm8s_adc2.h
文件 4873 2009-03-02 10:00 STM_SPI_SLAVE\library\inc\stm8s_awu.h
文件 3474 2009-03-02 10:00 STM_SPI_SLAVE\library\inc\stm8s_beep.h
文件 24992 2009-03-02 10:00 STM_SPI_SLAVE\library\inc\stm8s_can.h
文件 17672 2009-03-02 10:00 STM_SPI_SLAVE\library\inc\stm8s_clk.h
文件 4566 2009-03-02 10:00 STM_SPI_SLAVE\library\inc\stm8s_exti.h
文件 12201 2009-03-02 10:00 STM_SPI_SLAVE\library\inc\stm8s_flash.h
文件 6289 2009-03-02 10:00 STM_SPI_SLAVE\library\inc\stm8s_gpio.h
文件 15333 2009-03-02 10:00 STM_SPI_SLAVE\library\inc\stm8s_i2c.h
文件 5008 2009-03-02 10:00 STM_SPI_SLAVE\library\inc\stm8s_itc.h
文件 4580 2009-03-02 10:00 STM_SPI_SLAVE\library\inc\stm8s_iwdg.h
文件 2809 2009-03-02 10:00 STM_SPI_SLAVE\library\inc\stm8s_rst.h
文件 12769 2009-03-02 10:00 STM_SPI_SLAVE\library\inc\stm8s_spi.h
文件 24970 2009-03-02 10:00 STM_SPI_SLAVE\library\inc\stm8s_tim1.h
文件 13568 2009-03-02 10:00 STM_SPI_SLAVE\library\inc\stm8s_tim2.h
文件 12475 2009-03-02 10:00 STM_SPI_SLAVE\library\inc\stm8s_tim3.h
文件 5133 2009-03-02 10:00 STM_SPI_SLAVE\library\inc\stm8s_tim4.h
文件 18985 2009-03-02 10:00 STM_SPI_SLAVE\library\inc\stm8s_tim5.h
文件 9165 2009-03-02 10:00 STM_SPI_SLAVE\library\inc\stm8s_tim6.h
文件 3453 2009-03-02 10:00 STM_SPI_SLAVE\library\inc\stm8s_type.h
文件 15112 2009-03-02 10:00 STM_SPI_SLAVE\library\inc\stm8s_uart1.h
文件 17364 2009-03-02 10:00 STM_SPI_SLAVE\library\inc\stm8s_uart2.h
............此处省略68个文件信息
相关资源
- Spire API文档
- The direction of synaptic plasticity mediated
- 飞思卡尔单片机MC9S12XS12G128驱动(硬件
- 51模拟SPI读写SD卡(包括Fat和Fat32文件
- 28335写的用spi读取传感器数据并用CA
- STM32F103 CC2500完整驱动(模拟SPI)
- 手机短信api接口(源代码)
- cs5530的SPI程序
- 9s12单片机SPI功能代码
- stm32 用SPI 方式读写 SDHC
- 意法半导体STM全系列微控制器STM32ST
- SPI Master 的Verilog源代码
- STM8S SX1278 项目和源代码
- Spire.Doc 破解版
- Spin-1目标的广义parton分布的多项式和
- 介子和S波氘核的四极矩以及对spin-1系
- 基于SPCE061A和PTR8000的模拟SPI总线通信
- 用8位spi实现16位spi
- linux SPI设备注册和驱动小结
- 用Verilog语言写的CPLD和MCU通讯的SPI接口
- STM8S003 红外遥控
- STM8S例程,基于IAR下的STM8S例程
- Spirent iTest用户手册详细介绍iTest的各
- 精确结果为3d N $$ \\ mathcal {N} $$ = 2 S
- 从Poincaré代数的闭合中得
- Temperature dependence of electron-spin cohere
- 基于STM8的HT1621B显示驱动程序
- STM8驱动HT1621B
- QCD中三个循环处的Spin-2形状因子
- STM32分别以串口硬件SPI模拟并口驱动
评论
共有 条评论