SLAAEL9 October   2024 MSPM0C1104 , MSPM0L1306

 

  1.   1
  2. 1Description
  3. 2Required Peripherals
  4. 3Compatible Devices
  5. 4Hardware Setup
  6. 5Software Introduction
    1. 5.1 Code Introduction
    2. 5.2 Protocol Introduction
  7. 6Design Steps
  8. 7Results
  9. 8Trademarks

Code Introduction

Figure 5-2 shows the main function code in this design. The main function initializes the system configuration and then enters a loop to handle IO control. The code supports three functions for IO control: gpioDirectionSet, gpioOutputCtl, and gpioStateRead. See also Protocol Introduction.

MSPM0 Main Function Figure 5-2 Main Function

UART, I2C, and SPI are enabled by default. Uncomment the definition in the expander.h file for real implementation, as Figure 5-3 shows.

MSPM0 Communication Enable and
          Disable Figure 5-3 Communication Enable and Disable

All the communication command reception is done in the relative interrupts. Using UART, command transmission is done in the gpioStateRead() function. Command transmission is done in the relative interrupts for SPI and I2C.