MSPM0 SMBus Library User’s Guide¶
1. Introduction¶
The MSPM0 SMBus Library provides a simple way to start development of SMBus applications using MSPM0 devices.
2. SMBus Library Supported Features¶
This library was developed in compliance with the SMBus 3.2 specification.
2.1 SMBus Controller Supported Features¶
Clock Timeout detection
PEC
Quick command
Send Byte
Receive Byte
Write byte/word (support for 16bit, 32bit, and 64bit words)
Read byte/word (support for 16bit, 32bit, and 64bit words)
Process call
Block read/write (up to 255 bytes)
Block write-block read process call (up to 255 bytes)
Host notify protocol
2.2 SMBus Target Supported Features¶
Multiple target addresses
Clock Timeout detection
PEC
Quick command (only write is supported)
Send Byte
Receive Byte
Write byte/word (support for 16bit, 32bit, and 64bit words)
Read byte/word (support for 16bit, 32bit, and 64bit words)
Process call
Block read/write (up to 255 bytes)
Block write-block read process call (up to 255 bytes)
Host notify protocol
2.3 SMBus Features Not Currently Implemented¶
The SMBus features listed below are supported in hardware but have not been implemented in this release:
FastMode+ 1MHz operation
Address resolution protocol
SMBAlert#
SMBSUS#
3. SMBus Example Usage¶
This software library contains 4 examples that demonstrate communication between a SMBus Controller and SMBus Target:
Target:
smb_target00_all_protocols: shows the implementation of all basic SMBus protocols
smbus_target_host_notify: shows implementation of host notify protocol
Controller:
smb_controller00_all_protocols: shows the implementation of all basic SMBus protocols
smbus_controller_host_notify: shows implementation of host notify protocol
Each example contains source code which can be compiled and loaded onto a supported device as-is. Connect SMBCLK and SMBDAT on 2 devices running the Controller and Target examples.
3.1 SMBus Examples Supported Hardware¶
LP-MSPM0L1306 LaunchPad evaluation boards
LP-MSPM0G3507 LaunchPad evaluation boards
4. SMBus Library API Guide¶
Details about the SMBus Library APIs can be found in the SMBus Library API Guide
5. Library Footprint¶
The following footprint was obtained with TI Arm Clang compiler v3.2.1 LTS using LP-MSPM0G3507.
SMBus Controller¶
Example |
Module |
Optimization Level |
Code (bytes) |
Const (bytes) |
RAM (bytes) |
Options |
---|---|---|---|---|---|---|
smb_controller00_all_protocols |
Total |
-O2 |
3912 |
469 |
1086 |
SMB_CONTROLLER_SUPPORTS_HOST_NOTIFY = true |
“ |
smbus_nwk.o |
“ |
1286 |
0 |
0 |
“ |
“ |
smbus_phy.o |
“ |
948 |
0 |
0 |
“ |
“ |
smbus.o |
“ |
572 |
0 |
0 |
“ |
“ |
dl_i2c.o |
“ |
192 |
0 |
0 |
“ |
smb_controller00_all_protocols |
Total |
-Oz -flto* |
3236 |
493 |
1088 |
SMB_CONTROLLER_SUPPORTS_HOST_NOTIFY = true |
smb_controller00_all_protocols |
Total |
-O2 |
3272 |
469 |
1086 |
SMB_CONTROLLER_SUPPORTS_HOST_NOTIFY = false |
“ |
smbus_nwk.o |
“ |
804 |
0 |
0 |
“ |
“ |
smbus_phy.o |
“ |
790 |
0 |
0 |
“ |
“ |
smbus.o |
“ |
572 |
0 |
0 |
“ |
“ |
dl_i2c.o |
“ |
192 |
0 |
0 |
“ |
smb_controller00_all_protocols |
Total |
-Oz -flto* |
2714 |
493 |
1088 |
SMB_CONTROLLER_SUPPORTS_HOST_NOTIFY = false |
smb_controller_host_notify |
Total |
-O2 |
3702 |
239 |
826 |
SMB_CONTROLLER_SUPPORTS_HOST_NOTIFY = true |
“ |
smbus_nwk.o |
“ |
1168 |
0 |
0 |
“ |
“ |
smbus_phy.o |
“ |
968 |
0 |
0 |
“ |
“ |
smbus.o |
“ |
228 |
0 |
0 |
“ |
“ |
dl_i2c.o |
“ |
192 |
0 |
0 |
“ |
smb_controller_host_notify |
Total |
-Oz -flto* |
2962 |
219 |
827 |
SMB_CONTROLLER_SUPPORTS_HOST_NOTIFY = true |
Note: Individual modules are not shown for LTO optimization since the linker optimizes modules and might skip them in .map file.
SMBus Target¶
Example |
Module |
Optimization Level |
Code (bytes) |
Const (bytes) |
RAM (bytes) |
Options |
---|---|---|---|---|---|---|
smb_target00_all_protocols |
Total |
-O2 |
5320 |
387 |
1343 |
SMB_TARGET_SUPPORTS_HOST_NOTIFY = true |
“ |
smbus_nwk.o |
“ |
1070 |
0 |
0 |
“ |
“ |
smbus_phy.o |
“ |
900 |
0 |
0 |
“ |
“ |
smbus.o |
“ |
252 |
0 |
0 |
“ |
“ |
dl_i2c.o |
“ |
228 |
0 |
0 |
“ |
smb_target00_all_protocols |
Total |
-Oz -flto* |
3908 |
387 |
1346 |
SMB_TARGET_SUPPORTS_HOST_NOTIFY = true |
smb_target00_all_protocols |
Total |
-O2 |
4508 |
387 |
1343 |
SMB_TARGET_SUPPORTS_HOST_NOTIFY = false |
“ |
smbus_nwk.o |
“ |
716 |
0 |
0 |
“ |
“ |
smbus_phy.o |
“ |
536 |
0 |
0 |
“ |
“ |
smbus.o |
“ |
252 |
0 |
0 |
“ |
“ |
dl_i2c.o |
“ |
134 |
0 |
0 |
“ |
smb_target00_all_protocols |
Total |
-Oz -flto* |
3266 |
387 |
1346 |
SMB_TARGET_SUPPORTS_HOST_NOTIFY = false |
smb_target_host_notify |
Total |
-O2 |
4110 |
245 |
1080 |
SMB_TARGET_SUPPORTS_HOST_NOTIFY = true |
“ |
smbus_nwk.o |
“ |
1142 |
0 |
0 |
“ |
“ |
smbus_phy.o |
“ |
1124 |
0 |
0 |
“ |
“ |
smbus.o |
“ |
262 |
0 |
0 |
“ |
“ |
dl_i2c.o |
“ |
288 |
0 |
0 |
“ |
smb_target_host_notify |
Total |
-Oz -flto* |
4110 |
245 |
1080 |
SMB_TARGET_SUPPORTS_HOST_NOTIFY = true |
Note: Individual modules are not shown for LTO optimization since the linker optimizes modules and might skip them in .map file.
6. Library Versions¶
Version 2.00.00.00
SDK Release: 2.00.00.xx
Updates:
Fix Target PEC check. Device will NACK if PEC is incorrect and detect if PEC is missing. This feature causes a compatibility break.
Version 1.30.00.01
SDK Release: 1.30.00.xx
Updates:
Added target reset function.
Added manual ACK support and modified ISR handling to avoid race condition issue with multiple interrupt flags.
Updated examples to use LED for error detection.
Added case to handle Controller TX flag when idle.
Added SW timeout to avoid lockup while polling flag.
Added compiler flags for Host Alert functionality.
Version 1.20.00.01
SDK Release: 1.20.00.xx
Updates:
Updated code examples to use I2C BoosterPack pins.
Renamed existing SMBus examples to *00_all_protocols.
Added SMBus Host Alert for Controller and Target with corresponding examples.
Fixed some incorrect pins in the SMBus READMEs.
Version 1.10.00.00
SDK Release: 1.10.00.xx
Updates:
Updated SMBus library to replace SW PEC with HW PEC.
Version 1.00.00.00
SDK Release: 1.00.00.xx
Updates:
Initial release.
6.1 Upgrade and Compatibility Information¶
Version 2.00.00.00
Application must now report command length to SMBus drivers when enabling PEC.
The application should call
SMBus_targetReportBlock
and/orSMBus_targetReportLength
when the SMBus is inSMBus_State_Target_FirstByte
state. See SMBus target examples for a sample implementation.
SMBus Target PEC error interrupt should be disabled. This flag is checked manually by the library during reception.
When using SysConfig, this option can be disabled at Interrupt Configuration → Target Interrupts.