SPI components of OSS-EC
In this section, we will use the OSS-EC SPI component as an example.
Intended use scenarios
After power is turned on, the temperature is obtained from the temperature sensor via SPI communication. If the temperature exceeds the upper or lower limit, it judges NG and stops acquiring temperature and Sleep.
- The software architecture of the OSS-EC is configured to pair with the hardware architecture of the SPI component, as shown in ( fig. 1 ).
- The state of an I2C component is changed by a command from the application as shown in ( fig.2).
- The interface between the application and PCMP is the argument structure cmd and the return value structure res, as shown in ( fig.3 ).
- Command sequence ( fig.4 ).
- Data table
Blue label characters are data related to Application & circuit & MPU.
|define Label||Value||Data contents|
|iPCMP_Cyc||1000U||PCMP Function call cycle 1000[ms]|
|iError_times||3U||PCMP Error times 3times|
|iCom_retry_num||3U||SPI communication retry 3times|
|iSPI_CS||D2||Chip select pin|
|iSPI_MOSI||D11||SPI MOSI pin|
|iSPI_MISO||D12||SPI MISO pin|
|iSPI_SCLK||D13||SPI CLK pin|
|iSPI_bits||8U||SPI frame 8 bit|
|iSPI_mode||1U||SPI mode 1 ( Capture data on clock’s falling edge )|