Broadcom AFBR-S50-PG100
3
AFBR-S50 SDK Programming Guide Porting Guide to a Cortex-M4
Table of Contents
Chapter 1: Introduction ......................................................................................................................5
1.1 AFBR-S50MV85G-EK Evaluation Kit Software.......................................................................................................5
Chapter 2: Phase 1: Installing and Preparing the IDE .....................................................................6
Step 1. Downloading and Installing the IDE .......................................................................................................6
Step 2. Defining the Workspace .........................................................................................................................6
Step 3. Creating a Native Project .......................................................................................................................6
2.1 File Structure.............................................................................................................................................................9
Step 4. Creating the File Structure ...................................................................................................................10
Chapter 3: Phase 2: Addition of the MCU Devices with the IDE .................................................. 12
Step 5. Opening the Device Configuration Tool in the IDE...............................................................................12
3.1 Clock Configuration................................................................................................................................................12
3.2 S2PI (= SPI + GPIO) Layer ......................................................................................................................................13
Step 6. SPI Basic Setup ...................................................................................................................................13
Step 7. SPI DMA Setup ....................................................................................................................................16
Step 8. NSS/IRQ GPIO Setup..........................................................................................................................16
3.3 Timer Layer..............................................................................................................................................................19
3.3.1 Lifetime Counter (LTC) ...................................................................................................................................19
Step 9. Setting Up the First LTC Timer.............................................................................................................20
Step 10. Setting Up the Second LTC Timer .....................................................................................................22
3.3.2 Periodic Interrupt Timer (PIT) .........................................................................................................................23
3.4 Optional: UART .......................................................................................................................................................24
3.5 Interrupt Configuration...........................................................................................................................................26
Step 11. Configuring the Interrupts in the IDE..................................................................................................27
3.6 Code Generation.....................................................................................................................................................28
Step 12. Setting the Code Generation Options ................................................................................................29
Step 13. Performing the Code Generation .......................................................................................................30
Chapter 4: Adapting the Generated Data to the Argus API .......................................................... 33
Step 14. Adding the Required Include Paths....................................................................................................33
Step 15. Adding the AFBR-S50 Library............................................................................................................34
4.1 IRQ API.....................................................................................................................................................................35
Step 16. Creation of the IRQ File......................................................................................................................35
Step 17. Implementing the IRQ Locking...........................................................................................................35
4.2 S2PI API ...................................................................................................................................................................36
Step 18. Creation of the S2PI File....................................................................................................................36
Step 19. Adding the S2PI Includes...................................................................................................................36
Step 20. Implementing the S2PI Data Structures.............................................................................................37
Step 21. Implementing the S2PI Initialization...................................................................................................38