瀏覽代碼

ref: change project structure and remove charge_ctrl dir; split code into separate src files

namrota ghosh 9 月之前
父節點
當前提交
5694b961a5
共有 88 個文件被更改,包括 1819 次插入1567 次删除
  1. 0 0
      .ccsproject
  2. 0 0
      .clangd
  3. 0 0
      .cproject
  4. 2 0
      .gitignore
  5. 0 0
      .project
  6. 0 0
      .settings/org.eclipse.cdt.codan.core.prefs
  7. 0 0
      .settings/org.eclipse.core.resources.prefs
  8. 二進制
      Debug/.clangd/.cache/clangd/index/adc.c.C783CB560A28832A.idx
  9. 二進制
      Debug/.clangd/.cache/clangd/index/adc.h.4254346EB7A93BD8.idx
  10. 二進制
      Debug/.clangd/.cache/clangd/index/battery.c.900D8F73FDE164C8.idx
  11. 二進制
      Debug/.clangd/.cache/clangd/index/battery.h.DD363DA997E60BB9.idx
  12. 0 0
      Debug/.clangd/.cache/clangd/index/dac.c.91713AFCB5D40D6E.idx
  13. 0 0
      Debug/.clangd/.cache/clangd/index/dac.h.D233D18DB68C8427.idx
  14. 0 0
      Debug/.clangd/.cache/clangd/index/i2c_comm_controller.c.203F8B33309E2B48.idx
  15. 0 0
      Debug/.clangd/.cache/clangd/index/i2c_comm_controller.h.8DD4C36B9014EBE6.idx
  16. 二進制
      Debug/.clangd/.cache/clangd/index/i2c_controller.c.D084D0AF1C0F98F4.idx
  17. 二進制
      Debug/.clangd/.cache/clangd/index/i2c_target.c.81C6743683C30173.idx
  18. 二進制
      Debug/.clangd/.cache/clangd/index/i2c_target.h.4BFCCCED038EBB00.idx
  19. 0 0
      Debug/.clangd/.cache/clangd/index/multiplexer.c.3B7B273E7C0D0C2C.idx
  20. 0 0
      Debug/.clangd/.cache/clangd/index/multiplexer.h.0A1757C0295533D6.idx
  21. 0 0
      Debug/.clangd/.cache/clangd/index/ti_msp_dl_config.c.CD2F9AD1B4C264FA.idx
  22. 0 0
      Debug/.clangd/.cache/clangd/index/ti_msp_dl_config.h.6C46FDF13D1C9C02.idx
  23. 0 0
      Debug/.clangd/compile_commands.json
  24. 3 1
      Debug/adc.d
  25. 二進制
      Debug/adc.o
  26. 0 0
      Debug/battery.d
  27. 二進制
      Debug/battery.o
  28. 0 0
      Debug/ccsObjs.opt
  29. 772 0
      Debug/charge_controller_v7.map
  30. 576 605
      Debug/charge_controller_v7_linkInfo.xml
  31. 0 0
      Debug/dac.d
  32. 0 0
      Debug/dac.o
  33. 0 0
      Debug/device.cmd.genlibs
  34. 0 0
      Debug/device.opt
  35. 0 0
      Debug/device_linker.cmd
  36. 3 1
      Debug/i2c_controller.d
  37. 154 0
      Debug/i2c_target.d
  38. 二進制
      Debug/i2c_target.o
  39. 0 0
      Debug/makefile
  40. 0 0
      Debug/multiplexer.d
  41. 0 0
      Debug/multiplexer.o
  42. 0 0
      Debug/objects.mk
  43. 0 0
      Debug/sources.mk
  44. 0 0
      Debug/startup_mspm0g350x_ticlang.d
  45. 0 0
      Debug/startup_mspm0g350x_ticlang.o
  46. 0 0
      Debug/subdir_rules.mk
  47. 0 0
      Debug/subdir_vars.mk
  48. 0 0
      Debug/ti/comm_modules/i2c/controller/i2c_comm_controller.d
  49. 0 0
      Debug/ti/comm_modules/i2c/controller/i2c_comm_controller.o
  50. 0 0
      Debug/ti/comm_modules/i2c/controller/subdir_rules.mk
  51. 0 0
      Debug/ti/comm_modules/i2c/controller/subdir_vars.mk
  52. 0 0
      Debug/ti_msp_dl_config.c
  53. 0 0
      Debug/ti_msp_dl_config.d
  54. 0 0
      Debug/ti_msp_dl_config.h
  55. 0 0
      Debug/ti_msp_dl_config.o
  56. 0 0
      README.html
  57. 0 0
      README.md
  58. 32 15
      adc.c
  59. 2 1
      adc.h
  60. 0 3
      battery.c
  61. 3 3
      battery.h
  62. 二進制
      charge_controller_v7/Debug/.clangd/.cache/clangd/index/adc.c.C783CB560A28832A.idx
  63. 二進制
      charge_controller_v7/Debug/.clangd/.cache/clangd/index/adc.h.4254346EB7A93BD8.idx
  64. 二進制
      charge_controller_v7/Debug/.clangd/.cache/clangd/index/battery.c.900D8F73FDE164C8.idx
  65. 二進制
      charge_controller_v7/Debug/.clangd/.cache/clangd/index/battery.h.DD363DA997E60BB9.idx
  66. 二進制
      charge_controller_v7/Debug/.clangd/.cache/clangd/index/i2c_controller.c.D084D0AF1C0F98F4.idx
  67. 二進制
      charge_controller_v7/Debug/.clangd/.cache/clangd/index/i2c_target.c.81C6743683C30173.idx
  68. 二進制
      charge_controller_v7/Debug/.clangd/.cache/clangd/index/i2c_target.h.4BFCCCED038EBB00.idx
  69. 二進制
      charge_controller_v7/Debug/adc.o
  70. 二進制
      charge_controller_v7/Debug/battery.o
  71. 0 766
      charge_controller_v7/Debug/charge_controller_v7.map
  72. 二進制
      charge_controller_v7/Debug/charge_controller_v7.out
  73. 二進制
      charge_controller_v7/Debug/i2c_controller.o
  74. 0 5
      charge_controller_v7/Debug/i2c_target.d
  75. 二進制
      charge_controller_v7/Debug/i2c_target.o
  76. 0 29
      charge_controller_v7/i2c_target.c
  77. 0 0
      dac.c
  78. 0 0
      dac.h
  79. 158 135
      i2c_controller.c
  80. 0 0
      i2c_controller.syscfg
  81. 96 0
      i2c_target.c
  82. 18 3
      i2c_target.h
  83. 0 0
      multiplexer.c
  84. 0 0
      multiplexer.h
  85. 0 0
      targetConfigs/MSPM0G3507.ccxml
  86. 0 0
      targetConfigs/readme.txt
  87. 0 0
      ti/comm_modules/i2c/controller/i2c_comm_controller.c
  88. 0 0
      ti/comm_modules/i2c/controller/i2c_comm_controller.h

+ 0 - 0
charge_controller_v7/.ccsproject → .ccsproject


+ 0 - 0
charge_controller_v7/.clangd → .clangd


+ 0 - 0
charge_controller_v7/.cproject → .cproject


+ 2 - 0
.gitignore

@@ -0,0 +1,2 @@
+.json
+.idx

+ 0 - 0
charge_controller_v7/.project → .project


+ 0 - 0
charge_controller_v7/.settings/org.eclipse.cdt.codan.core.prefs → .settings/org.eclipse.cdt.codan.core.prefs


+ 0 - 0
charge_controller_v7/.settings/org.eclipse.core.resources.prefs → .settings/org.eclipse.core.resources.prefs


二進制
Debug/.clangd/.cache/clangd/index/adc.c.C783CB560A28832A.idx


二進制
Debug/.clangd/.cache/clangd/index/adc.h.4254346EB7A93BD8.idx


二進制
Debug/.clangd/.cache/clangd/index/battery.c.900D8F73FDE164C8.idx


二進制
Debug/.clangd/.cache/clangd/index/battery.h.DD363DA997E60BB9.idx


+ 0 - 0
charge_controller_v7/Debug/.clangd/.cache/clangd/index/dac.c.91713AFCB5D40D6E.idx → Debug/.clangd/.cache/clangd/index/dac.c.91713AFCB5D40D6E.idx


+ 0 - 0
charge_controller_v7/Debug/.clangd/.cache/clangd/index/dac.h.D233D18DB68C8427.idx → Debug/.clangd/.cache/clangd/index/dac.h.D233D18DB68C8427.idx


+ 0 - 0
charge_controller_v7/Debug/.clangd/.cache/clangd/index/i2c_comm_controller.c.203F8B33309E2B48.idx → Debug/.clangd/.cache/clangd/index/i2c_comm_controller.c.203F8B33309E2B48.idx


+ 0 - 0
charge_controller_v7/Debug/.clangd/.cache/clangd/index/i2c_comm_controller.h.8DD4C36B9014EBE6.idx → Debug/.clangd/.cache/clangd/index/i2c_comm_controller.h.8DD4C36B9014EBE6.idx


二進制
Debug/.clangd/.cache/clangd/index/i2c_controller.c.D084D0AF1C0F98F4.idx


二進制
Debug/.clangd/.cache/clangd/index/i2c_target.c.81C6743683C30173.idx


二進制
Debug/.clangd/.cache/clangd/index/i2c_target.h.4BFCCCED038EBB00.idx


+ 0 - 0
charge_controller_v7/Debug/.clangd/.cache/clangd/index/multiplexer.c.3B7B273E7C0D0C2C.idx → Debug/.clangd/.cache/clangd/index/multiplexer.c.3B7B273E7C0D0C2C.idx


+ 0 - 0
charge_controller_v7/Debug/.clangd/.cache/clangd/index/multiplexer.h.0A1757C0295533D6.idx → Debug/.clangd/.cache/clangd/index/multiplexer.h.0A1757C0295533D6.idx


+ 0 - 0
charge_controller_v7/Debug/.clangd/.cache/clangd/index/ti_msp_dl_config.c.CD2F9AD1B4C264FA.idx → Debug/.clangd/.cache/clangd/index/ti_msp_dl_config.c.CD2F9AD1B4C264FA.idx


+ 0 - 0
charge_controller_v7/Debug/.clangd/.cache/clangd/index/ti_msp_dl_config.h.6C46FDF13D1C9C02.idx → Debug/.clangd/.cache/clangd/index/ti_msp_dl_config.h.6C46FDF13D1C9C02.idx


+ 0 - 0
charge_controller_v7/Debug/.clangd/compile_commands.json → Debug/.clangd/compile_commands.json


+ 3 - 1
charge_controller_v7/Debug/adc.d → Debug/adc.d

@@ -74,7 +74,8 @@ adc.o: ../adc.c /home/ngosh/workspace_ccstheia/charge_controller_v7/adc.h \
  /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_vref.h \
  /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_wwdt.h \
  /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/m0p/dl_interrupt.h \
- /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/m0p/dl_systick.h
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/m0p/dl_systick.h \
+ ../battery.h
 /home/ngosh/workspace_ccstheia/charge_controller_v7/adc.h:
 /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_i2c.h:
 /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/msp.h:
@@ -150,3 +151,4 @@ ti_msp_dl_config.h:
 /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_wwdt.h:
 /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/m0p/dl_interrupt.h:
 /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/m0p/dl_systick.h:
+../battery.h:

二進制
Debug/adc.o


+ 0 - 0
charge_controller_v7/Debug/battery.d → Debug/battery.d


二進制
Debug/battery.o


+ 0 - 0
charge_controller_v7/Debug/ccsObjs.opt → Debug/ccsObjs.opt


+ 772 - 0
Debug/charge_controller_v7.map

@@ -0,0 +1,772 @@
+******************************************************************************
+            TI ARM Clang Linker Unix v4.0.0                    
+******************************************************************************
+>> Linked Thu Mar  6 15:20:35 2025
+
+OUTPUT FILE NAME:   <charge_controller_v7.out>
+ENTRY POINT SYMBOL: "_c_int00_noargs"  address: 00002701
+
+
+MEMORY CONFIGURATION
+
+         name            origin    length      used     unused   attr    fill
+----------------------  --------  ---------  --------  --------  ----  --------
+  FLASH                 00000000   00020000  00003098  0001cf68  R  X
+  SRAM                  20200000   00008000  00001691  0000696f  RW X
+  BCR_CONFIG            41c00000   00000080  00000000  00000080  R   
+  BSL_CONFIG            41c00100   00000080  00000000  00000080  R   
+
+
+SEGMENT ALLOCATION MAP
+
+run origin  load origin   length   init length attrs members
+----------  ----------- ---------- ----------- ----- -------
+00000000    00000000    00003098   00003098    r-x
+  00000000    00000000    000000c0   000000c0    r-- .intvecs
+  000000c0    000000c0    00002bb0   00002bb0    r-x .text
+  00002c70    00002c70    000003a0   000003a0    r-- .rodata
+  00003010    00003010    00000088   00000088    r-- .cinit
+20200000    20200000    00001491   00000000    rw-
+  20200000    20200000    00001000   00000000    rw- .sysmem
+  20201000    20201000    000002bc   00000000    rw- .bss
+  202012bc    202012bc    000001d5   00000000    rw- .data
+20207e00    20207e00    00000200   00000000    rw-
+  20207e00    20207e00    00000200   00000000    rw- .stack
+
+
+SECTION ALLOCATION MAP
+
+ output                                  attributes/
+section   page    origin      length       input sections
+--------  ----  ----------  ----------   ----------------
+.intvecs   0    00000000    000000c0     
+                  00000000    000000c0     startup_mspm0g350x_ticlang.o (.intvecs)
+
+.text      0    000000c0    00002bb0     
+                  000000c0    00000868     libc.a : _printfi.c.obj (.text:__TI_printfi_nofloat)
+                  00000928    000001c8     adc.o (.text.ADC_ReadData)
+                  00000af0    000001bc     i2c_controller.o (.text.I2C0_IRQHandler)
+                  00000cac    0000018c     i2c_controller.o (.text.I2C1_IRQHandler)
+                  00000e38    00000114     libc.a : memory.c.obj (.text.aligned_alloc)
+                  00000f4c    000000f8            : fputs.c.obj (.text.fputs)
+                  00001044    000000e8     i2c_target.o (.text.Battery_StateUpdate)
+                  0000112c    000000e8     libc.a : memory.c.obj (.text.free)
+                  00001214    000000e0     adc.o (.text.ADC_ConstructConfigBytes)
+                  000012f4    000000e0     libc.a : setvbuf.c.obj (.text.setvbuf)
+                  000013d4    000000c8     adc.o (.text.ADC_SetConfigurationBytes)
+                  0000149c    000000a2     libclang_rt.builtins.a : udivmoddi4.S.obj (.text)
+                  0000153e    00000002                            : aeabi_div0.c.obj (.text.__aeabi_idiv0)
+                  00001540    000000a0     adc.o (.text.Battery_UpdateCurrentVoltage)
+                  000015e0    000000a0     multiplexer.o (.text.Multiplexer_SelectChannel)
+                  00001680    0000009c     libc.a : fputc.c.obj (.text.fputc)
+                  0000171c    00000098     adc.o (.text.ADC_ConvertToVoltage)
+                  000017b4    0000008c     i2c_controller.o (.text.main)
+                  00001840    00000088     libc.a : strcmp-armv6m.S.obj (.text:strcmp)
+                  000018c8    0000007c            : fclose.c.obj (.text.__TI_closefile)
+                  00001944    0000007c            : copy_decompress_lzss.c.obj (.text:decompress:lzss)
+                  000019c0    0000007a     ti_msp_dl_config.o (.text.SYSCFG_DL_GPIO_init)
+                  00001a3a    00000002     libclang_rt.builtins.a : aeabi_div0.c.obj (.text.__aeabi_ldiv0)
+                  00001a3c    0000006c     libsysbm.a : hostlseek.c.obj (.text.HOSTlseek)
+                  00001aa8    0000006c                : hostrename.c.obj (.text.HOSTrename)
+                  00001b14    0000006c     libc.a : fseek.c.obj (.text.fseeko)
+                  00001b80    0000006c            : getdevice.c.obj (.text.getdevice)
+                  00001bec    00000068     ti_msp_dl_config.o (.text.SYSCFG_DL_initPower)
+                  00001c54    00000064     libc.a : _io_perm.c.obj (.text.__TI_wrt_ok)
+                  00001cb8    00000064            : memory.c.obj (.text.split)
+                  00001d1c    00000060     driverlib.a : dl_i2c.o (.text.DL_I2C_fillTargetTXFIFO)
+                  00001d7c    00000060     libsysbm.a : hostopen.c.obj (.text.HOSTopen)
+                  00001ddc    00000060     ti_msp_dl_config.o (.text.SYSCFG_DL_I2C_target_init)
+                  00001e3c    0000005e     driverlib.a : dl_i2c.o (.text.DL_I2C_fillControllerTXFIFO)
+                  00001e9a    00000002     libc.a : _lock.c.obj (.text._nop)
+                  00001e9c    0000005c            : printf.c.obj (.text.printf)
+                  00001ef8    00000058     libsysbm.a : hostread.c.obj (.text.HOSTread)
+                  00001f50    00000058                : hostwrite.c.obj (.text.HOSTwrite)
+                  00001fa8    00000058     ti_msp_dl_config.o (.text.SYSCFG_DL_I2C_controller_init)
+                  00002000    00000052     libc.a : fflush.c.obj (.text.__TI_doflush)
+                  00002052    00000002     --HOLE-- [fill = 0]
+                  00002054    00000050     adc.o (.text.DL_I2C_startControllerTransfer)
+                  000020a4    00000050     multiplexer.o (.text.DL_I2C_startControllerTransfer)
+                  000020f4    00000050     libsysbm.a : close.c.obj (.text.close)
+                  00002144    00000048                : hostclose.c.obj (.text.HOSTclose)
+                  0000218c    00000048                : hostunlink.c.obj (.text.HOSTunlink)
+                  000021d4    00000040     libclang_rt.builtins.a : aeabi_uidivmod.S.obj (.text.__aeabi_uidivmod)
+                  00002214    00000040     libc.a : atoi.c.obj (.text.atoi)
+                  00002254    0000003c     ti_msp_dl_config.o (.text.DL_GPIO_initPeripheralInputFunctionFeatures)
+                  00002290    0000003c     driverlib.a : dl_i2c.o (.text.DL_I2C_flushControllerTXFIFO)
+                  000022cc    0000003c                 : dl_i2c.o (.text.DL_I2C_flushTargetTXFIFO)
+                  00002308    0000003c     libc.a : autoinit.c.obj (.text:__TI_auto_init_nobinit_nopinit)
+                  00002344    0000003a     libclang_rt.builtins.a : muldsi3.S.obj (.text.__muldsi3)
+                  0000237e    00000038     ti_msp_dl_config.o (.text.DL_CRC_init)
+                  000023b6    00000002     --HOLE-- [fill = 0]
+                  000023b8    00000034     libc.a : fopen.c.obj (.text.__TI_cleanup)
+                  000023ec    00000034     libsysbm.a : trgmsg.c.obj (.text.__TI_readmsg)
+                  00002420    00000034                : trgmsg.c.obj (.text.__TI_writemsg)
+                  00002454    00000034     libc.a : exit.c.obj (.text.exit)
+                  00002488    00000034            : getdevice.c.obj (.text.finddevice)
+                  000024bc    00000032     i2c_comm_controller.o (.text.I2C_init)
+                  000024ee    00000002     --HOLE-- [fill = 0]
+                  000024f0    0000002c     i2c_controller.o (.text.__NVIC_EnableIRQ)
+                  0000251c    0000002c     libsysbm.a : unlink.c.obj (.text.unlink)
+                  00002548    00000028     adc.o (.text.DL_Common_updateReg)
+                  00002570    00000028     multiplexer.o (.text.DL_Common_updateReg)
+                  00002598    00000028     ti_msp_dl_config.o (.text.DL_Common_updateReg)
+                  000025c0    00000028     ti_msp_dl_config.o (.text.DL_I2C_setControllerRXFIFOThreshold)
+                  000025e8    00000028     ti_msp_dl_config.o (.text.DL_I2C_setControllerTXFIFOThreshold)
+                  00002610    00000028     ti_msp_dl_config.o (.text.DL_I2C_setTargetRXFIFOThreshold)
+                  00002638    00000028     ti_msp_dl_config.o (.text.DL_I2C_setTargetTXFIFOThreshold)
+                  00002660    00000028     ti_msp_dl_config.o (.text.SYSCFG_DL_CRC_init)
+                  00002688    00000028     libc.a : memory.c.obj (.text.free_list_insert)
+                  000026b0    00000028     libsysbm.a : lseek.c.obj (.text.lseek)
+                  000026d8    00000028                : write.c.obj (.text.write)
+                  00002700    00000028     libc.a : boot_cortex_m.c.obj (.text:_c_int00_noargs)
+                  00002728    00000026     ti_msp_dl_config.o (.text.DL_I2C_setAnalogGlitchFilterPulseWidth)
+                  0000274e    00000026     driverlib.a : dl_i2c.o (.text.DL_I2C_setClockConfig)
+                  00002774    00000024     ti_msp_dl_config.o (.text.DL_CRC_setSeed16)
+                  00002798    00000024     ti_msp_dl_config.o (.text.DL_I2C_setTargetOwnAddress)
+                  000027bc    00000024     libclang_rt.builtins.a : muldi3.S.obj (.text.__muldi3)
+                  000027e0    00000022     libc.a : memccpy.c.obj (.text.memccpy)
+                  00002802    0000001e     ti_msp_dl_config.o (.text.SYSCFG_DL_SYSCTL_init)
+                  00002820    0000001e     libclang_rt.builtins.a : ashldi3.S.obj (.text.__ashldi3)
+                  0000283e    00000002     --HOLE-- [fill = 0]
+                  00002840    0000001c     ti_msp_dl_config.o (.text.DL_GPIO_enableHiZ)
+                  0000285c    0000001c     ti_msp_dl_config.o (.text.DL_I2C_disableTargetWakeup)
+                  00002878    0000001c     adc.o (.text.DL_I2C_enableInterrupt)
+                  00002894    0000001c     i2c_controller.o (.text.DL_I2C_enableInterrupt)
+                  000028b0    0000001c     ti_msp_dl_config.o (.text.DL_I2C_enableInterrupt)
+                  000028cc    0000001c     i2c_controller.o (.text.DL_I2C_isControllerRXFIFOEmpty)
+                  000028e8    0000001c     ti_msp_dl_config.o (.text.DL_SYSCTL_setSYSOSCFreq)
+                  00002904    0000001c     ti_msp_dl_config.o (.text.SYSCFG_DL_init)
+                  00002920    0000001c     libc.a : memory.c.obj (.text.free_list_remove)
+                  0000293c    00000018     ti_msp_dl_config.o (.text.DL_CRC_enablePower)
+                  00002954    00000018     ti_msp_dl_config.o (.text.DL_CRC_reset)
+                  0000296c    00000018     ti_msp_dl_config.o (.text.DL_GPIO_enablePower)
+                  00002984    00000018     ti_msp_dl_config.o (.text.DL_GPIO_reset)
+                  0000299c    00000018     ti_msp_dl_config.o (.text.DL_I2C_disableAnalogGlitchFilter)
+                  000029b4    00000018     ti_msp_dl_config.o (.text.DL_I2C_enableAnalogGlitchFilter)
+                  000029cc    00000018     ti_msp_dl_config.o (.text.DL_I2C_enableController)
+                  000029e4    00000018     ti_msp_dl_config.o (.text.DL_I2C_enableControllerClockStretching)
+                  000029fc    00000018     ti_msp_dl_config.o (.text.DL_I2C_enablePower)
+                  00002a14    00000018     ti_msp_dl_config.o (.text.DL_I2C_enableTarget)
+                  00002a2c    00000018     ti_msp_dl_config.o (.text.DL_I2C_enableTargetClockStretching)
+                  00002a44    00000018     ti_msp_dl_config.o (.text.DL_I2C_reset)
+                  00002a5c    00000018     ti_msp_dl_config.o (.text.DL_I2C_setTimerPeriod)
+                  00002a74    00000018     ti_msp_dl_config.o (.text.DL_SYSCTL_setBORThreshold)
+                  00002a8c    00000016     i2c_comm_controller.o (.text.I2C_clearBuffer)
+                  00002aa2    00000016     libc.a : copy_zero_init.c.obj (.text:decompress:ZI:__TI_zero_init_nomemset)
+                  00002ab8    00000014     adc.o (.text.DL_I2C_getControllerStatus)
+                  00002acc    00000014     i2c_target.o (.text.DL_I2C_getControllerStatus)
+                  00002ae0    00000014     multiplexer.o (.text.DL_I2C_getControllerStatus)
+                  00002af4    00000014     i2c_controller.o (.text.DL_I2C_getTargetStatus)
+                  00002b08    00000014     i2c_controller.o (.text.DL_I2C_receiveControllerData)
+                  00002b1c    00000014     ti_msp_dl_config.o (.text.DL_I2C_resetControllerTransfer)
+                  00002b30    00000014     ti_msp_dl_config.o (.text.DL_SYSCTL_disableSYSPLL)
+                  00002b44    00000014     libclang_rt.builtins.a : aeabi_uldivmod.S.obj (.text.__aeabi_uldivmod)
+                  00002b58    00000012     i2c_controller.o (.text.DL_I2C_getPendingInterrupt)
+                  00002b6a    00000012     libc.a : memcpy16.S.obj (.text:TI_memcpy_small)
+                  00002b7c    00000012            : copy_decompress_none.c.obj (.text:decompress:none)
+                  00002b8e    00000002     --HOLE-- [fill = 0]
+                  00002b90    00000010     ti_msp_dl_config.o (.text.DL_SYSCTL_disableHFXT)
+                  00002ba0    00000010     libc.a : wcslen.c.obj (.text.wcslen)
+                  00002bb0    0000000e            : memory.c.obj (.text.OUTLINED_FUNCTION_0)
+                  00002bbe    00000002     --HOLE-- [fill = 0]
+                  00002bc0    0000000e     libclang_rt.builtins.a : aeabi_memset.S.obj (.text.__aeabi_memset)
+                  00002bce    0000000e     libsysbm.a : hostrename.c.obj (.text.strcpy)
+                  00002bdc    0000000e     libc.a : _printfi.c.obj (.text.strlen)
+                  00002bea    0000000e     libsysbm.a : hostrename.c.obj (.text.strlen)
+                  00002bf8    0000000e     libc.a : memset16.S.obj (.text:TI_memset_small)
+                  00002c06    00000002     --HOLE-- [fill = 0]
+                  00002c08    0000000c     libclang_rt.builtins.a : aeabi_memset.S.obj (.text.__aeabi_memclr)
+                  00002c14    0000000c     libc.a : memory.c.obj (.text.malloc)
+                  00002c20    0000000a     driverlib.a : dl_common.o (.text.DL_Common_delayCycles)
+                  00002c2a    00000002     --HOLE-- [fill = 0]
+                  00002c2c    00000008     libc.a : aeabi_portable.c.obj (.text.__aeabi_errno_addr)
+                  00002c34    00000008     libclang_rt.builtins.a : aeabi_memcpy.S.obj (.text.__aeabi_memcpy)
+                  00002c3c    00000008     libc.a : printf.c.obj (.text._outc)
+                  00002c44    00000008            : printf.c.obj (.text._outs)
+                  00002c4c    00000008            : fseek.c.obj (.text.fseek)
+                  00002c54    00000008     libsysbm.a : remove.c.obj (.text.remove)
+                  00002c5c    00000004     startup_mspm0g350x_ticlang.o (.text.Default_Handler)
+                  00002c60    00000004     startup_mspm0g350x_ticlang.o (.text.Reset_Handler)
+                  00002c64    00000004     libc.a : pre_init.c.obj (.text._system_pre_init)
+                  00002c68    00000004            : exit.c.obj (.text:abort)
+                  00002c6c    00000004     --HOLE-- [fill = 0]
+
+.cinit     0    00003010    00000088     
+                  00003010    00000064     (.cinit..data.load) [load image, compression = lzss]
+                  00003074    0000000c     (__TI_handler_table)
+                  00003080    00000008     (.cinit..bss.load) [load image, compression = zero_init]
+                  00003088    00000010     (__TI_cinit_table)
+
+.rodata    0    00002c70    000003a0     
+                  00002c70    00000101     libc.a : aeabi_ctype.S.obj (.rodata:__aeabi_ctype_table_)
+                  00002d71    00000039     i2c_controller.o (.rodata.str1.179063319387908962991)
+                  00002daa    00000032     multiplexer.o (.rodata.str1.29362095947798716951)
+                  00002ddc    0000002b     adc.o (.rodata.str1.25441403197361701961)
+                  00002e07    00000029     adc.o (.rodata.str1.41407442172756317641)
+                  00002e30    00000027     adc.o (.rodata.str1.9104006415414870471)
+                  00002e57    00000027     multiplexer.o (.rodata.str1.92445539561215715011)
+                  00002e7e    00000022     adc.o (.rodata.str1.75598629454301647491)
+                  00002ea0    00000022     i2c_controller.o (.rodata.str1.91043755832811627921)
+                  00002ec2    00000020     adc.o (.rodata.str1.95393766749411319771)
+                  00002ee2    0000001f     i2c_controller.o (.rodata.str1.45413293569381271681)
+                  00002f01    0000001c     adc.o (.rodata.str1.119342513474743631991)
+                  00002f1d    0000001b     adc.o (.rodata.str1.47019157895356604021)
+                  00002f38    0000001b     i2c_controller.o (.rodata.str1.89005588678899653321)
+                  00002f53    00000018     i2c_controller.o (.rodata.str1.58202964110805887911)
+                  00002f6b    00000016     adc.o (.rodata.str1.152928147105711405261)
+                  00002f81    00000015     i2c_controller.o (.rodata.str1.91888677203502862861)
+                  00002f96    00000014     i2c_controller.o (.rodata.str1.139536071156377696321)
+                  00002faa    00000014     i2c_controller.o (.rodata.str1.44366518634961814551)
+                  00002fbe    00000013     i2c_controller.o (.rodata.str1.106815021420079532371)
+                  00002fd1    00000011     libc.a : _printfi.c.obj (.rodata.str1.103488685894817597201)
+                  00002fe2    00000011            : _printfi.c.obj (.rodata.str1.153638888446227384661)
+                  00002ff3    0000000b     adc.o (.rodata.str1.135499725018448954211)
+                  00002ffe    00000002     ti_msp_dl_config.o (.rodata.gI2C_controllerClockConfig)
+                  00003000    00000002     ti_msp_dl_config.o (.rodata.gI2C_targetClockConfig)
+                  00003002    0000000e     --HOLE-- [fill = 0]
+
+.init_array 
+*          0    00000000    00000000     UNINITIALIZED
+
+.binit     0    00000000    00000000     
+
+.sysmem    0    20200000    00001000     UNINITIALIZED
+                  20200000    00000010     libc.a : memory.c.obj (.sysmem)
+                  20200010    00000ff0     --HOLE--
+
+.bss       0    20201000    000002bc     UNINITIALIZED
+                  20201000    00000120     libsysbm.a : trgmsg.c.obj (.bss:_CIOBUF_)
+                  20201120    000000a0     libc.a : defs.c.obj (.bss.__TI_tmpnams)
+                  202011c0    0000009c     (.common:gI2C)
+                  2020125c    00000010     (.common:batteries)
+                  2020126c    00000010     (.common:gRxPacket)
+                  2020127c    00000010     (.common:gTxPacket)
+                  2020128c    00000008     libsysbm.a : hostopen.c.obj (.bss.parmbuf)
+                  20201294    00000008     (.common:battery_data)
+                  2020129c    00000004     libc.a : memory.c.obj (.bss.sys_free)
+                  202012a0    00000004     (.common:gRxADCcount)
+                  202012a4    00000004     (.common:gRxADClen)
+                  202012a8    00000004     (.common:gTxADCcount)
+                  202012ac    00000004     (.common:gTxADClen)
+                  202012b0    00000004     (.common:piRxCount)
+                  202012b4    00000004     (.common:piTxCount)
+                  202012b8    00000001     (.common:gRxComplete)
+                  202012b9    00000001     (.common:gTxComplete)
+                  202012ba    00000001     (.common:piRxComplete)
+                  202012bb    00000001     (.common:piTxComplete)
+
+.data      0    202012bc    000001d5     UNINITIALIZED
+                  202012bc    000000f0     libc.a : defs.c.obj (.data._ftable)
+                  202013ac    00000078     libsysbm.a : host_device.c.obj (.data._device)
+                  20201424    00000050                : host_device.c.obj (.data._stream)
+                  20201474    00000008     libc.a : exit.c.obj (.data..L_MergedGlobals)
+                  2020147c    00000004            : defs.c.obj (.data.__TI_ft_end)
+                  20201480    00000004            : aeabi_portable.c.obj (.data.__aeabi_errno)
+                  20201484    00000004            : _lock.c.obj (.data._lock)
+                  20201488    00000004            : _lock.c.obj (.data._unlock)
+                  2020148c    00000001     i2c_controller.o (.data.I2C0_IRQHandler.receivedCommand)
+                  2020148d    00000003     --HOLE--
+                  20201490    00000001     libc.a : memory.c.obj (.data.memory_is_initialized)
+
+.stack     0    20207e00    00000200     UNINITIALIZED
+                  20207e00    00000004     libc.a : boot_cortex_m.c.obj (.stack)
+                  20207e04    000001fc     --HOLE--
+
+__llvm_prf_cnts 
+*          0    20200000    00000000     UNINITIALIZED
+
+__llvm_prf_bits 
+*          0    20200000    00000000     UNINITIALIZED
+
+MODULE SUMMARY
+
+       Module                         code    ro data   rw data
+       ------                         ----    -------   -------
+    ./
+       adc.o                          1360    277       50     
+       i2c_controller.o               1138    253       165    
+       ti_msp_dl_config.o             1438    4         0      
+       multiplexer.o                  300     89        0      
+       i2c_target.o                   252     0         10     
+       startup_mspm0g350x_ticlang.o   8       192       0      
+       battery.o                      0       0         16     
+    +--+------------------------------+-------+---------+---------+
+       Total:                         4496    815       241    
+                                                               
+    ./ti/comm_modules/i2c/controller/
+       i2c_comm_controller.o          72      0         0      
+    +--+------------------------------+-------+---------+---------+
+       Total:                         72      0         0      
+                                                               
+    /home/ngosh/ti/ccstheia151/ccs/tools/compiler/ti-cgt-armllvm_4.0.0.LTS/lib/armv6m-ti-none-eabi/c/libc.a
+       _printfi.c.obj                 2166    34        0      
+       memory.c.obj                   702     0         5      
+       defs.c.obj                     0       0         404    
+       aeabi_ctype.S.obj              0       257       0      
+       fputs.c.obj                    248     0         0      
+       setvbuf.c.obj                  224     0         0      
+       getdevice.c.obj                160     0         0      
+       fputc.c.obj                    156     0         0      
+       strcmp-armv6m.S.obj            136     0         0      
+       copy_decompress_lzss.c.obj     124     0         0      
+       fclose.c.obj                   124     0         0      
+       fseek.c.obj                    116     0         0      
+       printf.c.obj                   108     0         0      
+       _io_perm.c.obj                 100     0         0      
+       fflush.c.obj                   82      0         0      
+       atoi.c.obj                     64      0         0      
+       exit.c.obj                     56      0         8      
+       autoinit.c.obj                 60      0         0      
+       fopen.c.obj                    52      0         0      
+       boot_cortex_m.c.obj            40      0         0      
+       memccpy.c.obj                  34      0         0      
+       copy_zero_init.c.obj           22      0         0      
+       copy_decompress_none.c.obj     18      0         0      
+       memcpy16.S.obj                 18      0         0      
+       wcslen.c.obj                   16      0         0      
+       memset16.S.obj                 14      0         0      
+       aeabi_portable.c.obj           8       0         4      
+       _lock.c.obj                    2       0         8      
+       pre_init.c.obj                 4       0         0      
+    +--+------------------------------+-------+---------+---------+
+       Total:                         4854    291       429    
+                                                               
+    /home/ngosh/ti/ccstheia151/ccs/tools/compiler/ti-cgt-armllvm_4.0.0.LTS/lib/armv6m-ti-none-eabi/c/libsysbm.a
+       trgmsg.c.obj                   104     0         288    
+       host_device.c.obj              0       0         200    
+       hostrename.c.obj               136     0         0      
+       hostlseek.c.obj                108     0         0      
+       hostopen.c.obj                 96      0         8      
+       hostread.c.obj                 88      0         0      
+       hostwrite.c.obj                88      0         0      
+       close.c.obj                    80      0         0      
+       hostclose.c.obj                72      0         0      
+       hostunlink.c.obj               72      0         0      
+       unlink.c.obj                   44      0         0      
+       lseek.c.obj                    40      0         0      
+       write.c.obj                    40      0         0      
+       remove.c.obj                   8       0         0      
+    +--+------------------------------+-------+---------+---------+
+       Total:                         976     0         496    
+                                                               
+    /home/ngosh/ti/ccstheia151/ccs/tools/compiler/ti-cgt-armllvm_4.0.0.LTS/lib/armv6m-ti-none-eabi/libclang_rt.builtins.a
+       udivmoddi4.S.obj               162     0         0      
+       aeabi_uidivmod.S.obj           64      0         0      
+       muldsi3.S.obj                  58      0         0      
+       muldi3.S.obj                   36      0         0      
+       ashldi3.S.obj                  30      0         0      
+       aeabi_memset.S.obj             26      0         0      
+       aeabi_uldivmod.S.obj           20      0         0      
+       aeabi_memcpy.S.obj             8       0         0      
+       aeabi_div0.c.obj               4       0         0      
+    +--+------------------------------+-------+---------+---------+
+       Total:                         408     0         0      
+                                                               
+    /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/lib/ticlang/m0p/mspm0g1x0x_g3x0x/driverlib.a
+       dl_i2c.o                       348     0         0      
+       dl_common.o                    10      0         0      
+    +--+------------------------------+-------+---------+---------+
+       Total:                         358     0         0      
+                                                               
+       Heap:                          0       0         4096   
+       Stack:                         0       0         512    
+       Linker Generated:              0       136       0      
+    +--+------------------------------+-------+---------+---------+
+       Grand Total:                   11164   1242      5774   
+
+
+LINKER GENERATED COPY TABLES
+
+__TI_cinit_table @ 00003088 records: 2, size/record: 8, table size: 16
+	.data: load addr=00003010, load size=00000064 bytes, run addr=202012bc, run size=000001d5 bytes, compression=lzss
+	.bss: load addr=00003080, load size=00000008 bytes, run addr=20201000, run size=000002bc bytes, compression=zero_init
+
+
+LINKER GENERATED HANDLER TABLE
+
+__TI_handler_table @ 00003074 records: 3, size/record: 4, table size: 12
+	index: 0, handler: __TI_decompress_lzss
+	index: 1, handler: __TI_decompress_none
+	index: 2, handler: __TI_zero_init
+
+
+GLOBAL SYMBOLS: SORTED ALPHABETICALLY BY Name 
+
+address   name                          
+-------   ----                          
+00002c5d  ADC0_IRQHandler               
+00002c5d  ADC1_IRQHandler               
+00001215  ADC_ConstructConfigBytes      
+0000171d  ADC_ConvertToVoltage          
+00000929  ADC_ReadData                  
+000013d5  ADC_SetConfigurationBytes     
+00002c5d  AES_IRQHandler                
+00001045  Battery_StateUpdate           
+00001541  Battery_UpdateCurrentVoltage  
+00002c68  C$$EXIT                       
+0000244d  C$$IO$$                       
+00002c5d  CANFD0_IRQHandler             
+00002c5d  DAC0_IRQHandler               
+00002c21  DL_Common_delayCycles         
+00001e3d  DL_I2C_fillControllerTXFIFO   
+00001d1d  DL_I2C_fillTargetTXFIFO       
+00002291  DL_I2C_flushControllerTXFIFO  
+000022cd  DL_I2C_flushTargetTXFIFO      
+0000274f  DL_I2C_setClockConfig         
+00002c5d  DMA_IRQHandler                
+00002c5d  Default_Handler               
+00002c5d  GROUP0_IRQHandler             
+00002c5d  GROUP1_IRQHandler             
+00002145  HOSTclose                     
+00001a3d  HOSTlseek                     
+00001d7d  HOSTopen                      
+00001ef9  HOSTread                      
+00001aa9  HOSTrename                    
+0000218d  HOSTunlink                    
+00001f51  HOSTwrite                     
+00002c5d  HardFault_Handler             
+00000af1  I2C0_IRQHandler               
+00000cad  I2C1_IRQHandler               
+000024bd  I2C_init                      
+000015e1  Multiplexer_SelectChannel     
+00002c5d  NMI_Handler                   
+00002c5d  PendSV_Handler                
+00002c5d  RTC_IRQHandler                
+00002c61  Reset_Handler                 
+00002c5d  SPI0_IRQHandler               
+00002c5d  SPI1_IRQHandler               
+00002c5d  SVC_Handler                   
+00002661  SYSCFG_DL_CRC_init            
+000019c1  SYSCFG_DL_GPIO_init           
+00001fa9  SYSCFG_DL_I2C_controller_init 
+00001ddd  SYSCFG_DL_I2C_target_init     
+00002803  SYSCFG_DL_SYSCTL_init         
+00002905  SYSCFG_DL_init                
+00001bed  SYSCFG_DL_initPower           
+00002c5d  SysTick_Handler               
+00002c5d  TIMA0_IRQHandler              
+00002c5d  TIMA1_IRQHandler              
+00002c5d  TIMG0_IRQHandler              
+00002c5d  TIMG12_IRQHandler             
+00002c5d  TIMG6_IRQHandler              
+00002c5d  TIMG7_IRQHandler              
+00002c5d  TIMG8_IRQHandler              
+00002b6b  TI_memcpy_small               
+00002bf9  TI_memset_small               
+00002c5d  UART0_IRQHandler              
+00002c5d  UART1_IRQHandler              
+00002c5d  UART2_IRQHandler              
+00002c5d  UART3_IRQHandler              
+20201000  _CIOBUF_                      
+20201000  __CIOBUF_                     
+20208000  __STACK_END                   
+00000200  __STACK_SIZE                  
+00001000  __SYSMEM_SIZE                 
+00000000  __TI_ATRegion0_region_sz      
+00000000  __TI_ATRegion0_src_addr       
+00000000  __TI_ATRegion0_trg_addr       
+00000000  __TI_ATRegion1_region_sz      
+00000000  __TI_ATRegion1_src_addr       
+00000000  __TI_ATRegion1_trg_addr       
+00000000  __TI_ATRegion2_region_sz      
+00000000  __TI_ATRegion2_src_addr       
+00000000  __TI_ATRegion2_trg_addr       
+00003088  __TI_CINIT_Base               
+00003098  __TI_CINIT_Limit              
+00003098  __TI_CINIT_Warm               
+00003074  __TI_Handler_Table_Base       
+00003080  __TI_Handler_Table_Limit      
+00002309  __TI_auto_init_nobinit_nopinit
+000023b9  __TI_cleanup                  
+20201474  __TI_cleanup_ptr              
+000018c9  __TI_closefile                
+00001945  __TI_decompress_lzss          
+00002b7d  __TI_decompress_none          
+00002001  __TI_doflush                  
+20201478  __TI_dtors_ptr                
+2020147c  __TI_ft_end                   
+ffffffff  __TI_pprof_out_hndl           
+000000c1  __TI_printfi_nofloat          
+ffffffff  __TI_prof_data_size           
+ffffffff  __TI_prof_data_start          
+000023ed  __TI_readmsg                  
+00000000  __TI_static_base__            
+20201120  __TI_tmpnams                  
+00002421  __TI_writemsg                 
+00001c55  __TI_wrt_ok                   
+00002aa3  __TI_zero_init_nomemset       
+00002c70  __aeabi_ctype_table_          
+00002c70  __aeabi_ctype_table_C         
+20201480  __aeabi_errno                 
+00002c2d  __aeabi_errno_addr            
+0000153f  __aeabi_idiv0                 
+00001a3b  __aeabi_ldiv0                 
+00002821  __aeabi_llsl                  
+000027bd  __aeabi_lmul                  
+00002c09  __aeabi_memclr                
+00002c09  __aeabi_memclr4               
+00002c09  __aeabi_memclr8               
+00002c35  __aeabi_memcpy                
+00002c35  __aeabi_memcpy4               
+00002c35  __aeabi_memcpy8               
+00002bc1  __aeabi_memset                
+00002bc1  __aeabi_memset4               
+00002bc1  __aeabi_memset8               
+000021d5  __aeabi_uidiv                 
+000021d5  __aeabi_uidivmod              
+00002b45  __aeabi_uldivmod              
+00002821  __ashldi3                     
+ffffffff  __binit__                     
+UNDEFED   __mpu_init                    
+000027bd  __muldi3                      
+00002345  __muldsi3                     
+20207e00  __stack                       
+20200000  __start___llvm_prf_bits       
+20200000  __start___llvm_prf_cnts       
+20200000  __stop___llvm_prf_bits        
+20200000  __stop___llvm_prf_cnts        
+0000149d  __udivmoddi4                  
+00002701  _c_int00_noargs               
+202013ac  _device                       
+202012bc  _ftable                       
+20201484  _lock                         
+00001e9b  _nop                          
+20201424  _stream                       
+20200000  _sys_memory                   
+UNDEFED   _system_post_cinit            
+00002c65  _system_pre_init              
+20201488  _unlock                       
+00002c69  abort                         
+00000e39  aligned_alloc                 
+00002215  atoi                          
+2020125c  batteries                     
+20201294  battery_data                  
+ffffffff  binit                         
+000020f5  close                         
+00002455  exit                          
+00002489  finddevice                    
+00001681  fputc                         
+00000f4d  fputs                         
+0000112d  free                          
+00002c4d  fseek                         
+00001b15  fseeko                        
+202011c0  gI2C                          
+202012a0  gRxADCcount                   
+202012a4  gRxADClen                     
+202012b8  gRxComplete                   
+2020126c  gRxPacket                     
+202012a8  gTxADCcount                   
+202012ac  gTxADClen                     
+202012b9  gTxComplete                   
+2020127c  gTxPacket                     
+00001b81  getdevice                     
+00000000  interruptVectors              
+000026b1  lseek                         
+000017b5  main                          
+00002c15  malloc                        
+00000e39  memalign                      
+000027e1  memccpy                       
+2020128c  parmbuf                       
+202012ba  piRxComplete                  
+202012b0  piRxCount                     
+202012bb  piTxComplete                  
+202012b4  piTxCount                     
+00001e9d  printf                        
+00002c55  remove                        
+000012f5  setvbuf                       
+00001841  strcmp                        
+0000251d  unlink                        
+00002ba1  wcslen                        
+000026d9  write                         
+
+
+GLOBAL SYMBOLS: SORTED BY Symbol Address 
+
+address   name                          
+-------   ----                          
+00000000  __TI_ATRegion0_region_sz      
+00000000  __TI_ATRegion0_src_addr       
+00000000  __TI_ATRegion0_trg_addr       
+00000000  __TI_ATRegion1_region_sz      
+00000000  __TI_ATRegion1_src_addr       
+00000000  __TI_ATRegion1_trg_addr       
+00000000  __TI_ATRegion2_region_sz      
+00000000  __TI_ATRegion2_src_addr       
+00000000  __TI_ATRegion2_trg_addr       
+00000000  __TI_static_base__            
+00000000  interruptVectors              
+000000c1  __TI_printfi_nofloat          
+00000200  __STACK_SIZE                  
+00000929  ADC_ReadData                  
+00000af1  I2C0_IRQHandler               
+00000cad  I2C1_IRQHandler               
+00000e39  aligned_alloc                 
+00000e39  memalign                      
+00000f4d  fputs                         
+00001000  __SYSMEM_SIZE                 
+00001045  Battery_StateUpdate           
+0000112d  free                          
+00001215  ADC_ConstructConfigBytes      
+000012f5  setvbuf                       
+000013d5  ADC_SetConfigurationBytes     
+0000149d  __udivmoddi4                  
+0000153f  __aeabi_idiv0                 
+00001541  Battery_UpdateCurrentVoltage  
+000015e1  Multiplexer_SelectChannel     
+00001681  fputc                         
+0000171d  ADC_ConvertToVoltage          
+000017b5  main                          
+00001841  strcmp                        
+000018c9  __TI_closefile                
+00001945  __TI_decompress_lzss          
+000019c1  SYSCFG_DL_GPIO_init           
+00001a3b  __aeabi_ldiv0                 
+00001a3d  HOSTlseek                     
+00001aa9  HOSTrename                    
+00001b15  fseeko                        
+00001b81  getdevice                     
+00001bed  SYSCFG_DL_initPower           
+00001c55  __TI_wrt_ok                   
+00001d1d  DL_I2C_fillTargetTXFIFO       
+00001d7d  HOSTopen                      
+00001ddd  SYSCFG_DL_I2C_target_init     
+00001e3d  DL_I2C_fillControllerTXFIFO   
+00001e9b  _nop                          
+00001e9d  printf                        
+00001ef9  HOSTread                      
+00001f51  HOSTwrite                     
+00001fa9  SYSCFG_DL_I2C_controller_init 
+00002001  __TI_doflush                  
+000020f5  close                         
+00002145  HOSTclose                     
+0000218d  HOSTunlink                    
+000021d5  __aeabi_uidiv                 
+000021d5  __aeabi_uidivmod              
+00002215  atoi                          
+00002291  DL_I2C_flushControllerTXFIFO  
+000022cd  DL_I2C_flushTargetTXFIFO      
+00002309  __TI_auto_init_nobinit_nopinit
+00002345  __muldsi3                     
+000023b9  __TI_cleanup                  
+000023ed  __TI_readmsg                  
+00002421  __TI_writemsg                 
+0000244d  C$$IO$$                       
+00002455  exit                          
+00002489  finddevice                    
+000024bd  I2C_init                      
+0000251d  unlink                        
+00002661  SYSCFG_DL_CRC_init            
+000026b1  lseek                         
+000026d9  write                         
+00002701  _c_int00_noargs               
+0000274f  DL_I2C_setClockConfig         
+000027bd  __aeabi_lmul                  
+000027bd  __muldi3                      
+000027e1  memccpy                       
+00002803  SYSCFG_DL_SYSCTL_init         
+00002821  __aeabi_llsl                  
+00002821  __ashldi3                     
+00002905  SYSCFG_DL_init                
+00002aa3  __TI_zero_init_nomemset       
+00002b45  __aeabi_uldivmod              
+00002b6b  TI_memcpy_small               
+00002b7d  __TI_decompress_none          
+00002ba1  wcslen                        
+00002bc1  __aeabi_memset                
+00002bc1  __aeabi_memset4               
+00002bc1  __aeabi_memset8               
+00002bf9  TI_memset_small               
+00002c09  __aeabi_memclr                
+00002c09  __aeabi_memclr4               
+00002c09  __aeabi_memclr8               
+00002c15  malloc                        
+00002c21  DL_Common_delayCycles         
+00002c2d  __aeabi_errno_addr            
+00002c35  __aeabi_memcpy                
+00002c35  __aeabi_memcpy4               
+00002c35  __aeabi_memcpy8               
+00002c4d  fseek                         
+00002c55  remove                        
+00002c5d  ADC0_IRQHandler               
+00002c5d  ADC1_IRQHandler               
+00002c5d  AES_IRQHandler                
+00002c5d  CANFD0_IRQHandler             
+00002c5d  DAC0_IRQHandler               
+00002c5d  DMA_IRQHandler                
+00002c5d  Default_Handler               
+00002c5d  GROUP0_IRQHandler             
+00002c5d  GROUP1_IRQHandler             
+00002c5d  HardFault_Handler             
+00002c5d  NMI_Handler                   
+00002c5d  PendSV_Handler                
+00002c5d  RTC_IRQHandler                
+00002c5d  SPI0_IRQHandler               
+00002c5d  SPI1_IRQHandler               
+00002c5d  SVC_Handler                   
+00002c5d  SysTick_Handler               
+00002c5d  TIMA0_IRQHandler              
+00002c5d  TIMA1_IRQHandler              
+00002c5d  TIMG0_IRQHandler              
+00002c5d  TIMG12_IRQHandler             
+00002c5d  TIMG6_IRQHandler              
+00002c5d  TIMG7_IRQHandler              
+00002c5d  TIMG8_IRQHandler              
+00002c5d  UART0_IRQHandler              
+00002c5d  UART1_IRQHandler              
+00002c5d  UART2_IRQHandler              
+00002c5d  UART3_IRQHandler              
+00002c61  Reset_Handler                 
+00002c65  _system_pre_init              
+00002c68  C$$EXIT                       
+00002c69  abort                         
+00002c70  __aeabi_ctype_table_          
+00002c70  __aeabi_ctype_table_C         
+00003074  __TI_Handler_Table_Base       
+00003080  __TI_Handler_Table_Limit      
+00003088  __TI_CINIT_Base               
+00003098  __TI_CINIT_Limit              
+00003098  __TI_CINIT_Warm               
+20200000  __start___llvm_prf_bits       
+20200000  __start___llvm_prf_cnts       
+20200000  __stop___llvm_prf_bits        
+20200000  __stop___llvm_prf_cnts        
+20200000  _sys_memory                   
+20201000  _CIOBUF_                      
+20201000  __CIOBUF_                     
+20201120  __TI_tmpnams                  
+202011c0  gI2C                          
+2020125c  batteries                     
+2020126c  gRxPacket                     
+2020127c  gTxPacket                     
+2020128c  parmbuf                       
+20201294  battery_data                  
+202012a0  gRxADCcount                   
+202012a4  gRxADClen                     
+202012a8  gTxADCcount                   
+202012ac  gTxADClen                     
+202012b0  piRxCount                     
+202012b4  piTxCount                     
+202012b8  gRxComplete                   
+202012b9  gTxComplete                   
+202012ba  piRxComplete                  
+202012bb  piTxComplete                  
+202012bc  _ftable                       
+202013ac  _device                       
+20201424  _stream                       
+20201474  __TI_cleanup_ptr              
+20201478  __TI_dtors_ptr                
+2020147c  __TI_ft_end                   
+20201480  __aeabi_errno                 
+20201484  _lock                         
+20201488  _unlock                       
+20207e00  __stack                       
+20208000  __STACK_END                   
+ffffffff  __TI_pprof_out_hndl           
+ffffffff  __TI_prof_data_size           
+ffffffff  __TI_prof_data_start          
+ffffffff  __binit__                     
+ffffffff  binit                         
+UNDEFED   __mpu_init                    
+UNDEFED   _system_post_cinit            
+
+[184 symbols]

文件差異過大導致無法顯示
+ 576 - 605
Debug/charge_controller_v7_linkInfo.xml


+ 0 - 0
charge_controller_v7/Debug/dac.d → Debug/dac.d


+ 0 - 0
charge_controller_v7/Debug/dac.o → Debug/dac.o


+ 0 - 0
charge_controller_v7/Debug/device.cmd.genlibs → Debug/device.cmd.genlibs


+ 0 - 0
charge_controller_v7/Debug/device.opt → Debug/device.opt


+ 0 - 0
charge_controller_v7/Debug/device_linker.cmd → Debug/device_linker.cmd


+ 3 - 1
charge_controller_v7/Debug/i2c_controller.d → Debug/i2c_controller.d

@@ -1,6 +1,6 @@
 # FIXED
 
-i2c_controller.o: ../i2c_controller.c \
+i2c_controller.o: ../i2c_controller.c ../i2c_target.h ../battery.h \
  /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_dac12.h \
  /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_adc12.h \
  /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/msp.h \
@@ -77,6 +77,8 @@ i2c_controller.o: ../i2c_controller.c \
  /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/m0p/dl_systick.h \
  ../ti/comm_modules/i2c/controller/i2c_comm_controller.h \
  ../multiplexer.h ../adc.h ../dac.h
+../i2c_target.h:
+../battery.h:
 /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_dac12.h:
 /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_adc12.h:
 /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/msp.h:

+ 154 - 0
Debug/i2c_target.d

@@ -0,0 +1,154 @@
+# FIXED
+
+i2c_target.o: ../i2c_target.c ../i2c_target.h ../battery.h ../adc.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_i2c.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/msp.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/DeviceFamily.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/m0p/mspm0g350x.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/third_party/CMSIS/Core/Include/core_cm0plus.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_adc12.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_aes.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_comp.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_crc.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_dac12.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_dma.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_flashctl.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_gpio.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_gptimer.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_i2c.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_iomux.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_mathacl.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_mcan.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_oa.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_rtc.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_spi.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_trng.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_uart.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_vref.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_wuc.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_wwdt.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/m0p/hw_factoryregion.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/m0p/hw_cpuss.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/m0p/hw_debugss.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/m0p/hw_sysctl.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/m0p/sysctl/hw_sysctl_mspm0g1x0x_g3x0x.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_common.h \
+ ti_msp_dl_config.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/driverlib.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_adc12.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/m0p/dl_factoryregion.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/m0p/dl_core.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_aes.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_aesadv.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_comp.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_crc.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_crcp.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_dac12.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_dma.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_flashctl.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/m0p/dl_sysctl.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/m0p/sysctl/dl_sysctl_mspm0g1x0x_g3x0x.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_gpamp.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_gpio.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_iwdt.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_lfss.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_keystorectl.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_lcd.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_mathacl.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_mcan.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_opa.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_rtc.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_rtc_common.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_rtc_a.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_rtc_b.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_scratchpad.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_spi.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_tamperio.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_timera.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_timer.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_timerg.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_trng.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_uart_extend.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_uart.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_uart_main.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_vref.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_wwdt.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/m0p/dl_interrupt.h \
+ /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/m0p/dl_systick.h
+../i2c_target.h:
+../battery.h:
+../adc.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_i2c.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/msp.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/DeviceFamily.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/m0p/mspm0g350x.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/third_party/CMSIS/Core/Include/core_cm0plus.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_adc12.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_aes.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_comp.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_crc.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_dac12.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_dma.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_flashctl.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_gpio.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_gptimer.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_i2c.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_iomux.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_mathacl.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_mcan.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_oa.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_rtc.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_spi.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_trng.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_uart.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_vref.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_wuc.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/hw_wwdt.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/m0p/hw_factoryregion.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/m0p/hw_cpuss.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/m0p/hw_debugss.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/m0p/hw_sysctl.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/devices/msp/peripherals/m0p/sysctl/hw_sysctl_mspm0g1x0x_g3x0x.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_common.h:
+ti_msp_dl_config.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/driverlib.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_adc12.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/m0p/dl_factoryregion.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/m0p/dl_core.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_aes.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_aesadv.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_comp.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_crc.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_crcp.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_dac12.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_dma.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_flashctl.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/m0p/dl_sysctl.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/m0p/sysctl/dl_sysctl_mspm0g1x0x_g3x0x.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_gpamp.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_gpio.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_iwdt.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_lfss.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_keystorectl.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_lcd.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_mathacl.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_mcan.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_opa.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_rtc.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_rtc_common.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_rtc_a.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_rtc_b.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_scratchpad.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_spi.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_tamperio.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_timera.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_timer.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_timerg.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_trng.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_uart_extend.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_uart.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_uart_main.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_vref.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/dl_wwdt.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/m0p/dl_interrupt.h:
+/home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/m0p/dl_systick.h:

二進制
Debug/i2c_target.o


+ 0 - 0
charge_controller_v7/Debug/makefile → Debug/makefile


+ 0 - 0
charge_controller_v7/Debug/multiplexer.d → Debug/multiplexer.d


+ 0 - 0
charge_controller_v7/Debug/multiplexer.o → Debug/multiplexer.o


+ 0 - 0
charge_controller_v7/Debug/objects.mk → Debug/objects.mk


+ 0 - 0
charge_controller_v7/Debug/sources.mk → Debug/sources.mk


+ 0 - 0
charge_controller_v7/Debug/startup_mspm0g350x_ticlang.d → Debug/startup_mspm0g350x_ticlang.d


+ 0 - 0
charge_controller_v7/Debug/startup_mspm0g350x_ticlang.o → Debug/startup_mspm0g350x_ticlang.o


+ 0 - 0
charge_controller_v7/Debug/subdir_rules.mk → Debug/subdir_rules.mk


+ 0 - 0
charge_controller_v7/Debug/subdir_vars.mk → Debug/subdir_vars.mk


+ 0 - 0
charge_controller_v7/Debug/ti/comm_modules/i2c/controller/i2c_comm_controller.d → Debug/ti/comm_modules/i2c/controller/i2c_comm_controller.d


+ 0 - 0
charge_controller_v7/Debug/ti/comm_modules/i2c/controller/i2c_comm_controller.o → Debug/ti/comm_modules/i2c/controller/i2c_comm_controller.o


+ 0 - 0
charge_controller_v7/Debug/ti/comm_modules/i2c/controller/subdir_rules.mk → Debug/ti/comm_modules/i2c/controller/subdir_rules.mk


+ 0 - 0
charge_controller_v7/Debug/ti/comm_modules/i2c/controller/subdir_vars.mk → Debug/ti/comm_modules/i2c/controller/subdir_vars.mk


+ 0 - 0
charge_controller_v7/Debug/ti_msp_dl_config.c → Debug/ti_msp_dl_config.c


+ 0 - 0
charge_controller_v7/Debug/ti_msp_dl_config.d → Debug/ti_msp_dl_config.d


+ 0 - 0
charge_controller_v7/Debug/ti_msp_dl_config.h → Debug/ti_msp_dl_config.h


+ 0 - 0
charge_controller_v7/Debug/ti_msp_dl_config.o → Debug/ti_msp_dl_config.o


+ 0 - 0
charge_controller_v7/README.html → README.html


+ 0 - 0
charge_controller_v7/README.md → README.md


+ 32 - 15
charge_controller_v7/adc.c → adc.c

@@ -1,7 +1,9 @@
 #include <adc.h>
 #include <stdint.h>
 #include <stdio.h>
+#include "battery.h"
 #include "ti/driverlib/dl_i2c.h"
+#include "ti/driverlib/m0p/dl_core.h"
 #include "ti_msp_dl_config.h"
 
 volatile bool gRxComplete;
@@ -41,15 +43,17 @@ uint8_t ADC_ConstructConfigBytes(ADC_PARAMS params) {
 /* Tansmit Data from MCU to ADC:  Function to SET configuration to ADC over I2C*/
 
 void ADC_SetConfigurationBytes(ADC_PARAMS params) {
-    // **Step 1: Construct Configuration Byte**
+    // **Construct Configuration Byte**
     uint8_t config_byte = ADC_ConstructConfigBytes(params);
 
-    //printf("Writing Config: 0x%02X to ADC (0x%X)...\n", config_byte, DEF_TARGET_ADDR_ADC);
+    //uint8_t adc_address= ADC_TARGET_BASE_ADDRESS + slot_id;
 
-    // **Step 2: Wait for I2C Bus to be Free**
+    printf("Writing Config: 0x%02X to ADC (0x%X)...\n", config_byte, ADC_TARGET_BASE_ADDRESS);
+
+    // Wait for I2C Bus to be Free**
     while (DL_I2C_getControllerStatus(I2C_controller_INST) & DL_I2C_CONTROLLER_STATUS_BUSY_BUS);
 
-    // **Step 3: Start I2C Write Transaction**
+    // **Start I2C Write Transaction**
     // Prepare TX Buffer:
     gTxPacket[0]= config_byte;
     gTxADClen= 1;
@@ -57,14 +61,9 @@ void ADC_SetConfigurationBytes(ADC_PARAMS params) {
     gTxComplete= true;
     DL_I2C_startControllerTransfer(I2C_controller_INST, ADC_TARGET_BASE_ADDRESS, DL_I2C_CONTROLLER_DIRECTION_TX, gTxADClen);
     DL_I2C_enableInterrupt(I2C_controller_INST, DL_I2C_INTERRUPT_CONTROLLER_TXFIFO_TRIGGER);
-
     while(!gTxComplete);
-    // **Load Configuration Byte into TX FIFO**
-    //DL_I2C_fillControllerTXFIFO(I2C_controller_INST, &config_byte, 1);
-
     // **Ensure STOP Condition is Sent**
     while (DL_I2C_getControllerStatus(I2C_controller_INST) & DL_I2C_CONTROLLER_STATUS_BUSY_BUS);
-    
     printf("Configuration Sent Successfully for 0x%X!\n", config_byte);
 }
 
@@ -100,7 +99,7 @@ Function to read ADC DATA: This function simply retrieves the ADC raw digital ou
     - Equation 4.4 is being used to convert the output codes to input voltage
 */
 
-int16_t ADC_ReadData(ADC_PARAMS params)
+int16_t ADC_ReadData(uint8_t slot_id, ADC_PARAMS params)
 {
     uint8_t adc_data[3] = {0};  // Buffer for ADC data (MSB, LSB, Config Byte)
     int16_t raw_adc = 0;
@@ -109,8 +108,9 @@ int16_t ADC_ReadData(ADC_PARAMS params)
     in 16 bit conversion mode the MSB(=sign bit) of the first data type is D15.
     */
     uint8_t bytes_to_read= 3;
-    
+    uint8_t adc_address= ADC_TARGET_BASE_ADDRESS + slot_id;
     printf("Reading ADC Data from MCP3428...\n");
+    delay_cycles(100000);
     while (DL_I2C_getControllerStatus(I2C_controller_INST) & DL_I2C_CONTROLLER_STATUS_BUSY_BUS);
 
     // Determine bytes to read
@@ -121,14 +121,20 @@ int16_t ADC_ReadData(ADC_PARAMS params)
     gRxADCcount= 0;
     gRxComplete= false;
 
-    DL_I2C_startControllerTransfer(I2C_controller_INST, ADC_TARGET_BASE_ADDRESS, DL_I2C_CONTROLLER_DIRECTION_RX, gRxADClen);
+    DL_I2C_startControllerTransfer(I2C_controller_INST, adc_address, DL_I2C_CONTROLLER_DIRECTION_RX, gRxADClen);
     DL_I2C_enableInterrupt(I2C_controller_INST, DL_I2C_INTERRUPT_CONTROLLER_RXFIFO_TRIGGER);
-    //while(!gRxComplete);
+    delay_cycles(100000);
+    while(!gRxComplete);
+        
+    
     while (DL_I2C_getControllerStatus(I2C_controller_INST) & DL_I2C_CONTROLLER_STATUS_BUSY_BUS);
     uint8_t config_adc_byte= gRxPacket[2];
     uint8_t msb= gRxPacket[0];
     uint8_t lsb= gRxPacket[1];
 
+    uint8_t gain_setting = (config_adc_byte & 0x03);
+    uint8_t gain_multiplier = (1 << gain_setting); // Gain values: 1, 2, 4, 8
+
     if (params.resolution==16){
         raw_adc= (msb << 8)| lsb;
         if(raw_adc > 32767) raw_adc-= 65536;
@@ -142,6 +148,8 @@ int16_t ADC_ReadData(ADC_PARAMS params)
         if (raw_adc > 2047) raw_adc -= 4096; 
 
     }
+
+    printf("Gain %d: \n", gain_multiplier);
     printf("Raw ADC Value: 0x%0X (%d)\n", raw_adc, raw_adc);
     return raw_adc;
    
@@ -174,10 +182,19 @@ uint16_t ADC_ConvertToVoltage(int16_t adc_value, ADC_PARAMS params) {
     /*Formula for ADC to Voltage Conversion*/
     //voltage = (adc_value / max_adc_value)* VREF/gain;
    
-    printf("Converted Voltage: %d mV\n", measured_voltage);
+    //printf("Converted Voltage: %d mV\n", measured_voltage);
     return (uint16_t)measured_voltage;
 }
 
+void Battery_UpdateCurrentVoltage(ADC_PARAMS params){
+    for(uint8_t slot=0; slot< NUM_SLOTS; slot++ ){
+        //Set Configuration
+        //ADC_SetConfigurationBytes(slot, params);
+        //Voltage Setup
+        int16_t raw_adc_voltage= ADC_ReadData(slot, params);
+        batteries[slot].voltage= ADC_ConvertToVoltage(raw_adc_voltage, params);   
+        printf("Battery Voltage for slot %d is %u mV.\n", slot, batteries[slot].voltage);
+        }
 
-
+}
 

+ 2 - 1
charge_controller_v7/adc.h → adc.h

@@ -28,7 +28,8 @@ typedef struct{
 
 uint8_t ADC_ConstructConfigBytes(ADC_PARAMS params);
 void ADC_SetConfigurationBytes(ADC_PARAMS params);
-int16_t ADC_ReadData(ADC_PARAMS params);
+int16_t ADC_ReadData(uint8_t slot_id, ADC_PARAMS params);
 uint16_t ADC_ConvertToVoltage(int16_t adc_value, ADC_PARAMS params);
+void Battery_UpdateCurrentVoltage(ADC_PARAMS params);
 
 #endif

+ 0 - 3
charge_controller_v7/battery.c → battery.c

@@ -1,8 +1,5 @@
 #include "battery.h"
 
-
-
-
 Battery batteries[NUM_SLOTS];
 
 // Permissible charge temperature for LiIon battery is 0.0 degree Celsius to 45.0 degree Celsius

+ 3 - 3
charge_controller_v7/battery.h → battery.h

@@ -4,13 +4,13 @@
 
 //define macro to be used by multiple files in the program witout the variable being overwritten
 
-#define NUM_SLOTS              (8)
+#define NUM_SLOTS              (1)
 
 typedef enum{
     STATE_EMPTY= 0x01,
     STATE_BATTERY_DETECTED= 0x02,
-    STATE_MEASUREMENT= 0x03,
-    STATE_MEASUREMENT_IN_PROGESS= 0x04,
+    STATE_MEASUREMENT_IN_PROGRESS= 0x03,
+    STATE_MEASUREMENT_DONE= 0x04,
     STATE_OVERCHARGING= 0x05
 } BatteryState;
 

二進制
charge_controller_v7/Debug/.clangd/.cache/clangd/index/adc.c.C783CB560A28832A.idx


二進制
charge_controller_v7/Debug/.clangd/.cache/clangd/index/adc.h.4254346EB7A93BD8.idx


二進制
charge_controller_v7/Debug/.clangd/.cache/clangd/index/battery.c.900D8F73FDE164C8.idx


二進制
charge_controller_v7/Debug/.clangd/.cache/clangd/index/battery.h.DD363DA997E60BB9.idx


二進制
charge_controller_v7/Debug/.clangd/.cache/clangd/index/i2c_controller.c.D084D0AF1C0F98F4.idx


二進制
charge_controller_v7/Debug/.clangd/.cache/clangd/index/i2c_target.c.81C6743683C30173.idx


二進制
charge_controller_v7/Debug/.clangd/.cache/clangd/index/i2c_target.h.4BFCCCED038EBB00.idx


二進制
charge_controller_v7/Debug/adc.o


二進制
charge_controller_v7/Debug/battery.o


+ 0 - 766
charge_controller_v7/Debug/charge_controller_v7.map

@@ -1,766 +0,0 @@
-******************************************************************************
-            TI ARM Clang Linker Unix v4.0.0                    
-******************************************************************************
->> Linked Wed Mar  5 15:47:08 2025
-
-OUTPUT FILE NAME:   <charge_controller_v7.out>
-ENTRY POINT SYMBOL: "_c_int00_noargs"  address: 00002679
-
-
-MEMORY CONFIGURATION
-
-         name            origin    length      used     unused   attr    fill
-----------------------  --------  ---------  --------  --------  ----  --------
-  FLASH                 00000000   00020000  00003090  0001cf70  R  X
-  SRAM                  20200000   00008000  00001777  00006889  RW X
-  BCR_CONFIG            41c00000   00000080  00000000  00000080  R   
-  BSL_CONFIG            41c00100   00000080  00000000  00000080  R   
-
-
-SEGMENT ALLOCATION MAP
-
-run origin  load origin   length   init length attrs members
-----------  ----------- ---------- ----------- ----- -------
-00000000    00000000    00003090   00003090    r-x
-  00000000    00000000    000000c0   000000c0    r-- .intvecs
-  000000c0    000000c0    00002b30   00002b30    r-x .text
-  00002bf0    00002bf0    00000410   00000410    r-- .rodata
-  00003000    00003000    00000090   00000090    r-- .cinit
-20200000    20200000    0000157a   00000000    rw-
-  20200000    20200000    00001000   00000000    rw- .sysmem
-  20201000    20201000    000002d5   00000000    rw- .data
-  202012d8    202012d8    000002a2   00000000    rw- .bss
-20207e00    20207e00    00000200   00000000    rw-
-  20207e00    20207e00    00000200   00000000    rw- .stack
-
-
-SECTION ALLOCATION MAP
-
- output                                  attributes/
-section   page    origin      length       input sections
---------  ----  ----------  ----------   ----------------
-.intvecs   0    00000000    000000c0     
-                  00000000    000000c0     startup_mspm0g350x_ticlang.o (.intvecs)
-
-.text      0    000000c0    00002b30     
-                  000000c0    00000868     libc.a : _printfi.c.obj (.text:__TI_printfi_nofloat)
-                  00000928    0000019c     i2c_controller.o (.text.I2C0_IRQHandler)
-                  00000ac4    00000178     adc.o (.text.ADC_ReadData)
-                  00000c3c    00000170     i2c_controller.o (.text.I2C1_IRQHandler)
-                  00000dac    00000114     libc.a : memory.c.obj (.text.aligned_alloc)
-                  00000ec0    000000f8            : fputs.c.obj (.text.fputs)
-                  00000fb8    000000e8            : memory.c.obj (.text.free)
-                  000010a0    000000e0     adc.o (.text.ADC_ConstructConfigBytes)
-                  00001180    000000e0     libc.a : setvbuf.c.obj (.text.setvbuf)
-                  00001260    000000bc     i2c_controller.o (.text.main)
-                  0000131c    000000b8     adc.o (.text.ADC_SetConfigurationBytes)
-                  000013d4    000000ac     dac.o (.text.DAC_fastWrite)
-                  00001480    000000a4     adc.o (.text.ADC_ConvertToVoltage)
-                  00001524    000000a2     libclang_rt.builtins.a : udivmoddi4.S.obj (.text)
-                  000015c6    00000002                            : aeabi_div0.c.obj (.text.__aeabi_idiv0)
-                  000015c8    000000a0     multiplexer.o (.text.Multiplexer_SelectChannel)
-                  00001668    0000009c     libc.a : fputc.c.obj (.text.fputc)
-                  00001704    0000000c     libclang_rt.builtins.a : aeabi_memset.S.obj (.text.__aeabi_memclr)
-                  00001710    00000088     libc.a : strcmp-armv6m.S.obj (.text:strcmp)
-                  00001798    0000007c            : fclose.c.obj (.text.__TI_closefile)
-                  00001814    0000007c            : copy_decompress_lzss.c.obj (.text:decompress:lzss)
-                  00001890    0000007a     ti_msp_dl_config.o (.text.SYSCFG_DL_GPIO_init)
-                  0000190a    00000002     libclang_rt.builtins.a : aeabi_div0.c.obj (.text.__aeabi_ldiv0)
-                  0000190c    0000006c     libsysbm.a : hostlseek.c.obj (.text.HOSTlseek)
-                  00001978    0000006c                : hostrename.c.obj (.text.HOSTrename)
-                  000019e4    0000006c     libc.a : fseek.c.obj (.text.fseeko)
-                  00001a50    0000006c            : getdevice.c.obj (.text.getdevice)
-                  00001abc    00000068     ti_msp_dl_config.o (.text.SYSCFG_DL_initPower)
-                  00001b24    00000064     libc.a : _io_perm.c.obj (.text.__TI_wrt_ok)
-                  00001b88    00000064            : memory.c.obj (.text.split)
-                  00001bec    00000060     driverlib.a : dl_i2c.o (.text.DL_I2C_fillTargetTXFIFO)
-                  00001c4c    00000060     libsysbm.a : hostopen.c.obj (.text.HOSTopen)
-                  00001cac    00000060     ti_msp_dl_config.o (.text.SYSCFG_DL_I2C_target_init)
-                  00001d0c    0000005e     driverlib.a : dl_i2c.o (.text.DL_I2C_fillControllerTXFIFO)
-                  00001d6a    00000002     libc.a : _lock.c.obj (.text._nop)
-                  00001d6c    0000005c     dac.o (.text.DAC_UpdateOutput)
-                  00001dc8    0000005c     libc.a : printf.c.obj (.text.printf)
-                  00001e24    00000058     libsysbm.a : hostread.c.obj (.text.HOSTread)
-                  00001e7c    00000058                : hostwrite.c.obj (.text.HOSTwrite)
-                  00001ed4    00000058     ti_msp_dl_config.o (.text.SYSCFG_DL_I2C_controller_init)
-                  00001f2c    00000052     libc.a : fflush.c.obj (.text.__TI_doflush)
-                  00001f7e    00000002     --HOLE-- [fill = 0]
-                  00001f80    00000050     adc.o (.text.DL_I2C_startControllerTransfer)
-                  00001fd0    00000050     dac.o (.text.DL_I2C_startControllerTransfer)
-                  00002020    00000050     multiplexer.o (.text.DL_I2C_startControllerTransfer)
-                  00002070    00000050     libsysbm.a : close.c.obj (.text.close)
-                  000020c0    00000048                : hostclose.c.obj (.text.HOSTclose)
-                  00002108    00000048                : hostunlink.c.obj (.text.HOSTunlink)
-                  00002150    00000040     libclang_rt.builtins.a : aeabi_uidivmod.S.obj (.text.__aeabi_uidivmod)
-                  00002190    00000040     libc.a : atoi.c.obj (.text.atoi)
-                  000021d0    0000003c     ti_msp_dl_config.o (.text.DL_GPIO_initPeripheralInputFunctionFeatures)
-                  0000220c    0000003c     driverlib.a : dl_i2c.o (.text.DL_I2C_flushControllerTXFIFO)
-                  00002248    0000003c                 : dl_i2c.o (.text.DL_I2C_flushTargetTXFIFO)
-                  00002284    0000003c     libc.a : autoinit.c.obj (.text:__TI_auto_init_nobinit_nopinit)
-                  000022c0    0000003a     libclang_rt.builtins.a : muldsi3.S.obj (.text.__muldsi3)
-                  000022fa    00000038     ti_msp_dl_config.o (.text.DL_CRC_init)
-                  00002332    00000002     --HOLE-- [fill = 0]
-                  00002334    00000034     libc.a : fopen.c.obj (.text.__TI_cleanup)
-                  00002368    00000034     libsysbm.a : trgmsg.c.obj (.text.__TI_readmsg)
-                  0000239c    00000034                : trgmsg.c.obj (.text.__TI_writemsg)
-                  000023d0    00000034     libc.a : exit.c.obj (.text.exit)
-                  00002404    00000034            : getdevice.c.obj (.text.finddevice)
-                  00002438    00000032     i2c_comm_controller.o (.text.I2C_init)
-                  0000246a    00000002     --HOLE-- [fill = 0]
-                  0000246c    0000002c     libsysbm.a : unlink.c.obj (.text.unlink)
-                  00002498    00000028     adc.o (.text.DL_Common_updateReg)
-                  000024c0    00000028     dac.o (.text.DL_Common_updateReg)
-                  000024e8    00000028     multiplexer.o (.text.DL_Common_updateReg)
-                  00002510    00000028     ti_msp_dl_config.o (.text.DL_Common_updateReg)
-                  00002538    00000028     ti_msp_dl_config.o (.text.DL_I2C_setControllerRXFIFOThreshold)
-                  00002560    00000028     ti_msp_dl_config.o (.text.DL_I2C_setControllerTXFIFOThreshold)
-                  00002588    00000028     ti_msp_dl_config.o (.text.DL_I2C_setTargetRXFIFOThreshold)
-                  000025b0    00000028     ti_msp_dl_config.o (.text.DL_I2C_setTargetTXFIFOThreshold)
-                  000025d8    00000028     ti_msp_dl_config.o (.text.SYSCFG_DL_CRC_init)
-                  00002600    00000028     libc.a : memory.c.obj (.text.free_list_insert)
-                  00002628    00000028     libsysbm.a : lseek.c.obj (.text.lseek)
-                  00002650    00000028                : write.c.obj (.text.write)
-                  00002678    00000028     libc.a : boot_cortex_m.c.obj (.text:_c_int00_noargs)
-                  000026a0    00000026     ti_msp_dl_config.o (.text.DL_I2C_setAnalogGlitchFilterPulseWidth)
-                  000026c6    00000026     driverlib.a : dl_i2c.o (.text.DL_I2C_setClockConfig)
-                  000026ec    00000024     ti_msp_dl_config.o (.text.DL_CRC_setSeed16)
-                  00002710    00000024     ti_msp_dl_config.o (.text.DL_I2C_setTargetOwnAddress)
-                  00002734    00000024     libclang_rt.builtins.a : muldi3.S.obj (.text.__muldi3)
-                  00002758    00000022     libc.a : memccpy.c.obj (.text.memccpy)
-                  0000277a    0000001e     ti_msp_dl_config.o (.text.SYSCFG_DL_SYSCTL_init)
-                  00002798    0000001e     libclang_rt.builtins.a : ashldi3.S.obj (.text.__ashldi3)
-                  000027b6    00000002     --HOLE-- [fill = 0]
-                  000027b8    0000001c     ti_msp_dl_config.o (.text.DL_GPIO_enableHiZ)
-                  000027d4    0000001c     ti_msp_dl_config.o (.text.DL_I2C_disableTargetWakeup)
-                  000027f0    0000001c     adc.o (.text.DL_I2C_enableInterrupt)
-                  0000280c    0000001c     ti_msp_dl_config.o (.text.DL_I2C_enableInterrupt)
-                  00002828    0000001c     i2c_controller.o (.text.DL_I2C_isControllerRXFIFOEmpty)
-                  00002844    0000001c     i2c_controller.o (.text.DL_I2C_isTargetRXFIFOEmpty)
-                  00002860    0000001c     i2c_controller.o (.text.DL_I2C_isTargetTXFIFOFull)
-                  0000287c    0000001c     ti_msp_dl_config.o (.text.DL_SYSCTL_setSYSOSCFreq)
-                  00002898    0000001c     ti_msp_dl_config.o (.text.SYSCFG_DL_init)
-                  000028b4    0000001c     libc.a : memory.c.obj (.text.free_list_remove)
-                  000028d0    00000018     ti_msp_dl_config.o (.text.DL_CRC_enablePower)
-                  000028e8    00000018     ti_msp_dl_config.o (.text.DL_CRC_reset)
-                  00002900    00000018     ti_msp_dl_config.o (.text.DL_GPIO_enablePower)
-                  00002918    00000018     ti_msp_dl_config.o (.text.DL_GPIO_reset)
-                  00002930    00000018     ti_msp_dl_config.o (.text.DL_I2C_disableAnalogGlitchFilter)
-                  00002948    00000018     ti_msp_dl_config.o (.text.DL_I2C_enableAnalogGlitchFilter)
-                  00002960    00000018     ti_msp_dl_config.o (.text.DL_I2C_enableController)
-                  00002978    00000018     ti_msp_dl_config.o (.text.DL_I2C_enableControllerClockStretching)
-                  00002990    00000018     ti_msp_dl_config.o (.text.DL_I2C_enablePower)
-                  000029a8    00000018     ti_msp_dl_config.o (.text.DL_I2C_enableTarget)
-                  000029c0    00000018     ti_msp_dl_config.o (.text.DL_I2C_enableTargetClockStretching)
-                  000029d8    00000018     ti_msp_dl_config.o (.text.DL_I2C_reset)
-                  000029f0    00000018     ti_msp_dl_config.o (.text.DL_I2C_setTimerPeriod)
-                  00002a08    00000018     ti_msp_dl_config.o (.text.DL_SYSCTL_setBORThreshold)
-                  00002a20    00000016     i2c_comm_controller.o (.text.I2C_clearBuffer)
-                  00002a36    00000016     libc.a : copy_zero_init.c.obj (.text:decompress:ZI:__TI_zero_init_nomemset)
-                  00002a4c    00000014     adc.o (.text.DL_I2C_getControllerStatus)
-                  00002a60    00000014     dac.o (.text.DL_I2C_getControllerStatus)
-                  00002a74    00000014     multiplexer.o (.text.DL_I2C_getControllerStatus)
-                  00002a88    00000014     i2c_controller.o (.text.DL_I2C_receiveControllerData)
-                  00002a9c    00000014     ti_msp_dl_config.o (.text.DL_I2C_resetControllerTransfer)
-                  00002ab0    00000014     ti_msp_dl_config.o (.text.DL_SYSCTL_disableSYSPLL)
-                  00002ac4    00000014     libclang_rt.builtins.a : aeabi_uldivmod.S.obj (.text.__aeabi_uldivmod)
-                  00002ad8    00000012     i2c_controller.o (.text.DL_I2C_getPendingInterrupt)
-                  00002aea    00000012     i2c_controller.o (.text.DL_I2C_receiveTargetData)
-                  00002afc    00000012     libc.a : memcpy16.S.obj (.text:TI_memcpy_small)
-                  00002b0e    00000012            : copy_decompress_none.c.obj (.text:decompress:none)
-                  00002b20    00000010     ti_msp_dl_config.o (.text.DL_SYSCTL_disableHFXT)
-                  00002b30    00000010     libc.a : wcslen.c.obj (.text.wcslen)
-                  00002b40    0000000e            : memory.c.obj (.text.OUTLINED_FUNCTION_0)
-                  00002b4e    00000002     --HOLE-- [fill = 0]
-                  00002b50    0000000e     libclang_rt.builtins.a : aeabi_memset.S.obj (.text.__aeabi_memset)
-                  00002b5e    0000000e     libsysbm.a : hostrename.c.obj (.text.strcpy)
-                  00002b6c    0000000e     libc.a : _printfi.c.obj (.text.strlen)
-                  00002b7a    0000000e     libsysbm.a : hostrename.c.obj (.text.strlen)
-                  00002b88    0000000e     libc.a : memset16.S.obj (.text:TI_memset_small)
-                  00002b96    0000000c            : memory.c.obj (.text.malloc)
-                  00002ba2    0000000a     driverlib.a : dl_common.o (.text.DL_Common_delayCycles)
-                  00002bac    00000008     libc.a : aeabi_portable.c.obj (.text.__aeabi_errno_addr)
-                  00002bb4    00000008     libclang_rt.builtins.a : aeabi_memcpy.S.obj (.text.__aeabi_memcpy)
-                  00002bbc    00000008     libc.a : printf.c.obj (.text._outc)
-                  00002bc4    00000008            : printf.c.obj (.text._outs)
-                  00002bcc    00000008            : fseek.c.obj (.text.fseek)
-                  00002bd4    00000008     libsysbm.a : remove.c.obj (.text.remove)
-                  00002bdc    00000004     startup_mspm0g350x_ticlang.o (.text.Default_Handler)
-                  00002be0    00000004     startup_mspm0g350x_ticlang.o (.text.Reset_Handler)
-                  00002be4    00000004     libc.a : pre_init.c.obj (.text._system_pre_init)
-                  00002be8    00000004            : exit.c.obj (.text:abort)
-                  00002bec    00000004     --HOLE-- [fill = 0]
-
-.cinit     0    00003000    00000090     
-                  00003000    0000006b     (.cinit..data.load) [load image, compression = lzss]
-                  0000306b    00000001     --HOLE-- [fill = 0]
-                  0000306c    0000000c     (__TI_handler_table)
-                  00003078    00000008     (.cinit..bss.load) [load image, compression = zero_init]
-                  00003080    00000010     (__TI_cinit_table)
-
-.rodata    0    00002bf0    00000410     
-                  00002bf0    00000101     libc.a : aeabi_ctype.S.obj (.rodata:__aeabi_ctype_table_)
-                  00002cf1    00000047     dac.o (.rodata.str1.33751144865972066941)
-                  00002d38    00000039     i2c_controller.o (.rodata.str1.179063319387908962991)
-                  00002d71    00000037     dac.o (.rodata.str1.34553258332827326251)
-                  00002da8    00000036     i2c_controller.o (.rodata.str1.58202964110805887911)
-                  00002dde    00000032     multiplexer.o (.rodata.str1.29362095947798716951)
-                  00002e10    0000002b     adc.o (.rodata.str1.41407442172756317641)
-                  00002e3b    00000027     multiplexer.o (.rodata.str1.92445539561215715011)
-                  00002e62    00000022     adc.o (.rodata.str1.25441403197361701961)
-                  00002e84    00000020     adc.o (.rodata.str1.135499725018448954211)
-                  00002ea4    0000001f     i2c_controller.o (.rodata.str1.45413293569381271681)
-                  00002ec3    0000001c     adc.o (.rodata.str1.119342513474743631991)
-                  00002edf    0000001c     dac.o (.rodata.str1.56540470949982058171)
-                  00002efb    0000001c     i2c_controller.o (.rodata.str1.91043755832811627921)
-                  00002f17    0000001b     adc.o (.rodata.str1.75598629454301647491)
-                  00002f32    0000001b     i2c_controller.o (.rodata.str1.89005588678899653321)
-                  00002f4d    0000001a     adc.o (.rodata.str1.47019157895356604021)
-                  00002f67    00000016     adc.o (.rodata.str1.152928147105711405261)
-                  00002f7d    00000015     i2c_controller.o (.rodata.str1.91888677203502862861)
-                  00002f92    00000014     i2c_controller.o (.rodata.str1.139536071156377696321)
-                  00002fa6    00000014     i2c_controller.o (.rodata.str1.44366518634961814551)
-                  00002fba    00000013     i2c_controller.o (.rodata.str1.106815021420079532371)
-                  00002fcd    00000011     libc.a : _printfi.c.obj (.rodata.str1.103488685894817597201)
-                  00002fde    00000011            : _printfi.c.obj (.rodata.str1.153638888446227384661)
-                  00002fef    00000002     ti_msp_dl_config.o (.rodata.gI2C_controllerClockConfig)
-                  00002ff1    00000002     ti_msp_dl_config.o (.rodata.gI2C_targetClockConfig)
-                  00002ff3    0000000d     --HOLE-- [fill = 0]
-
-.init_array 
-*          0    00000000    00000000     UNINITIALIZED
-
-.binit     0    00000000    00000000     
-
-.sysmem    0    20200000    00001000     UNINITIALIZED
-                  20200000    00000010     libc.a : memory.c.obj (.sysmem)
-                  20200010    00000ff0     --HOLE--
-
-.data      0    20201000    000002d5     UNINITIALIZED
-                  20201000    00000100     i2c_controller.o (.data.registers)
-                  20201100    000000f0     libc.a : defs.c.obj (.data._ftable)
-                  202011f0    00000078     libsysbm.a : host_device.c.obj (.data._device)
-                  20201268    00000050                : host_device.c.obj (.data._stream)
-                  202012b8    00000008     libc.a : exit.c.obj (.data..L_MergedGlobals)
-                  202012c0    00000004            : defs.c.obj (.data.__TI_ft_end)
-                  202012c4    00000004            : aeabi_portable.c.obj (.data.__aeabi_errno)
-                  202012c8    00000004            : _lock.c.obj (.data._lock)
-                  202012cc    00000004            : _lock.c.obj (.data._unlock)
-                  202012d0    00000002     i2c_controller.o (.data.I2C0_IRQHandler.registerAddress)
-                  202012d2    00000001     i2c_controller.o (.data.I2C0_IRQHandler.DataRx)
-                  202012d3    00000001     i2c_controller.o (.data.battery_status)
-                  202012d4    00000001     libc.a : memory.c.obj (.data.memory_is_initialized)
-
-.bss       0    202012d8    000002a2     UNINITIALIZED
-                  202012d8    00000120     libsysbm.a : trgmsg.c.obj (.bss:_CIOBUF_)
-                  202013f8    000000a0     libc.a : defs.c.obj (.bss.__TI_tmpnams)
-                  20201498    0000009c     (.common:gI2C)
-                  20201534    00000010     (.common:gRxPacket)
-                  20201544    00000010     (.common:gTxPacket)
-                  20201554    00000008     libsysbm.a : hostopen.c.obj (.bss.parmbuf)
-                  2020155c    00000004     libc.a : memory.c.obj (.bss.sys_free)
-                  20201560    00000004     (.common:gRxADCcount)
-                  20201564    00000004     (.common:gRxADClen)
-                  20201568    00000004     (.common:gRxCount)
-                  2020156c    00000004     (.common:gTxADCcount)
-                  20201570    00000004     (.common:gTxADClen)
-                  20201574    00000004     (.common:gTxCount)
-                  20201578    00000001     (.common:gRxComplete)
-                  20201579    00000001     (.common:gTxComplete)
-
-.stack     0    20207e00    00000200     UNINITIALIZED
-                  20207e00    00000004     libc.a : boot_cortex_m.c.obj (.stack)
-                  20207e04    000001fc     --HOLE--
-
-__llvm_prf_cnts 
-*          0    20200000    00000000     UNINITIALIZED
-
-__llvm_prf_bits 
-*          0    20200000    00000000     UNINITIALIZED
-
-MODULE SUMMARY
-
-       Module                         code    ro data   rw data
-       ------                         ----    -------   -------
-    ./
-       i2c_controller.o               1108    277       424    
-       ti_msp_dl_config.o             1438    4         0      
-       adc.o                          1116    212       50     
-       dac.o                          404     154       0      
-       multiplexer.o                  300     89        0      
-       startup_mspm0g350x_ticlang.o   8       192       0      
-    +--+------------------------------+-------+---------+---------+
-       Total:                         4374    928       474    
-                                                               
-    ./ti/comm_modules/i2c/controller/
-       i2c_comm_controller.o          72      0         0      
-    +--+------------------------------+-------+---------+---------+
-       Total:                         72      0         0      
-                                                               
-    /home/ngosh/ti/ccstheia151/ccs/tools/compiler/ti-cgt-armllvm_4.0.0.LTS/lib/armv6m-ti-none-eabi/c/libc.a
-       _printfi.c.obj                 2166    34        0      
-       memory.c.obj                   702     0         5      
-       defs.c.obj                     0       0         404    
-       aeabi_ctype.S.obj              0       257       0      
-       fputs.c.obj                    248     0         0      
-       setvbuf.c.obj                  224     0         0      
-       getdevice.c.obj                160     0         0      
-       fputc.c.obj                    156     0         0      
-       strcmp-armv6m.S.obj            136     0         0      
-       copy_decompress_lzss.c.obj     124     0         0      
-       fclose.c.obj                   124     0         0      
-       fseek.c.obj                    116     0         0      
-       printf.c.obj                   108     0         0      
-       _io_perm.c.obj                 100     0         0      
-       fflush.c.obj                   82      0         0      
-       atoi.c.obj                     64      0         0      
-       exit.c.obj                     56      0         8      
-       autoinit.c.obj                 60      0         0      
-       fopen.c.obj                    52      0         0      
-       boot_cortex_m.c.obj            40      0         0      
-       memccpy.c.obj                  34      0         0      
-       copy_zero_init.c.obj           22      0         0      
-       copy_decompress_none.c.obj     18      0         0      
-       memcpy16.S.obj                 18      0         0      
-       wcslen.c.obj                   16      0         0      
-       memset16.S.obj                 14      0         0      
-       aeabi_portable.c.obj           8       0         4      
-       _lock.c.obj                    2       0         8      
-       pre_init.c.obj                 4       0         0      
-    +--+------------------------------+-------+---------+---------+
-       Total:                         4854    291       429    
-                                                               
-    /home/ngosh/ti/ccstheia151/ccs/tools/compiler/ti-cgt-armllvm_4.0.0.LTS/lib/armv6m-ti-none-eabi/c/libsysbm.a
-       trgmsg.c.obj                   104     0         288    
-       host_device.c.obj              0       0         200    
-       hostrename.c.obj               136     0         0      
-       hostlseek.c.obj                108     0         0      
-       hostopen.c.obj                 96      0         8      
-       hostread.c.obj                 88      0         0      
-       hostwrite.c.obj                88      0         0      
-       close.c.obj                    80      0         0      
-       hostclose.c.obj                72      0         0      
-       hostunlink.c.obj               72      0         0      
-       unlink.c.obj                   44      0         0      
-       lseek.c.obj                    40      0         0      
-       write.c.obj                    40      0         0      
-       remove.c.obj                   8       0         0      
-    +--+------------------------------+-------+---------+---------+
-       Total:                         976     0         496    
-                                                               
-    /home/ngosh/ti/ccstheia151/ccs/tools/compiler/ti-cgt-armllvm_4.0.0.LTS/lib/armv6m-ti-none-eabi/libclang_rt.builtins.a
-       udivmoddi4.S.obj               162     0         0      
-       aeabi_uidivmod.S.obj           64      0         0      
-       muldsi3.S.obj                  58      0         0      
-       muldi3.S.obj                   36      0         0      
-       ashldi3.S.obj                  30      0         0      
-       aeabi_memset.S.obj             26      0         0      
-       aeabi_uldivmod.S.obj           20      0         0      
-       aeabi_memcpy.S.obj             8       0         0      
-       aeabi_div0.c.obj               4       0         0      
-    +--+------------------------------+-------+---------+---------+
-       Total:                         408     0         0      
-                                                               
-    /home/ngosh/ti/mspm0_sdk_2_03_00_07/source/ti/driverlib/lib/ticlang/m0p/mspm0g1x0x_g3x0x/driverlib.a
-       dl_i2c.o                       348     0         0      
-       dl_common.o                    10      0         0      
-    +--+------------------------------+-------+---------+---------+
-       Total:                         358     0         0      
-                                                               
-       Heap:                          0       0         4096   
-       Stack:                         0       0         512    
-       Linker Generated:              0       143       0      
-    +--+------------------------------+-------+---------+---------+
-       Grand Total:                   11042   1362      6007   
-
-
-LINKER GENERATED COPY TABLES
-
-__TI_cinit_table @ 00003080 records: 2, size/record: 8, table size: 16
-	.data: load addr=00003000, load size=0000006b bytes, run addr=20201000, run size=000002d5 bytes, compression=lzss
-	.bss: load addr=00003078, load size=00000008 bytes, run addr=202012d8, run size=000002a2 bytes, compression=zero_init
-
-
-LINKER GENERATED HANDLER TABLE
-
-__TI_handler_table @ 0000306c records: 3, size/record: 4, table size: 12
-	index: 0, handler: __TI_decompress_lzss
-	index: 1, handler: __TI_decompress_none
-	index: 2, handler: __TI_zero_init
-
-
-GLOBAL SYMBOLS: SORTED ALPHABETICALLY BY Name 
-
-address   name                          
--------   ----                          
-00002bdd  ADC0_IRQHandler               
-00002bdd  ADC1_IRQHandler               
-000010a1  ADC_ConstructConfigBytes      
-00001481  ADC_ConvertToVoltage          
-00000ac5  ADC_ReadData                  
-0000131d  ADC_SetConfigurationBytes     
-00002bdd  AES_IRQHandler                
-00002be8  C$$EXIT                       
-000023c9  C$$IO$$                       
-00002bdd  CANFD0_IRQHandler             
-00002bdd  DAC0_IRQHandler               
-00001d6d  DAC_UpdateOutput              
-000013d5  DAC_fastWrite                 
-00002ba3  DL_Common_delayCycles         
-00001d0d  DL_I2C_fillControllerTXFIFO   
-00001bed  DL_I2C_fillTargetTXFIFO       
-0000220d  DL_I2C_flushControllerTXFIFO  
-00002249  DL_I2C_flushTargetTXFIFO      
-000026c7  DL_I2C_setClockConfig         
-00002bdd  DMA_IRQHandler                
-00002bdd  Default_Handler               
-00002bdd  GROUP0_IRQHandler             
-00002bdd  GROUP1_IRQHandler             
-000020c1  HOSTclose                     
-0000190d  HOSTlseek                     
-00001c4d  HOSTopen                      
-00001e25  HOSTread                      
-00001979  HOSTrename                    
-00002109  HOSTunlink                    
-00001e7d  HOSTwrite                     
-00002bdd  HardFault_Handler             
-00000929  I2C0_IRQHandler               
-00000c3d  I2C1_IRQHandler               
-00002439  I2C_init                      
-000015c9  Multiplexer_SelectChannel     
-00002bdd  NMI_Handler                   
-00002bdd  PendSV_Handler                
-00002bdd  RTC_IRQHandler                
-00002be1  Reset_Handler                 
-00002bdd  SPI0_IRQHandler               
-00002bdd  SPI1_IRQHandler               
-00002bdd  SVC_Handler                   
-000025d9  SYSCFG_DL_CRC_init            
-00001891  SYSCFG_DL_GPIO_init           
-00001ed5  SYSCFG_DL_I2C_controller_init 
-00001cad  SYSCFG_DL_I2C_target_init     
-0000277b  SYSCFG_DL_SYSCTL_init         
-00002899  SYSCFG_DL_init                
-00001abd  SYSCFG_DL_initPower           
-00002bdd  SysTick_Handler               
-00002bdd  TIMA0_IRQHandler              
-00002bdd  TIMA1_IRQHandler              
-00002bdd  TIMG0_IRQHandler              
-00002bdd  TIMG12_IRQHandler             
-00002bdd  TIMG6_IRQHandler              
-00002bdd  TIMG7_IRQHandler              
-00002bdd  TIMG8_IRQHandler              
-00002afd  TI_memcpy_small               
-00002b89  TI_memset_small               
-00002bdd  UART0_IRQHandler              
-00002bdd  UART1_IRQHandler              
-00002bdd  UART2_IRQHandler              
-00002bdd  UART3_IRQHandler              
-202012d8  _CIOBUF_                      
-202012d8  __CIOBUF_                     
-20208000  __STACK_END                   
-00000200  __STACK_SIZE                  
-00001000  __SYSMEM_SIZE                 
-00000000  __TI_ATRegion0_region_sz      
-00000000  __TI_ATRegion0_src_addr       
-00000000  __TI_ATRegion0_trg_addr       
-00000000  __TI_ATRegion1_region_sz      
-00000000  __TI_ATRegion1_src_addr       
-00000000  __TI_ATRegion1_trg_addr       
-00000000  __TI_ATRegion2_region_sz      
-00000000  __TI_ATRegion2_src_addr       
-00000000  __TI_ATRegion2_trg_addr       
-00003080  __TI_CINIT_Base               
-00003090  __TI_CINIT_Limit              
-00003090  __TI_CINIT_Warm               
-0000306c  __TI_Handler_Table_Base       
-00003078  __TI_Handler_Table_Limit      
-00002285  __TI_auto_init_nobinit_nopinit
-00002335  __TI_cleanup                  
-202012b8  __TI_cleanup_ptr              
-00001799  __TI_closefile                
-00001815  __TI_decompress_lzss          
-00002b0f  __TI_decompress_none          
-00001f2d  __TI_doflush                  
-202012bc  __TI_dtors_ptr                
-202012c0  __TI_ft_end                   
-ffffffff  __TI_pprof_out_hndl           
-000000c1  __TI_printfi_nofloat          
-ffffffff  __TI_prof_data_size           
-ffffffff  __TI_prof_data_start          
-00002369  __TI_readmsg                  
-00000000  __TI_static_base__            
-202013f8  __TI_tmpnams                  
-0000239d  __TI_writemsg                 
-00001b25  __TI_wrt_ok                   
-00002a37  __TI_zero_init_nomemset       
-00002bf0  __aeabi_ctype_table_          
-00002bf0  __aeabi_ctype_table_C         
-202012c4  __aeabi_errno                 
-00002bad  __aeabi_errno_addr            
-000015c7  __aeabi_idiv0                 
-0000190b  __aeabi_ldiv0                 
-00002799  __aeabi_llsl                  
-00002735  __aeabi_lmul                  
-00001705  __aeabi_memclr                
-00001705  __aeabi_memclr4               
-00001705  __aeabi_memclr8               
-00002bb5  __aeabi_memcpy                
-00002bb5  __aeabi_memcpy4               
-00002bb5  __aeabi_memcpy8               
-00002b51  __aeabi_memset                
-00002b51  __aeabi_memset4               
-00002b51  __aeabi_memset8               
-00002151  __aeabi_uidiv                 
-00002151  __aeabi_uidivmod              
-00002ac5  __aeabi_uldivmod              
-00002799  __ashldi3                     
-ffffffff  __binit__                     
-UNDEFED   __mpu_init                    
-00002735  __muldi3                      
-000022c1  __muldsi3                     
-20207e00  __stack                       
-20200000  __start___llvm_prf_bits       
-20200000  __start___llvm_prf_cnts       
-20200000  __stop___llvm_prf_bits        
-20200000  __stop___llvm_prf_cnts        
-00001525  __udivmoddi4                  
-00002679  _c_int00_noargs               
-202011f0  _device                       
-20201100  _ftable                       
-202012c8  _lock                         
-00001d6b  _nop                          
-20201268  _stream                       
-20200000  _sys_memory                   
-UNDEFED   _system_post_cinit            
-00002be5  _system_pre_init              
-202012cc  _unlock                       
-00002be9  abort                         
-00000dad  aligned_alloc                 
-00002191  atoi                          
-202012d3  battery_status                
-ffffffff  binit                         
-00002071  close                         
-000023d1  exit                          
-00002405  finddevice                    
-00001669  fputc                         
-00000ec1  fputs                         
-00000fb9  free                          
-00002bcd  fseek                         
-000019e5  fseeko                        
-20201498  gI2C                          
-20201560  gRxADCcount                   
-20201564  gRxADClen                     
-20201578  gRxComplete                   
-20201568  gRxCount                      
-20201534  gRxPacket                     
-2020156c  gTxADCcount                   
-20201570  gTxADClen                     
-20201579  gTxComplete                   
-20201574  gTxCount                      
-20201544  gTxPacket                     
-00001a51  getdevice                     
-00000000  interruptVectors              
-00002629  lseek                         
-00001261  main                          
-00002b97  malloc                        
-00000dad  memalign                      
-00002759  memccpy                       
-20201554  parmbuf                       
-00001dc9  printf                        
-20201000  registers                     
-00002bd5  remove                        
-00001181  setvbuf                       
-00001711  strcmp                        
-0000246d  unlink                        
-00002b31  wcslen                        
-00002651  write                         
-
-
-GLOBAL SYMBOLS: SORTED BY Symbol Address 
-
-address   name                          
--------   ----                          
-00000000  __TI_ATRegion0_region_sz      
-00000000  __TI_ATRegion0_src_addr       
-00000000  __TI_ATRegion0_trg_addr       
-00000000  __TI_ATRegion1_region_sz      
-00000000  __TI_ATRegion1_src_addr       
-00000000  __TI_ATRegion1_trg_addr       
-00000000  __TI_ATRegion2_region_sz      
-00000000  __TI_ATRegion2_src_addr       
-00000000  __TI_ATRegion2_trg_addr       
-00000000  __TI_static_base__            
-00000000  interruptVectors              
-000000c1  __TI_printfi_nofloat          
-00000200  __STACK_SIZE                  
-00000929  I2C0_IRQHandler               
-00000ac5  ADC_ReadData                  
-00000c3d  I2C1_IRQHandler               
-00000dad  aligned_alloc                 
-00000dad  memalign                      
-00000ec1  fputs                         
-00000fb9  free                          
-00001000  __SYSMEM_SIZE                 
-000010a1  ADC_ConstructConfigBytes      
-00001181  setvbuf                       
-00001261  main                          
-0000131d  ADC_SetConfigurationBytes     
-000013d5  DAC_fastWrite                 
-00001481  ADC_ConvertToVoltage          
-00001525  __udivmoddi4                  
-000015c7  __aeabi_idiv0                 
-000015c9  Multiplexer_SelectChannel     
-00001669  fputc                         
-00001705  __aeabi_memclr                
-00001705  __aeabi_memclr4               
-00001705  __aeabi_memclr8               
-00001711  strcmp                        
-00001799  __TI_closefile                
-00001815  __TI_decompress_lzss          
-00001891  SYSCFG_DL_GPIO_init           
-0000190b  __aeabi_ldiv0                 
-0000190d  HOSTlseek                     
-00001979  HOSTrename                    
-000019e5  fseeko                        
-00001a51  getdevice                     
-00001abd  SYSCFG_DL_initPower           
-00001b25  __TI_wrt_ok                   
-00001bed  DL_I2C_fillTargetTXFIFO       
-00001c4d  HOSTopen                      
-00001cad  SYSCFG_DL_I2C_target_init     
-00001d0d  DL_I2C_fillControllerTXFIFO   
-00001d6b  _nop                          
-00001d6d  DAC_UpdateOutput              
-00001dc9  printf                        
-00001e25  HOSTread                      
-00001e7d  HOSTwrite                     
-00001ed5  SYSCFG_DL_I2C_controller_init 
-00001f2d  __TI_doflush                  
-00002071  close                         
-000020c1  HOSTclose                     
-00002109  HOSTunlink                    
-00002151  __aeabi_uidiv                 
-00002151  __aeabi_uidivmod              
-00002191  atoi                          
-0000220d  DL_I2C_flushControllerTXFIFO  
-00002249  DL_I2C_flushTargetTXFIFO      
-00002285  __TI_auto_init_nobinit_nopinit
-000022c1  __muldsi3                     
-00002335  __TI_cleanup                  
-00002369  __TI_readmsg                  
-0000239d  __TI_writemsg                 
-000023c9  C$$IO$$                       
-000023d1  exit                          
-00002405  finddevice                    
-00002439  I2C_init                      
-0000246d  unlink                        
-000025d9  SYSCFG_DL_CRC_init            
-00002629  lseek                         
-00002651  write                         
-00002679  _c_int00_noargs               
-000026c7  DL_I2C_setClockConfig         
-00002735  __aeabi_lmul                  
-00002735  __muldi3                      
-00002759  memccpy                       
-0000277b  SYSCFG_DL_SYSCTL_init         
-00002799  __aeabi_llsl                  
-00002799  __ashldi3                     
-00002899  SYSCFG_DL_init                
-00002a37  __TI_zero_init_nomemset       
-00002ac5  __aeabi_uldivmod              
-00002afd  TI_memcpy_small               
-00002b0f  __TI_decompress_none          
-00002b31  wcslen                        
-00002b51  __aeabi_memset                
-00002b51  __aeabi_memset4               
-00002b51  __aeabi_memset8               
-00002b89  TI_memset_small               
-00002b97  malloc                        
-00002ba3  DL_Common_delayCycles         
-00002bad  __aeabi_errno_addr            
-00002bb5  __aeabi_memcpy                
-00002bb5  __aeabi_memcpy4               
-00002bb5  __aeabi_memcpy8               
-00002bcd  fseek                         
-00002bd5  remove                        
-00002bdd  ADC0_IRQHandler               
-00002bdd  ADC1_IRQHandler               
-00002bdd  AES_IRQHandler                
-00002bdd  CANFD0_IRQHandler             
-00002bdd  DAC0_IRQHandler               
-00002bdd  DMA_IRQHandler                
-00002bdd  Default_Handler               
-00002bdd  GROUP0_IRQHandler             
-00002bdd  GROUP1_IRQHandler             
-00002bdd  HardFault_Handler             
-00002bdd  NMI_Handler                   
-00002bdd  PendSV_Handler                
-00002bdd  RTC_IRQHandler                
-00002bdd  SPI0_IRQHandler               
-00002bdd  SPI1_IRQHandler               
-00002bdd  SVC_Handler                   
-00002bdd  SysTick_Handler               
-00002bdd  TIMA0_IRQHandler              
-00002bdd  TIMA1_IRQHandler              
-00002bdd  TIMG0_IRQHandler              
-00002bdd  TIMG12_IRQHandler             
-00002bdd  TIMG6_IRQHandler              
-00002bdd  TIMG7_IRQHandler              
-00002bdd  TIMG8_IRQHandler              
-00002bdd  UART0_IRQHandler              
-00002bdd  UART1_IRQHandler              
-00002bdd  UART2_IRQHandler              
-00002bdd  UART3_IRQHandler              
-00002be1  Reset_Handler                 
-00002be5  _system_pre_init              
-00002be8  C$$EXIT                       
-00002be9  abort                         
-00002bf0  __aeabi_ctype_table_          
-00002bf0  __aeabi_ctype_table_C         
-0000306c  __TI_Handler_Table_Base       
-00003078  __TI_Handler_Table_Limit      
-00003080  __TI_CINIT_Base               
-00003090  __TI_CINIT_Limit              
-00003090  __TI_CINIT_Warm               
-20200000  __start___llvm_prf_bits       
-20200000  __start___llvm_prf_cnts       
-20200000  __stop___llvm_prf_bits        
-20200000  __stop___llvm_prf_cnts        
-20200000  _sys_memory                   
-20201000  registers                     
-20201100  _ftable                       
-202011f0  _device                       
-20201268  _stream                       
-202012b8  __TI_cleanup_ptr              
-202012bc  __TI_dtors_ptr                
-202012c0  __TI_ft_end                   
-202012c4  __aeabi_errno                 
-202012c8  _lock                         
-202012cc  _unlock                       
-202012d3  battery_status                
-202012d8  _CIOBUF_                      
-202012d8  __CIOBUF_                     
-202013f8  __TI_tmpnams                  
-20201498  gI2C                          
-20201534  gRxPacket                     
-20201544  gTxPacket                     
-20201554  parmbuf                       
-20201560  gRxADCcount                   
-20201564  gRxADClen                     
-20201568  gRxCount                      
-2020156c  gTxADCcount                   
-20201570  gTxADClen                     
-20201574  gTxCount                      
-20201578  gRxComplete                   
-20201579  gTxComplete                   
-20207e00  __stack                       
-20208000  __STACK_END                   
-ffffffff  __TI_pprof_out_hndl           
-ffffffff  __TI_prof_data_size           
-ffffffff  __TI_prof_data_start          
-ffffffff  __binit__                     
-ffffffff  binit                         
-UNDEFED   __mpu_init                    
-UNDEFED   _system_post_cinit            
-
-[182 symbols]

二進制
charge_controller_v7/Debug/charge_controller_v7.out


二進制
charge_controller_v7/Debug/i2c_controller.o


+ 0 - 5
charge_controller_v7/Debug/i2c_target.d

@@ -1,5 +0,0 @@
-# FIXED
-
-i2c_target.o: ../i2c_target.c ../i2c_target.h ../battery.h
-../i2c_target.h:
-../battery.h:

二進制
charge_controller_v7/Debug/i2c_target.o


+ 0 - 29
charge_controller_v7/i2c_target.c

@@ -1,29 +0,0 @@
-
-#include "i2c_target.h"
-#include "battery.h"
-
-
-/*
-- command: as defined in the Wiki for Pi 0x01, 0x02, 0x03, refer to i2c_target.h file
-- slot_id: battery slot numner from 0 to NUM_SLOTS-1
-- data: pointer to SET battery limits
-- len: length of the data
-
-*/
-void ProcessI2CCommand(uint8_t command, uint8_t slot_id, uint8_t *data, uint8_t len) {
-    switch(command) {
-        case CMD_GET_BATTERY_STATUS:
-            // Transmit the battery state for the given slot
-            
-            
-        case CMD_GET_BATTERY_DATA: {
-            // Create a data message and transmit it
-            
-        }
-        
-        case CMD_SET_BATTERY_LIMIT: {
-            
-            
-    }
- }
-}

+ 0 - 0
charge_controller_v7/dac.c → dac.c


+ 0 - 0
charge_controller_v7/dac.h → dac.h


+ 158 - 135
charge_controller_v7/i2c_controller.c → i2c_controller.c

@@ -24,6 +24,7 @@
  */
 
 
+#include "i2c_target.h"
 #include "ti/devices/msp/peripherals/hw_dac12.h"
 #include "ti/driverlib/dl_adc12.h"
 #include "ti/driverlib/dl_gpio.h"
@@ -36,39 +37,13 @@
 #include "multiplexer.h"
 #include "adc.h"
 #include "dac.h"
+#include "battery.h"
+#include "i2c_target.h"
 
 I2C_Instance gI2C;
 I2C_ResponseInfo gResponse;
+BatteryData battery_data;
 
-
-#define NUM_BATTERY_SLOT (1)
-uint16_t battery_slots[NUM_BATTERY_SLOT];
-uint8_t battery_status[1]= {0x02};
-
-
-
-
-/*
-
-ADC SETTINGS:
-
-Fixed Reference Voltage is 2.048V and PGA Gain setting default: x1
-
-Mode: can be 1: Continuous or 0: for One-Shot Conversion
-
-ADC_RESOLUTION: 16 bits -> A higher resolution means better precision but slower conversion time.
-
-Calculation for V(IN)= (ADC Value/2^ (Resolution-1))* V(REF)
-*/
-
-/*Voltage is calculated in ADC in milliVolts:
-- Reference voltage in milliVolts to be read from Pi
-- Register address where ADC result would be stored
-*/
-
-//#define VREF 2.048 
-// address register for ADC Voltage Read:
-//#define ADC_REGISTER 0x10
 /*****************/
 /*Register for the MCU*/
 #define REGISTER_SIZE 256
@@ -82,21 +57,6 @@ uint32_t gRxLen, gRxCount;
 
 /* Boolean to know when a stop command was issued */
 bool gStopReceived = false;
-
-/* ADC variables:
- * gADCResult is the adc result taken from the Memory Register
- * NumberOfADCSamples is the count of total ADC samples to keep track for the gTxResult buffer
- */
-
-//uint16_t gADCResult;
-//uint8_t gNumberOfADCSamples = 0;
-//bool gCheckADC = false;
-//volatile I2C_CommandInfo gCommand;
-//I2C_ResponseInfo gResponse;
-//volatile bool gSendCommand = true;
-//volatile bool newMeasurementAvailable = false;
-
-
 uint8_t gTxData[MAX_DATA_SIZE] = {0} ;
 
 /*
@@ -127,11 +87,6 @@ void I2C_scanBus() {
     printf("I2C Scan Complete!\n");
 }
 
-
-
-
-
-
 /*Function to get the RDY bit from ADC*/
 
 bool Check_ADC_Ready()
@@ -159,21 +114,7 @@ bool Check_ADC_Ready()
 Function to initialize MCU as target: Pi communicates as the Controller and MCU as the Target
 */
 
-void I2C_Target_Init(void) {
-    // Set the target address
-    DL_I2C_setTargetOwnAddress(I2C_target_INST, I2C_target_TARGET_OWN_ADDR);
 
-    // Enable target mode
-    DL_I2C_enableTarget(I2C_target_INST);
-
-
-    /* Enable relevant I2C interrupts */
-    DL_I2C_enableInterrupt(I2C_target_INST, DL_I2C_INTERRUPT_TARGET_START);
-    DL_I2C_enableInterrupt(I2C_target_INST, DL_I2C_INTERRUPT_TARGET_RXFIFO_TRIGGER);
-    DL_I2C_enableInterrupt(I2C_target_INST, DL_I2C_INTERRUPT_TARGET_TXFIFO_TRIGGER);                                        
-    DL_I2C_enableInterrupt(I2C_target_INST, DL_I2C_INTERRUPT_TARGET_STOP);
-    
-}
 
 /*Interrupt for MCU -> ADC
 * CASE: DL_I2C_IIDX_CONTROLLER_RX_DONE: ADC Reception Complete
@@ -223,7 +164,11 @@ void I2C_controller_INST_IRQHandler(void)
                     /* Ignore and remove from FIFO if the buffer is full */
                     DL_I2C_receiveControllerData(I2C_controller_INST);
                 }
-
+            }
+            if (gRxADCcount == gRxADClen){
+                //printf("ADC Bytes Received!\n");
+                DL_I2C_enableInterrupt(I2C_controller_INST, DL_I2C_INTERRUPT_CONTROLLER_STOP);
+                //gRxComplete = true;
             }
             break;
         /*TRANSMIT data to ADC*/
@@ -256,96 +201,191 @@ void I2C_controller_INST_IRQHandler(void)
     }
 }
 
-void I2C_target_INST_IRQHandler(void) {
+//void I2C_target_INST_IRQHandler(void) {
 
-    static bool DataRx= false;
-    static uint16_t registerAddress=0;
+//    static bool DataRx= false;
+//    static uint16_t registerAddress=0;
 
     //printf("I2C Interrupt Triggered to MCU (TARGET)!\n");
 
-    uint32_t status = DL_I2C_getPendingInterrupt(I2C_target_INST);
-    switch (status) {
+//    uint32_t status = DL_I2C_getPendingInterrupt(I2C_target_INST);
+//    switch (status) {
 
         /* START condition detected */
-        case DL_I2C_IIDX_TARGET_START:
+//        case DL_I2C_IIDX_TARGET_START:
             //printf("START condition detected.\n");
-            gTxCount= 0;
-            gRxCount= 0;
-            DataRx= false;
-            DL_I2C_flushTargetTXFIFO(I2C_target_INST);
-            break;
+//            gTxCount= 0;
+//            gRxCount= 0;
+//            DataRx= false;
+//            DL_I2C_flushTargetTXFIFO(I2C_target_INST);
+//            break;
 
         /* STOP condition detected */
-        case DL_I2C_IIDX_TARGET_STOP:
+//        case DL_I2C_IIDX_TARGET_STOP:
             //printf("STOP condition detected.\n");
-            if (DataRx == true){
+//            if (DataRx == true){
                 //printf("Data received from Pi: ");
-                for (uint8_t i = 0; i < gRxCount; i++) {
-                    //printf("0x%02X ", gRxBuffer[i]);
+//                for (uint8_t i = 0; i < gRxCount; i++) {
+//                    //printf("0x%02X ", gRxBuffer[i]);
 
-                }
+//                }
                 //printf("\n");
-                DataRx= false;
-            }
-            DL_I2C_flushTargetTXFIFO(I2C_target_INST);
-            break;
+//                DataRx= false;
+//            }
+//            DL_I2C_flushTargetTXFIFO(I2C_target_INST);
+//            break;
 
         /* RX FIFO trigger (Pi is writing data to MCU) */
-        case DL_I2C_IIDX_TARGET_RXFIFO_TRIGGER:
+//        case DL_I2C_IIDX_TARGET_RXFIFO_TRIGGER:
             //printf("receiving data from Pi.\n");
-            DataRx= true;
-            while (!DL_I2C_isTargetRXFIFOEmpty(I2C_target_INST)) {
-                if (gRxCount == 0) {
-                    // First byte received is the register address
-                    registerAddress = DL_I2C_receiveTargetData(I2C_target_INST);
-                    DL_I2C_flushTargetTXFIFO(I2C_target_INST);
+//            DataRx= true;
+//            while (!DL_I2C_isTargetRXFIFOEmpty(I2C_target_INST)) {
+//               if (gRxCount == 0) {
+//                    // First byte received is the register address
+//                    registerAddress = DL_I2C_receiveTargetData(I2C_target_INST);
+//                    DL_I2C_flushTargetTXFIFO(I2C_target_INST);
                     //printf("Register Address Set: 0x%02X\n", registerAddress);
-                } 
-                else if (registerAddress < REGISTER_SIZE) {
+//                } 
+//                else if (registerAddress < REGISTER_SIZE) {
                     //Storing the received data from the controller correctly
-                    registers[registerAddress] = DL_I2C_receiveTargetData(I2C_target_INST);
+//                    registers[registerAddress] = DL_I2C_receiveTargetData(I2C_target_INST);
                     //printf("Stored 0x%02X in Register 0x%02X\n", registers[registerAddress], registerAddress);
                     //gRxBuffer[gRxCount++] = DL_I2C_receiveTargetData(I2C_0_INST);
 
-                } 
-                else {
-                    printf("ERROR: RX Buffer Overflow!\n");
-                    break;
-                }
-                gRxCount++;
-            }
-            break;
+//                } 
+//                else {
+//                    printf("ERROR: RX Buffer Overflow!\n");
+//                    break;
+//                }
+//                gRxCount++;
+//            }
+//            break;
 
          /* TX FIFO trigger (Pi is reading data from MCU) */
-        case DL_I2C_IIDX_TARGET_TXFIFO_TRIGGER:
+//        case DL_I2C_IIDX_TARGET_TXFIFO_TRIGGER:
             
             //printf("transmitting data to Pi...\n");
-            if(!DL_I2C_isTargetTXFIFOFull(I2C_target_INST)) {
-                  if(registerAddress == 0x01){
-                    DL_I2C_fillTargetTXFIFO(I2C_target_INST, battery_status, NUM_BATTERY_SLOT);
-                  }
-                  else if(registerAddress== 0x02){
+//            if(!DL_I2C_isTargetTXFIFOFull(I2C_target_INST)) {
+//                  if(registerAddress == 0x01){
+                    //DL_I2C_fillTargetTXFIFO(I2C_target_INST, battery_status, NUM_BATTERY_SLOT);
+//                  }
+//                  else if(registerAddress== 0x02){
                     //DL_I2C_fillTargetTXFIFO(I2C_target_INST, &value , 1);
-                  }
+//                  }
       
-                  else {
+//                  else {
                     // **Fix: Avoid infinite while loop**
-                    printf("WARNING: TX Buffer Underflow! Sending default value.\n");
-                    DL_I2C_fillTargetTXFIFO(I2C_target_INST, (uint8_t[]){0x00}, 1);
+//                    printf("WARNING: TX Buffer Underflow! Sending default value.\n");
+//                    DL_I2C_fillTargetTXFIFO(I2C_target_INST, (uint8_t[]){0x00}, 1);
+//                    break;
+//                 }
+//            }
+//            break;
+
+        /* Arbitration lost or NACK */
+//        case DL_I2C_IIDX_TARGET_ARBITRATION_LOST:
+//            printf("Arbitration Lost.\n");
+//        case DL_I2C_IIDX_CONTROLLER_NACK:
+//            printf("I2C NACK Received! Possible communication failure.\n");
+            //DL_I2C_stopControllerTransfer(I2C_controller_INST);  // Force STOP
+//            break;
+//        default:
+//            printf("Unknown Interrupt.\n");
+//            break;
+//    }
+//}
+
+void I2C_Target_Init(void) {
+    // Set the target address
+    DL_I2C_setTargetOwnAddress(I2C_target_INST, I2C_target_TARGET_OWN_ADDR);
+
+    // Enable target mode
+    DL_I2C_enableTarget(I2C_target_INST);
+
+
+    /* Enable relevant I2C interrupts */
+    DL_I2C_enableInterrupt(I2C_target_INST, DL_I2C_INTERRUPT_TARGET_START);
+    DL_I2C_enableInterrupt(I2C_target_INST, DL_I2C_INTERRUPT_TARGET_RXFIFO_TRIGGER);
+    DL_I2C_enableInterrupt(I2C_target_INST, DL_I2C_INTERRUPT_TARGET_TXFIFO_TRIGGER);                                        
+    DL_I2C_enableInterrupt(I2C_target_INST, DL_I2C_INTERRUPT_TARGET_STOP);
+    
+}
+
+void I2C_target_INST_IRQHandler(void) {
+
+    //printf("I2C Interrupt Triggered to MCU (TARGET)!\n");
+    static uint8_t receivedCommand= 0;
+    uint32_t status = DL_I2C_getPendingInterrupt(I2C_target_INST);
+    ADC_PARAMS params;
+    switch (status) {
+
+        /* START condition detected */
+        case DL_I2C_IIDX_TARGET_START:
+            piTxCount= 0;
+            piRxCount= 0;
+            piTxComplete= false;
+            DL_I2C_flushTargetTXFIFO(I2C_target_INST);
+            break;
+
+        /* STOP condition detected */
+        case DL_I2C_IIDX_TARGET_STOP:
+            piTxComplete= true;
+            piRxComplete = true;
+            printf("I2C Stop Detected- Rx/Tx Complete");
+            break;
+
+        /* TX FIFO trigger (Pi is reading data from MCU) */
+        case DL_I2C_IIDX_TARGET_TXFIFO_TRIGGER:
+            switch(receivedCommand){
+                case CMD_GET_BATTERY_STATUS:
+                    for(uint8_t slot=0; slot< NUM_SLOTS; slot++){
+                        Battery_StateUpdate(slot);
+                        uint8_t battery_status= batteries[slot].state;
+                        DL_I2C_fillTargetTXFIFO(I2C_target_INST, &battery_status, NUM_SLOTS);
+                        while (DL_I2C_getTargetStatus(I2C_target_INST) & DL_I2C_TARGET_STATUS_BUS_BUSY); 
+                    }
+                break;
+
+                case CMD_GET_BATTERY_DATA:
+                    piTxCount= 0;
+                    piTxComplete= false;
+                    // Create a data message and transmit it
+                    for(uint8_t slot_id; slot_id<NUM_SLOTS; slot_id++){
+                        battery_data.slot_id= slot_id;
+                        battery_data.voltage= batteries[slot_id].voltage;
+                        battery_data.current= 0;
+                        battery_data.temperature=0;
+                    }
+                    //printf("Sending Battery Data: Slot %d | Voltage %dmV| Current %d| Temperature %d.\n", slot_id, battery_data.voltage, battery_data.current, battery_data.temperature);
+                    while (DL_I2C_getTargetStatus(I2C_target_INST) & DL_I2C_TARGET_STATUS_BUS_BUSY);
+                    //Casting the struct pointer to byte array: (uint8_t*)
+                    DL_I2C_fillTargetTXFIFO(I2C_target_INST, (uint8_t*)&battery_data, sizeof(BatteryData));
+                    while(!piTxComplete);
+                    while (DL_I2C_getTargetStatus(I2C_target_INST) & DL_I2C_TARGET_STATUS_BUS_BUSY);      
+                    // Check if full data has been sent
+                    if (piTxCount >= sizeof(BatteryData)) {
+                        piTxComplete = true;
+                        piTxCount = 0;  // Reset counter for next request
+                        printf("Sent Full Battery Data\n");
+                    }
                     break;
-                 }
             }
+
+         /* TARGET_Rx FIFO trigger (Pi is writing data to MCU) */
+        case DL_I2C_IIDX_TARGET_RXFIFO_TRIGGER:
             break;
 
         /* Arbitration lost or NACK */
         case DL_I2C_IIDX_TARGET_ARBITRATION_LOST:
             printf("Arbitration Lost.\n");
+            break;
         default:
             printf("Unknown Interrupt.\n");
             break;
     }
 }
 
+
 void Reset_I2C_Bus() {
     printf("I2C Bus is stuck! Resetting...\n");
     
@@ -364,9 +404,7 @@ void Reset_I2C_Bus() {
 
 
 
-/*
-MAIN function:
-*/
+/********MAIN function*************/
 
 int main(void)
 {
@@ -374,7 +412,7 @@ int main(void)
     SYSCFG_DL_init();
     //Reset_I2C_Bus();
     //NVIC_EnableIRQ(I2C_target_INST_INT_IRQN);
-    //NVIC_EnableIRQ(I2C_controller_INST_INT_IRQN);
+    NVIC_EnableIRQ(I2C_controller_INST_INT_IRQN);
 
     printf("............System Configuration Enabled...............\n");
     
@@ -397,27 +435,12 @@ int main(void)
     uint16_t channel_a_value= 3300; // in mVolts
     while (1)
     {   
-        int16_t raw_adc_value= ADC_ReadData(adc_params);
-        ADC_ConvertToVoltage(raw_adc_value, adc_params); 
-        delay_cycles(5000);
-        DAC_fastWrite(channel_a_value);
+         Battery_UpdateCurrentVoltage(adc_params);
+        //delay_cycles(5000);
+        //DAC_fastWrite(channel_a_value);
         delay_cycles(100000);
 
     }   
-        
-        //Read_ADC_Data(resolution);
-        //for(uint8_t slot=0; slot<NUM_BATTERY_SLOT; slot++){
-            // Read ADC Value and DAC values:
-            //int16_t adc_value = Read_ADC_Data(resolution);
-            //Read_ADC_Data(resolution);
-            //float measured_adc_volts= Convert_ADC_To_Voltage(adc_value, resolution, gain); 
-            //if(measured_adc_volts> BATT_THRESHOLD){
-            //battery_status[slot]= 0x02;
-            //}else{
-            //    battery_status[slot]= 0x01;
-            //}
-            // Debugging Output
-            //printf("Battery Slot %d - Voltage: %.2fV, Status: 0x%02X\n", slot, measured_adc_volts, battery_status[slot]);
 
 }
         

+ 0 - 0
charge_controller_v7/i2c_controller.syscfg → i2c_controller.syscfg


+ 96 - 0
i2c_target.c

@@ -0,0 +1,96 @@
+
+#include "i2c_target.h"
+#include "battery.h"
+#include "adc.h"
+#include "ti/driverlib/dl_i2c.h"
+#include "ti_msp_dl_config.h"
+#include <stdio.h>
+#include <stdint.h>
+
+//Global buffer for I2C 
+
+BatteryData battery_data;
+BatteryLimitMsg battery_limits;
+
+//Flag for Pi INTERRUPTS:
+volatile bool piRxComplete;
+volatile bool piTxComplete;
+
+uint8_t piTxPacket[I2C_TX_MAX_PACKET_SIZE_PI];
+uint8_t piRxPacket[I2C_RX_MAX_PACKET_SIZE_PI];
+
+uint32_t piTxLen, piTxCount;
+uint32_t piRxLen, piRxCount;
+/*
+- command: as defined in the Wiki for Pi 0x01, 0x02, 0x03, refer to i2c_target.h file
+- slot_id: battery slot numner from 0 to NUM_SLOTS-1
+- data: pointer to SET battery limits
+- len: length of the data
+
+*/
+
+void Battery_StateUpdate(uint8_t slot_id){
+    
+    uint16_t voltage_mv= batteries[slot_id].voltage;
+    uint16_t min_voltage= batteries[slot_id].min_voltage;
+    uint16_t max_voltage= batteries[slot_id].max_voltage;
+
+    //Testing:
+    if(voltage_mv< 500){
+        batteries[slot_id].state= STATE_EMPTY;
+    }
+
+    else if(voltage_mv>=500 && voltage_mv< 3000){
+        batteries[slot_id].state= STATE_BATTERY_DETECTED;
+    }
+    else if(voltage_mv >=3000 && voltage_mv< 4200){
+        batteries[slot_id].state= STATE_MEASUREMENT_IN_PROGRESS;
+    }
+    // once MCU is done reading ADC:
+    else if(!(DL_I2C_getControllerStatus(I2C_controller_INST) & DL_I2C_CONTROLLER_STATUS_BUSY_BUS)) {
+        batteries[slot_id].state= STATE_MEASUREMENT_DONE;
+    }
+    else{
+        batteries[slot_id].state= STATE_OVERCHARGING;
+    }    
+}
+
+void ProcessI2CCommand(uint8_t command, uint8_t slot_id, ADC_PARAMS params) {
+    switch(command) {
+        case CMD_GET_BATTERY_STATUS:
+            for(uint8_t slot=0; slot< NUM_SLOTS; slot++){
+                Battery_StateUpdate(slot);
+                DL_I2C_enableInterrupt(I2C_target_INST, DL_I2C_INTERRUPT_TARGET_TXFIFO_TRIGGER);
+                while (DL_I2C_getTargetStatus(I2C_target_INST) & DL_I2C_TARGET_STATUS_BUS_BUSY); 
+            }
+            break;
+            
+        case CMD_GET_BATTERY_DATA: 
+
+            piTxCount= 0;
+            piTxComplete= false;
+            // Create a data message and transmit it
+            Battery_UpdateCurrentVoltage(params);
+            battery_data.slot_id= slot_id;
+            battery_data.voltage= batteries[slot_id].voltage;
+            battery_data.current= 0;
+            battery_data.temperature=0;
+            printf("Sending Battery Data: Slot %d | Voltage %dmV| Current %d| Temperature %d.\n", slot_id, battery_data.voltage, battery_data.current, battery_data.temperature);
+            while (DL_I2C_getTargetStatus(I2C_target_INST) & DL_I2C_TARGET_STATUS_BUS_BUSY);
+            //Casting the struct pointer to byte array: (uint8_t*)
+            DL_I2C_enableInterrupt(I2C_target_INST, DL_I2C_INTERRUPT_TARGET_TXFIFO_TRIGGER);
+            DL_I2C_fillTargetTXFIFO(I2C_target_INST, (uint8_t*)&battery_data, sizeof(BatteryData));
+            while(!piTxComplete);
+            while (DL_I2C_getTargetStatus(I2C_target_INST) & DL_I2C_TARGET_STATUS_BUS_BUSY);      
+            break;
+        
+        case CMD_SET_BATTERY_LIMIT: 
+            
+            batteries[slot_id].min_voltage= battery_limits.min_voltage;
+            batteries[slot_id].max_voltage= battery_limits.max_voltage;
+            batteries[slot_id].capacitance= battery_limits.capacitance;
+            batteries[slot_id].cut_off_current= battery_limits.cut_off_current;
+            break;
+    }
+}
+        

+ 18 - 3
charge_controller_v7/i2c_target.h → i2c_target.h

@@ -1,6 +1,6 @@
 #ifndef I2C_TARGET_H
 #define I2C_TARGET_H
-
+#include <stdbool.h>
 #include "battery.h"
 
 
@@ -9,6 +9,19 @@
 #define CMD_GET_BATTERY_DATA          0x02       // Request battery data
 #define CMD_SET_BATTERY_LIMIT         0x03       // SET min/max voltage, cutoff current limits
 
+//Maximum packet sizes
+#define I2C_TX_MAX_PACKET_SIZE_PI (16)
+#define I2C_RX_MAX_PACKET_SIZE_PI (16)
+
+//Flag for READ and WRITE
+extern volatile bool piRxComplete;
+extern volatile bool piTxComplete;
+extern uint8_t piTxPacket[I2C_TX_MAX_PACKET_SIZE_PI];
+extern uint8_t piRxPacket[I2C_RX_MAX_PACKET_SIZE_PI];
+
+/*Counters for Tx and Rx length and bytes sent*/
+extern uint32_t piTxLen, piTxCount;
+extern uint32_t piRxLen, piRxCount;
 
 //Structure for Battery Data Message (GET battery data)
 
@@ -25,8 +38,10 @@ typedef struct{
     uint16_t min_voltage;
     uint16_t max_voltage;
     uint16_t cut_off_current;
+    uint16_t capacitance;
 } BatteryLimitMsg;
 
-void I2C_Init();
-void ProcessI2Ccommand();
+//void I2C_Init();
+//void ProcessI2Ccommand();
+void Battery_StateUpdate(uint8_t slot_id);
 #endif

+ 0 - 0
charge_controller_v7/multiplexer.c → multiplexer.c


+ 0 - 0
charge_controller_v7/multiplexer.h → multiplexer.h


+ 0 - 0
charge_controller_v7/targetConfigs/MSPM0G3507.ccxml → targetConfigs/MSPM0G3507.ccxml


+ 0 - 0
charge_controller_v7/targetConfigs/readme.txt → targetConfigs/readme.txt


+ 0 - 0
charge_controller_v7/ti/comm_modules/i2c/controller/i2c_comm_controller.c → ti/comm_modules/i2c/controller/i2c_comm_controller.c


+ 0 - 0
charge_controller_v7/ti/comm_modules/i2c/controller/i2c_comm_controller.h → ti/comm_modules/i2c/controller/i2c_comm_controller.h


部分文件因文件數量過多而無法顯示