Example : SPI

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.

summary

  • 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.

Data table

define LabelValueData contents
iPCMP_Cyc1000UPCMP Function call cycle 1000[ms]
iError_times3UPCMP Error times 3times
iCom_retry_num3USPI communication retry 3times
iSPI_CSD2Chip select pin
iSPI_MOSID11SPI MOSI pin
iSPI_MISOD12SPI MISO pin
iSPI_SCLKD13SPI CLK pin
iSPI_freq4000000USPI frequency
iSPI_bits8USPI frame 8 bit
iSPI_mode1USPI mode 1 ( Capture data on clock’s falling edge )
OSS-EC Site