Design of SPI driver based on ARM embedded system

Publisher:MagicGardenLatest update time:2021-02-02 Source: eefocusKeywords:ARM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere


The specific process of the write operation is shown in Figure 1. First, the user data is converted from the space state to the kernel state, and the corresponding receive flag is set. Then the data size is determined. If the data is larger than the buffer space, the data overflows and the write operation ends; if there is no overflow, in order to ensure the data between processes, the process obtains the spin lock, and then determines whether the buffer is empty. According to the introduction of the above two functions, different functions are called in different situations. After the data is written into the ring buffer, the data is sent to the SPI transmit register. When the SPI transmit register sends data, the ring buffer still receives data. If the buffer is full at this time, the spin lock is released, and the process wait flag (wait_Tx_done) is set to put the process to sleep until the data in the transmit register is sent. Then wake up the process to determine whether all the data has been sent. If there is still data waiting to be sent, copy_to_Tx_buf_int is called; if all the data has been sent, the write operation ends. If the buffer is not full, it is determined whether the data has been sent. When all the data has been sent, the send operation ends.


[1] [2]
Keywords:ARM Reference address:Design of SPI driver based on ARM embedded system

Previous article:Introducing the interrupt masking method of the ARM7 core
Next article:Introduction to ARM technology to modify the simulation parameters of D1N4002

Recommended ReadingLatest update time:2024-11-16 04:23

ARM processor system initialization programming considerations
There are two points to note during the system initialization process. If not handled properly, the program may run away. 1) If you need to move the program from flash to DRAM for execution In modern embedded systems, since the speed of DRAM is much faster than that of flash, most embedded systems move the program fr
[Microcontroller]
Keil (MDK-ARM) User Tutorial (II)_Menu
I. Overview Following the previous article, I will summarize the contents related to the Keil (MDK-ARM) menu. Please read on for details.   The content of this article can be found in my other blog, which has been updated and more detailed: http://blog.csdn.net/ybhuangfugui/article/details/51689271   I have made a d
[Microcontroller]
Keil (MDK-ARM) User Tutorial (II)_Menu
STM32 SPI2 read W25Q128 driver
//SPI1 reads and writes a byte //TxData: Bytes to be written //Return value: the bytes read u8 SPI2_ReadWriteByte(u8 TxData) {     while (SPI_I2S_GetFlagStatus(SPI2, SPI_I2S_FLAG_TXE) == RESET){}//Wait for the send area to be empty   SPI_I2S_SendData(SPI2, TxData); //Send a byte of data through peripheral SPIx   while
[Microcontroller]
Configuration of J-Flash ARM
Generally speaking, you will find some *.jflash configuration files in file-->open project, and you can just load them, but I didn't find any suitable for S3C2440. So I built a MINI2440.jflash and configured it manually: j-link settings 1. Open J-Flash ARM and enter the menu: Options-- Project settings 2. Mainly set
[Microcontroller]
【ARM】Cortex-M3 exception system
When the CM3 kernel is working normally, it executes instructions in sequence. When an exception or interrupt occurs, the action being executed will be interrupted and the service program for the exception or interrupt will be executed. The abnormal system has the function of ensuring the safety and robustness of CM
[Microcontroller]
【ARM】Cortex-M3 exception system
ARM Getting Started (I) Concepts
    Figure 1 1) ARM, what is ARMv6           (1) SoC (System on a Chip): A complete system including a CPU, controller, and peripheral circuits integrated on a single chip         (2) ARM is the CPU in the SoC, and ARMv6 is the architecture used by this CPU            For example, S3C6410X is a SoC chip
[Microcontroller]
ARM Getting Started (I) Concepts
Microsoft and Arm collaborate to provide cloud-to-edge AI toolchain
The following is from Microsoft's official blog Microsoft is committed to making digital transformation easy, fast and cost-effective for our customers. We believe that software is the foundation of intelligent devices and an essential component of all intelligent devices. At the core of our strategy in the silicon
[Internet of Things]
Simple project template for LPC2220 based on gnu-arm-linux
1: Source When we learn ARM embedded development, we usually come into contact with ADS1.2 and kei project templates. These templates are a blessing for beginners, but if you want to learn more about the chip startup process, When it comes to compiling and linking, image file structure, how to initialize,
[Microcontroller]
Simple project template for LPC2220 based on gnu-arm-linux
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components
Guess you like
    502 Bad Gateway

    502 Bad Gateway


    openresty

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号