Browse Source

"owi readbit and strong change"

master
JWS 1 month ago
parent
commit
be5129f41d
  1. BIN
      DefaultBuild/cstart.obj
  2. BIN
      DefaultBuild/delay.obj
  3. BIN
      DefaultBuild/dipSwitch.obj
  4. BIN
      DefaultBuild/gatectrl.obj
  5. BIN
      DefaultBuild/i2c.obj
  6. BIN
      DefaultBuild/multical.abs
  7. 582
      DefaultBuild/multical.map
  8. 2607
      DefaultBuild/multical.mot
  9. BIN
      DefaultBuild/owi.obj
  10. BIN
      DefaultBuild/r_cg_cgc.obj
  11. BIN
      DefaultBuild/r_cg_cgc_user.obj
  12. BIN
      DefaultBuild/r_cg_port.obj
  13. BIN
      DefaultBuild/r_cg_port_user.obj
  14. BIN
      DefaultBuild/r_cg_serial.obj
  15. BIN
      DefaultBuild/r_cg_serial_user.obj
  16. BIN
      DefaultBuild/r_main.obj
  17. BIN
      DefaultBuild/r_systeminit.obj
  18. BIN
      DefaultBuild/stkinit.obj
  19. BIN
      DefaultBuild/uart.obj
  20. 68
      QualityReport(multical,DefaultBuild).txt
  21. 138
      multical.MSI.mtud
  22. 207
      owi.c
  23. 42
      owi.h

BIN
DefaultBuild/cstart.obj

Binary file not shown.

BIN
DefaultBuild/delay.obj

Binary file not shown.

BIN
DefaultBuild/dipSwitch.obj

Binary file not shown.

BIN
DefaultBuild/gatectrl.obj

Binary file not shown.

BIN
DefaultBuild/i2c.obj

Binary file not shown.

BIN
DefaultBuild/multical.abs

Binary file not shown.

582
DefaultBuild/multical.map

@ -1,4 +1,4 @@
Renesas Optimizing Linker (W3.07.00 ) 06-Mar-2026 11:09:34
Renesas Optimizing Linker (W3.07.00 ) 06-Mar-2026 22:08:41
*** Options ***
@ -62,21 +62,21 @@ SECTION START END SIZE ALIGN
.monitor1
000000ce 000000d7 a 1
.data
000000d8 0000090e 837 2
000000d8 00000916 83f 2
.text
0000090f 00000ac3 1b5 1
00000917 00000acb 1b5 1
.textf
00000ac4 00002edc 2419 1
00000acc 00002fb3 24e8 1
.const
00003000 000033d1 3d2 2
00003000 000033d9 3da 2
.SLIB
000033d2 00005c87 28b6 1
000033da 00005c8f 28b6 1
.monitor2
0003fe00 0003ffff 200 1
.bss
000fb500 000fdbc5 26c6 2
000fb500 000fdbe9 26ea 2
.dataR
000fdbc6 000fe3fc 837 2
000fdbea 000fe428 83f 2
.sbss
000ffe20 000ffe20 0 2
.sdataR
@ -84,9 +84,9 @@ SECTION START END SIZE ALIGN
*** Total Section Size ***
RAMDATA SECTION: 00002efd Byte(s)
ROMDATA SECTION: 00000eb5 Byte(s)
PROGRAM SECTION: 00004e84 Byte(s)
RAMDATA SECTION: 00002f29 Byte(s)
ROMDATA SECTION: 00000ec5 Byte(s)
PROGRAM SECTION: 00004f53 Byte(s)
*** Symbol List ***
@ -118,433 +118,441 @@ SECTION=.data
FILE=DefaultBuild\r_main.obj
000000d8 000008fa 823
FILE=DefaultBuild\owi.obj
000008fc 00000900 5
000008fc 00000908 d
FILE=DefaultBuild\i2c.obj
00000902 00000909 8
0000090a 00000911 8
FILE=DefaultBuild\uart.obj
0000090a 0000090c 3
00000912 00000914 3
FILE=DefaultBuild\gatectrl.obj
0000090e 0000090e 1
00000916 00000916 1
SECTION=.text
FILE=DefaultBuild\cstart.obj
0000090f 00000981 73
00000917 00000989 73
_start
0000090f 0 none ,g *
00000917 0 none ,g *
_exit
0000097f 0 none ,g *
00000987 0 none ,g *
_atexit
00000981 0 none ,g *
00000989 0 none ,g *
FILE=DefaultBuild\r_cg_serial_user.obj
00000982 00000ac3 142
0000098a 00000acb 142
_r_uart0_interrupt_receive@1
00000982 61 func ,l *
0000098a 61 func ,l *
_r_uart0_interrupt_send@1
000009e3 2f func ,l *
000009eb 2f func ,l *
_r_uart1_interrupt_receive@1
00000a12 61 func ,l *
00000a1a 61 func ,l *
_r_uart1_interrupt_send@1
00000a73 2f func ,l *
00000a7b 2f func ,l *
_r_iica0_interrupt@1
00000aa2 22 func ,l *
00000aaa 22 func ,l *
SECTION=.textf
FILE=DefaultBuild\stkinit.obj
00000ac4 00000b07 44
00000acc 00000b0f 44
_stkinit
00000ac4 0 none ,g *
00000acc 0 none ,g *
LSTINIT1
00000ad2 0 none ,l *
00000ada 0 none ,l *
LSTINIT2
00000afc 0 none ,l *
00000b04 0 none ,l *
LSTINIT3
00000b07 0 none ,l *
00000b0f 0 none ,l *
FILE=DefaultBuild\r_main.obj
00000b08 00001a61 f5a
00000b10 00001a69 f5a
_RS485_Bridge_Push
00000b08 2b func ,g *
00000b10 2b func ,g *
_RS485_Bridge_ResetFifo@1
00000b33 e func ,l *
00000b3b e func ,l *
_RS485_Bridge_ReadLine@1
00000b41 91 func ,l *
00000b49 91 func ,l *
_Is_V_Response_For@1
00000bd2 40 func ,l *
00000bda 40 func ,l *
_UART1_WaitTxIdle@1
00000c12 2c func ,l *
00000c1a 2c func ,l *
_UART1_SendString_Safe@1
00000c3e 39 func ,l *
00000c46 39 func ,l *
_RS485_Bridge_DrainToPC@1
00000c77 4d func ,l *
00000c7f 4d func ,l *
_hex2byte@1
00000cc4 56 func ,l *
00000ccc 56 func ,l *
_parse_x_prefix@1
00000d1a 153 func ,l *
00000d22 153 func ,l *
_OUT_PRINT@1
00000e6d d func ,l *
00000e75 d func ,l *
_send_end_response@1
00000e7a 8 func ,l *
00000e82 8 func ,l *
_parse_x_v_cmd@1
00000e82 57 func ,l *
00000e8a 57 func ,l *
_send_n_response@1
00000ed9 2b func ,l *
00000ee1 2b func ,l *
_parse_x_o_cmd@1
00000f04 57 func ,l *
00000f0c 57 func ,l *
_send_v_response@1
00000f5b 3f func ,l *
00000f63 3f func ,l *
_UART0_WaitTxDone_Flag@1
00000f9a 3f func ,l *
00000fa2 3f func ,l *
_PC_PrintLine_CRLF@1
00000fd9 7c func ,l *
00000fe1 7c func ,l *
_scan_one_addr_rs485@1
00001055 f8 func ,l *
0000105d f8 func ,l *
_build_line_from_rx@1
0000114d 63 func ,l *
00001155 63 func ,l *
_detect_protocol@1
000011b0 37 func ,l *
000011b8 37 func ,l *
_cmd_unknown@1
000011e7 10 func ,l *
000011ef 10 func ,l *
_process_cmd@1
000011f7 6d func ,l *
000011ff 6d func ,l *
_process_cmd_by_prefix@1
00001264 11 func ,l *
0000126c 11 func ,l *
_process_one_line@1
00001275 6f6 func ,l *
0000127d 6f6 func ,l *
_handle_uart_command_line
0000196b 78 func ,g *
00001973 78 func ,g *
_main
000019e3 68 func ,g *
000019eb 68 func ,g *
_R_MAIN_UserInit
00001a4b 17 func ,g *
00001a53 17 func ,g *
FILE=DefaultBuild\r_systeminit.obj
00001a62 00001aa2 41
00001a6a 00001aaa 41
_R_Systeminit
00001a62 3a func ,g *
00001a6a 3a func ,g *
_hdwinit
00001a9c 7 func ,g *
00001aa4 7 func ,g *
FILE=DefaultBuild\r_cg_cgc.obj
00001aa3 00001acc 2a
00001aab 00001ad4 2a
_R_CGC_Create
00001aa3 2a func ,g *
00001aab 2a func ,g *
FILE=DefaultBuild\r_cg_cgc_user.obj
00001acd 00001acf 3
00001ad5 00001ad7 3
_R_CGC_Get_ResetSource
00001acd 3 func ,g *
00001ad5 3 func ,g *
FILE=DefaultBuild\r_cg_serial.obj
00001ad0 00001db3 2e4
00001ad8 00001dbb 2e4
_R_SAU0_Create
00001ad0 10 func ,g *
00001ad8 10 func ,g *
_R_UART0_Create
00001ae0 6e func ,g *
00001ae8 6e func ,g *
_R_UART0_Start
00001b4e 26 func ,g *
00001b56 26 func ,g *
_R_UART0_Stop
00001b74 1e func ,g *
00001b7c 1e func ,g *
_R_UART0_Receive
00001b92 18 func ,g *
00001b9a 18 func ,g *
_R_UART0_Send
00001baa 26 func ,g *
00001bb2 26 func ,g *
_R_SAU1_Create
00001bd0 10 func ,g *
00001bd8 10 func ,g *
_R_UART1_Create
00001be0 6e func ,g *
00001be8 6e func ,g *
_R_UART1_Start
00001c4e 26 func ,g *
00001c56 26 func ,g *
_R_UART1_Stop
00001c74 1e func ,g *
00001c7c 1e func ,g *
_R_UART1_Receive
00001c92 18 func ,g *
00001c9a 18 func ,g *
_R_UART1_Send
00001caa 26 func ,g *
00001cb2 26 func ,g *
_R_IICA0_Create
00001cd0 50 func ,g *
00001cd8 50 func ,g *
_R_IICA0_Stop
00001d20 5 func ,g *
00001d28 5 func ,g *
_R_IICA0_StopCondition
00001d25 5 func ,g *
00001d2d 5 func ,g *
_R_IICA0_Master_Send
00001d2a 43 func ,g *
00001d32 43 func ,g *
_R_IICA0_Master_Receive
00001d6d 47 func ,g *
00001d75 47 func ,g *
FILE=DefaultBuild\r_cg_serial_user.obj
00001db4 00001f56 1a3
00001dbc 00001f5e 1a3
_r_uart0_callback_receiveend@1
00001db4 5e func ,l *
00001dbc 5e func ,l *
_r_uart0_callback_softwareoverrun@1
00001e12 1 func ,l *
00001e1a 1 func ,l *
_r_uart0_callback_sendend@1
00001e13 9 func ,l *
00001e1b 9 func ,l *
_r_uart0_callback_error@1
00001e1c 5c func ,l *
00001e24 5c func ,l *
_r_uart1_callback_receiveend@1
00001e78 31 func ,l *
00001e80 31 func ,l *
_r_uart1_callback_softwareoverrun@1
00001ea9 1 func ,l *
00001eb1 1 func ,l *
_r_uart1_callback_sendend@1
00001eaa 4 func ,l *
00001eb2 4 func ,l *
_r_uart1_callback_error@1
00001eae 1 func ,l *
00001eb6 1 func ,l *
_iica0_masterhandler@1
00001eaf 91 func ,l *
00001eb7 91 func ,l *
_r_iica0_callback_master_error@1
00001f40 7 func ,l *
00001f48 7 func ,l *
_r_iica0_callback_master_receiveend@1
00001f47 8 func ,l *
_r_iica0_callback_master_sendend@1
00001f4f 8 func ,l *
_r_iica0_callback_master_sendend@1
00001f57 8 func ,l *
FILE=DefaultBuild\r_cg_port.obj
00001f57 00001faf 59
00001f5f 00001fb7 59
_R_PORT_Create
00001f57 59 func ,g *
00001f5f 59 func ,g *
FILE=DefaultBuild\owi.obj
00001fb0 000026f1 742
00001fb8 000027c8 811
_GPIO_Clear
00001fb0 12 func ,g *
00001fb8 12 func ,g *
_GPIO_Input
00001fc2 11 func ,g *
00001fca 11 func ,g *
_GPIO_Read
00001fd3 9 func ,g *
_OWI_Release
00001fdc 11 func ,g *
00001fdb 9 func ,g *
_OWI_Release@1
00001fe4 11 func ,l *
_GPIO_StrongDriveHighKick@1
00001fed 32 func ,l *
00001ff5 32 func ,l *
_GPIO_ForceHighKick
0000201f 8 func ,g *
_OWI_DriveLow
00002027 12 func ,g *
00002027 8 func ,g *
_OWI_DriveLow@1
0000202f 12 func ,l *
_OWI_HasTimeout
00002041 4 func ,g *
_OWI_ClearTimeout
00002045 e func ,g *
_OWI_GetLastTimeoutByteIndex
00002053 4 func ,g *
_OWI_GetLastTimeoutBitIndex
00002057 4 func ,g *
_OWI_Init
00002039 18 func ,g *
0000205b 1b func ,g *
_OWI_Start
00002051 1e func ,g *
00002076 17 func ,g *
_OWI_Stop
0000206f 14 func ,g *
0000208d 14 func ,g *
_OWI_StopRead@1
00002083 17 func ,l *
000020a1 17 func ,l *
_OWI_SecureStop
0000209a 54 func ,g *
000020b8 51 func ,g *
_OWI_WriteBit
000020ee 4d func ,g *
00002109 34 func ,g *
_OWI_WriteByte
0000213b 2a func ,g *
0000213d 2a func ,g *
_OWI_ReadBit
00002165 89 func ,g *
00002167 c7 func ,g *
_OWI_ReadByte
000021ee 32 func ,g *
0000222e 3b func ,g *
_OWI_T_ReadBytesAndPrint
00002220 ff func ,g *
00002269 123 func ,g *
_OWI_A_CommandMode
0000231f 262 func ,g *
0000238c 283 func ,g *
_OWI_disable
00002581 15 func ,g *
0000260f 15 func ,g *
_OWI_T_CommandMode
00002596 5d func ,g *
00002624 5d func ,g *
_OWI_CommandMode
000025f3 4a func ,g *
00002681 4d func ,g *
_OWI_ReadBytesAndPrint
0000263d b5 func ,g *
000026ce fb func ,g *
FILE=DefaultBuild\i2c.obj
000026f2 00002872 181
000027c9 00002949 181
_disable
000026f2 26 func ,g *
000027c9 26 func ,g *
_I2C_EnablePower
00002718 4 func ,g *
000027ef 4 func ,g *
_I2C_DisablePower
0000271c 3 func ,g *
000027f3 3 func ,g *
_I2C_T_Command_Mode_receiveData
0000271f 4d func ,g *
000027f6 4d func ,g *
_I2C_Command_Mode_receiveData
0000276c 3e func ,g *
00002843 3e func ,g *
_I2C_Command_Mode_Send
000027aa c9 func ,g *
00002881 c9 func ,g *
FILE=DefaultBuild\uart.obj
00002873 00002a48 1d6
0000294a 00002b1f 1d6
_rs485_recover
00002873 56 func ,g *
0000294a 56 func ,g *
_UART1_WaitTxIdle@1
000028c9 2c func ,l *
000029a0 2c func ,l *
_rs485_set_tx
000028f5 b func ,g *
000029cc b func ,g *
_rs485_init
00002900 c func ,g *
000029d7 c func ,g *
_UART0_WaitTxDone_Us
0000290c 2f func ,g *
000029e3 2f func ,g *
_RS485_Send
0000293b 1e func ,g *
00002a12 1e func ,g *
_RS485_SendString
00002959 11 func ,g *
00002a30 11 func ,g *
_uart_send_string
0000296a 11 func ,g *
00002a41 11 func ,g *
_uart1_send_string
0000297b 40 func ,g *
00002a52 40 func ,g *
_uart_send_hex
000029bb 43 func ,g *
00002a92 43 func ,g *
_uart1_send_hex
000029fe 4b func ,g *
00002ad5 4b func ,g *
FILE=DefaultBuild\delay.obj
00002a49 00002b07 bf
00002b20 00002bde bf
_delay
00002a49 18 func ,g *
00002b20 18 func ,g *
_delay_us
00002a61 82 func ,g *
00002b38 82 func ,g *
_delay_ms
00002ae3 25 func ,g *
00002bba 25 func ,g *
FILE=DefaultBuild\dipSwitch.obj
00002b08 00002b18 11
00002bdf 00002bef 11
_DipSwitch_Init
00002b08 8 func ,g *
00002bdf 8 func ,g *
_DipSwitch_ReadAddr_0to31
00002b10 9 func ,g *
00002be7 9 func ,g *
FILE=DefaultBuild\gatectrl.obj
00002b19 00002edc 3c4
00002bf0 00002fb3 3c4
_Gate_SetByNum
00002b19 372 func ,g *
00002bf0 372 func ,g *
_Cal_Init
00002e8b 21 func ,g *
00002f62 21 func ,g *
_Eol_Init
00002eac 21 func ,g *
00002f83 21 func ,g *
_GateCtrl_SelectChannel
00002ecd 10 func ,g *
00002fa4 10 func ,g *
SECTION=.const
FILE=DefaultBuild\r_main.obj
00003000 000031dc 1dd
FILE=DefaultBuild\owi.obj
000031de 000032a6 c9
000031de 000032ae d1
FILE=DefaultBuild\i2c.obj
000032a8 00003395 ee
000032b0 0000339d ee
FILE=DefaultBuild\gatectrl.obj
00003396 000033d1 3c
0000339e 000033d9 3c
SECTION=.SLIB
FILE=isdigit
000033d2 000033db a
000033da 000033e3 a
_isdigit
000033d2 0 none ,g *
000033da 0 none ,g *
FILE=memcpy
000033dc 000033eb 10
000033e4 000033f3 10
_memcpy
000033dc 0 none ,g *
000033e4 0 none ,g *
FILE=memset
000033ec 000033f9 e
000033f4 00003401 e
_memset
000033ec 0 none ,g *
000033f4 0 none ,g *
FILE=sprintf
000033fa 000034f2 f9
00003402 000034fa f9
_sprintf
000033fa e1 func ,g *
00003402 e1 func ,g *
__REL_sp@1
000034db 18 func ,l *
000034e3 18 func ,l *
FILE=strcpy
000034f3 000034ff d
000034fb 00003507 d
_strcpy
000034f3 0 none ,g *
000034fb 0 none ,g *
FILE=strlen
00003500 0000350a b
00003508 00003512 b
_strlen
00003500 0 none ,g *
00003508 0 none ,g *
FILE=toupper
0000350b 00003518 e
00003513 00003520 e
_toupper
0000350b 0 none ,g *
00003513 0 none ,g *
FILE=_REL_print
00003519 00005470 1f58
00003521 00005478 1f58
__REL_print
00003519 1046 func ,g *
00003521 1046 func ,g *
__REL_fltprn@1
0000455f 941 func ,l *
00004567 941 func ,l *
__REL_henkan1@1
00004ea0 28 func ,l *
00004ea8 28 func ,l *
__REL_henkan2@1
00004ec8 33 func ,l *
00004ed0 33 func ,l *
__REL_pri@1
00004efb 298 func ,l *
00004f03 298 func ,l *
__REL_fltgeti@1
00005193 19d func ,l *
0000519b 19d func ,l *
__REL_inmod@1
00005330 141 func ,l *
00005338 141 func ,l *
FILE=_COM_fdiv
00005471 0000559e 12e
00005479 000055a6 12e
__COM_fdiv
000054d0 0 none ,g *
000054d8 0 none ,g *
FILE=_COM_feq
0000559f 000055b4 16
000055a7 000055bc 16
__COM_feq
0000559f 0 none ,g *
000055a7 0 none ,g *
FILE=_COM_fge
000055b5 000055ca 16
000055bd 000055d2 16
__COM_fge
000055b5 0 none ,g *
000055bd 0 none ,g *
FILE=_COM_flt
000055cb 000055e0 16
000055d3 000055e8 16
__COM_flt
000055cb 0 none ,g *
000055d3 0 none ,g *
FILE=_COM_fmul
000055e1 000056cd ed
000055e9 000056d5 ed
__COM_fmul
0000562c 0 none ,g *
00005634 0 none ,g *
FILE=_COM_fne
000056ce 000056de 11
000056d6 000056e6 11
__COM_fne
000056ce 0 none ,g *
000056d6 0 none ,g *
FILE=_COM_ftosl
000056df 000056e6 8
000056e7 000056ee 8
__COM_ftosl
000056df 0 none ,g *
000056e7 0 none ,g *
FILE=_COM_sidiv
000056e7 00005708 22
000056ef 00005710 22
__COM_sidiv
000056e9 0 none ,g *
000056f1 0 none ,g *
FILE=_COM_sirem
00005709 00005728 20
00005711 00005730 20
__COM_sirem
00005709 0 none ,g *
00005711 0 none ,g *
FILE=_COM_ulldiv
00005729 00005752 2a
00005731 0000575a 2a
__COM_ulldiv
00005729 0 none ,g *
00005731 0 none ,g *
FILE=_COM_ullrem
00005753 00005783 31
0000575b 0000578b 31
__COM_ullrem
00005753 0 none ,g *
0000575b 0 none ,g *
FILE=_REL_f_inf
00005784 0000578b 8
0000578c 00005793 8
__REL_f_inf
00005784 0 none ,g *
0000578c 0 none ,g *
FILE=_REL_f_norm
0000578c 0000579b 10
00005794 000057a3 10
__REL_f_norm
0000578c 0 none ,g *
00005794 0 none ,g *
FILE=_REL_f_round
0000579c 000057ae 13
000057a4 000057b6 13
__REL_f_round
0000579c 0 none ,g *
000057a4 0 none ,g *
FILE=_REL_fcmp
000057af 000057e6 38
000057b7 000057ee 38
__REL_fcmp
000057af 0 none ,g *
000057b7 0 none ,g *
FILE=_REL_fordered_core
000057e7 00005802 1c
000057ef 0000580a 1c
__REL_fordered_core
000057e7 0 none ,g *
000057ef 0 none ,g *
FILE=_REL_ftol
00005803 00005837 35
0000580b 0000583f 35
__REL_ftol
00005803 0 none ,g *
0000580b 0 none ,g *
FILE=_REL_lldiv
00005838 00005a3d 206
00005840 00005a45 206
__REL_lldiv
00005854 0 none ,g *
0000585c 0 none ,g *
FILE=_REL_llrem
00005a3e 00005c41 204
00005a46 00005c49 204
__REL_llrem
00005a5b 0 none ,g *
00005a63 0 none ,g *
FILE=_REL_ltosl
00005c42 00005c66 25
00005c4a 00005c6e 25
__REL_ltosl
00005c42 0 none ,g *
00005c4a 0 none ,g *
FILE=_COM_lshr
00005c67 00005c87 21
00005c6f 00005c8f 21
__COM_lshr
00005c71 0 none ,g *
00005c79 0 none ,g *
SECTION=.monitor2
FILE=rlink_generates_02
@ -598,103 +606,111 @@ FILE=DefaultBuild\r_cg_serial.obj
_g_iica0_tx_cnt
000fc926 2 data ,g *
FILE=DefaultBuild\owi.obj
000fc928 000fd032 70b
_buf@3@OWI_ReadBytesAndPrint
000fc928 000fd057 730
_buf@7@OWI_ReadBytesAndPrint
000fc928 258 data ,l *
_out@4@OWI_ReadBytesAndPrint
000fcb80 4b3 data ,l *
_out@8@OWI_ReadBytesAndPrint
000fcb80 4d8 data ,l *
FILE=DefaultBuild\i2c.obj
000fd034 000fd73e 70b
000fd058 000fd762 70b
_rx@2@I2C_Command_Mode_Send
000fd034 258 data ,l *
000fd058 258 data ,l *
_out@3@I2C_Command_Mode_Send
000fd28c 4b3 data ,l *
000fd2b0 4b3 data ,l *
FILE=DefaultBuild\uart.obj
000fd740 000fdb41 402
000fd764 000fdb65 402
_s_uart1_txbuf@1
000fd740 400 data ,l *
000fd764 400 data ,l *
_hex@2@uart1_send_hex
000fdb40 2 data ,l *
000fdb64 2 data ,l *
FILE=sprintf
000fdb42 000fdb45 4
000fdb66 000fdb69 4
__REL_pointer@1
000fdb42 4 data ,l *
000fdb66 4 data ,l *
FILE=_REL_print
000fdb46 000fdbc5 80
000fdb6a 000fdbe9 80
_qt@1@_REL_inmod@1
000fdb46 80 data ,l *
000fdb6a 80 data ,l *
SECTION=.dataR
FILE=DefaultBuild\r_main.obj
000fdbc6 000fe3e8 823
000fdbea 000fe40c 823
_uart_rx_done
000fdbc6 1 data ,g *
000fdbea 1 data ,g *
_uart_rx_index
000fdbc8 2 data ,g *
000fdbec 2 data ,g *
_uart_rx_buffer
000fdbca 400 data ,g *
000fdbee 400 data ,g *
_uart_rx_length
000fdfca 2 data ,g *
000fdfee 2 data ,g *
_rs485_rx_done
000fdfcc 1 data ,g *
000fdff0 1 data ,g *
_rs485_rx_index
000fdfce 2 data ,g *
000fdff2 2 data ,g *
_rs485_rx_buffer
000fdfd0 400 data ,g *
000fdff4 400 data ,g *
_rs485_rx_length
000fe3d0 2 data ,g *
000fe3f4 2 data ,g *
_g_uart0_err_fef
000fe3d2 4 data ,g *
000fe3f6 4 data ,g *
_g_uart0_err_ovf
000fe3d6 4 data ,g *
000fe3fa 4 data ,g *
_g_uart0_err_pef
000fe3da 4 data ,g *
000fe3fe 4 data ,g *
_g_rs485_bridge_active
000fe3de 1 data ,g *
000fe402 1 data ,g *
_g_rs485_bridge_done
000fe3df 1 data ,g *
000fe403 1 data ,g *
_g_rs485_bridge_seq
000fe3e0 2 data ,g *
000fe404 2 data ,g *
_s_end_st@1
000fe3e2 1 data ,l *
000fe406 1 data ,l *
_g_fixed_addr
000fe3e3 1 data ,g *
000fe407 1 data ,g *
_s_rb_head@3
000fe3e4 2 data ,l *
000fe408 2 data ,l *
_s_rb_tail@4
000fe3e6 2 data ,l *
000fe40a 2 data ,l *
_s_prefix_mode@6
000fe3e8 1 data ,l *
000fe40c 1 data ,l *
FILE=DefaultBuild\owi.obj
000fe3ea 000fe3ee 5
000fe40e 000fe41a d
_bit_period_us@1
000fe3ea 4 data ,l *
000fe40e 4 data ,l *
_g_owi_timeout_latched@2
000fe3ee 1 data ,l *
000fe412 1 data ,l *
_g_owi_last_timeout_byte_index@3
000fe414 2 data ,l *
_g_owi_last_timeout_bit_index@4
000fe416 1 data ,l *
_g_owi_current_read_byte_index@5
000fe418 2 data ,l *
_g_owi_current_read_bit_index@6
000fe41a 1 data ,l *
FILE=DefaultBuild\i2c.obj
000fe3f0 000fe3f7 8
000fe41c 000fe423 8
_i2c_tx_done
000fe3f0 1 data ,g *
000fe41c 1 data ,g *
_i2c_rx_done
000fe3f1 1 data ,g *
000fe41d 1 data ,g *
_g_i2c_last_command
000fe3f2 3 data ,g *
000fe41e 3 data ,g *
_g_i2c_command_valid
000fe3f5 1 data ,g *
000fe421 1 data ,g *
_dis@1@disable
000fe3f6 2 data ,l *
000fe422 2 data ,l *
FILE=DefaultBuild\uart.obj
000fe3f8 000fe3fa 3
000fe424 000fe426 3
_g_uart0_tx_done
000fe3f8 1 data ,g *
000fe424 1 data ,g *
_g_uart1_tx_done
000fe3f9 1 data ,g *
000fe425 1 data ,g *
_g_rs485_need_recover
000fe3fa 1 data ,g *
000fe426 1 data ,g *
FILE=DefaultBuild\gatectrl.obj
000fe3fc 000fe3fc 1
000fe428 000fe428 1
_s_ch@1
000fe3fc 1 data ,l *
000fe428 1 data ,l *
Absolute value symbols
FILE=DefaultBuild\gatectrl.obj
@ -702,17 +718,17 @@ FILE=DefaultBuild\gatectrl.obj
00000028 0 none ,l *
FILE=rlink_generates_05
__s.text
0000090f 0 none ,g *
00000917 0 none ,g *
__e.text
00000ac4 0 none ,g *
00000acc 0 none ,g *
__s.textf
00000ac4 0 none ,g *
00000acc 0 none ,g *
__e.textf
00002edd 0 none ,g *
00002fb4 0 none ,g *
__s.const
00003000 0 none ,g *
__e.const
000033d2 0 none ,g *
000033da 0 none ,g *
__s.constf
00000080 0 none ,g *
__e.constf
@ -720,7 +736,7 @@ FILE=rlink_generates_05
__s.data
000000d8 0 none ,g *
__e.data
0000090f 0 none ,g *
00000917 0 none ,g *
__s.sdata
00000080 0 none ,g *
__e.sdata
@ -728,15 +744,15 @@ FILE=rlink_generates_05
__s.bss
000fb500 0 none ,g *
__e.bss
000fdbc6 0 none ,g *
000fdbea 0 none ,g *
__s.sbss
000ffe20 0 none ,g *
__e.sbss
000ffe20 0 none ,g *
__s.dataR
000fdbc6 0 none ,g *
000fdbea 0 none ,g *
__e.dataR
000fe3fd 0 none ,g *
000fe429 0 none ,g *
__s.sdataR
000ffe20 0 none ,g *
__e.sdataR
@ -750,9 +766,9 @@ FILE=rlink_generates_05
__e.RLIB
000000c4 0 none ,g *
__s.SLIB
000033d2 0 none ,g *
000033da 0 none ,g *
__e.SLIB
00005c88 0 none ,g *
00005c90 0 none ,g *
__s.option_byte
000000c0 0 none ,g *
__e.option_byte
@ -780,7 +796,7 @@ FILE=rlink_generates_05
__STACK_ADDR_START
000ffe20 0 none ,g *
__STACK_ADDR_END
000fe3fe 0 none ,g *
000fe42a 0 none ,g *
*** Unfilled Areas ***

2607
DefaultBuild/multical.mot

File diff suppressed because it is too large

BIN
DefaultBuild/owi.obj

Binary file not shown.

BIN
DefaultBuild/r_cg_cgc.obj

Binary file not shown.

BIN
DefaultBuild/r_cg_cgc_user.obj

Binary file not shown.

BIN
DefaultBuild/r_cg_port.obj

Binary file not shown.

BIN
DefaultBuild/r_cg_port_user.obj

Binary file not shown.

BIN
DefaultBuild/r_cg_serial.obj

Binary file not shown.

BIN
DefaultBuild/r_cg_serial_user.obj

Binary file not shown.

BIN
DefaultBuild/r_main.obj

Binary file not shown.

BIN
DefaultBuild/r_systeminit.obj

Binary file not shown.

BIN
DefaultBuild/stkinit.obj

Binary file not shown.

BIN
DefaultBuild/uart.obj

Binary file not shown.

68
QualityReport(multical,DefaultBuild).txt

@ -1,23 +1,45 @@
QualityReport
2026년 3월 6일 금요일 오전 11:09:34
2026년 3월 6일 금요일 오후 10:08:42
------ Start build(multical, DefaultBuild) ------
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\Bin\ccrl.exe r_main.c -cpu=S3 -o DefaultBuild\r_main.obj "-dev=C:\Program Files (x86)\Renesas Electronics\CS+\CC\Device\RL78\Devicefile\DR5F10PPJ.DVF" -g -g_line -I "..\..\Documents\카카오톡 받은 파일\IDH1.1\IDH1.1" -I ..\IDH1.1 -I . -c -msg_lang=english
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\Bin\ccrl.exe owi.c -cpu=S3 -o DefaultBuild\owi.obj "-dev=C:\Program Files (x86)\Renesas Electronics\CS+\CC\Device\RL78\Devicefile\DR5F10PPJ.DVF" -g -g_line -I "..\..\Documents\카카오톡 받은 파일\IDH1.1\IDH1.1" -I ..\IDH1.1 -I . -c -msg_lang=english
W0511106:The folder "..\..\Documents\카카오톡 받은 파일\IDH1.1\IDH1.1" specified by the "-I" option is not found.
W0511106:The folder "..\..\Documents\카카오톡 받은 파일\IDH1.1\IDH1.1" specified by the "-I" option is not found.
W0511106:The folder "..\IDH1.1" specified by the "-I" option is not found.
W0511106:The folder "..\IDH1.1" specified by the "-I" option is not found.
W0511187:The evaluation period for the option "-Odefault" of CC-RL V1 has expired. It is implicitly changed to "-Olite". Please consider purchasing the product to continue using "-Odefault". By explicitly specifying "-Olite" or "-Onothing", this warning message disappears.
W0511187:The evaluation period for the option "-Odefault" of CC-RL V1 has expired. It is implicitly changed to "-Olite". Please consider purchasing the product to continue using "-Odefault". By explicitly specifying "-Olite" or "-Onothing", this warning message disappears.
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(18):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(19):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(18):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(20):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(19):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(25):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(20):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(26):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(25):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(27):W0520301:Typedef name has already been declared (with same type)
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(26):W0520301:Typedef name has already been declared (with same type)
uart.h(15):W0520047:Incompatible redefinition of macro "RAM_BYTES" (declared at line 47 of "owi.h")
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\inc\stdint.h(27):W0520301:Typedef name has already been declared (with same type)
uart.h(15):W0520047:Incompatible redefinition of macro "RAM_BYTES" (declared at line 40 of "owi.h")
owi.c(148):W0520177:Function "OWI_StopWrite" was declared but never referenced
owi.c(153):W0520177:Function "OWI_StopWrite" was declared but never referenced
i2c.h(8):W0520047:Incompatible redefinition of macro "RAM_BYTES" (declared at line 15 of "uart.h")
r_main.c(595):W0520172:External/internal linkage conflict with previous declaration
r_main.c(769):W0520167:Argument of type "uint32_t __near" is incompatible with parameter of type "const char *__near"
r_main.c(886):W0520167:Argument of type "uint32_t __near" is incompatible with parameter of type "const char *__near"
r_main.c(800):W0520177:Variable "total_us" was declared but never referenced
r_main.c(801):W0520177:Variable "idle_us" was declared but never referenced
r_main.c(803):W0520177:Variable "got_any" was declared but never referenced
r_main.c(84):W0520177:Variable "s_end_pat" was declared but never referenced
r_main.c(179):W0520177:Function "UART1_SendBytes_Safe" was declared but never referenced
r_main.c(318):W0520177:Function "bridge_wait_until_end" was declared but never referenced
r_main.c(433):W0520177:Function "RS485_FlushJunk" was declared but never referenced
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.15.00\Bin\rlink.exe -subcommand=DefaultBuild\multical.clnk
W0561017:Paid license of CC-RL V1 is not found, and the evaluation period has expired. Please consider purchasing the product.
W0561017:Paid license of CC-RL V1 is not found, and the evaluation period has expired. Please consider purchasing the product.
Renesas Optimizing Linker Completed
------ Build ended(Error:0, Warning:12)(multical, DefaultBuild) ------
------ Build ended(Error:0, Warning:33)(multical, DefaultBuild) ------
--- CommandFile 1 ---
DefaultBuild\multical.clnk :
@ -66,17 +88,17 @@ DefaultBuild\multical.clnk :
--- SHA1 hash value of output files ---
C:\Users\temp\Desktop\new_fw\DefaultBuild\multical.abs: 10a3031058581585010b7863446fcb0452905694
C:\Users\temp\Desktop\new_fw\DefaultBuild\multical.mot: b7280311119878968df65ae2f5afb9c334dba3f6
C:\Users\MSI\Desktop\amosense\multical_4251_fw\new_fw\DefaultBuild\multical.abs: f6d5043d0c79382af1472086cda7f117177f5db8
C:\Users\MSI\Desktop\amosense\multical_4251_fw\new_fw\DefaultBuild\multical.mot: 515303f4fb1fcb2631f43f6517c666f60f8656fe
--- System Information ---
*OS Version
Microsoft Windows 10 Pro (-, 10.0.19045, WOW64)
Microsoft Windows 11 Home (-, 10.0.26200, WOW64)
*Language
한국어(대한민국)
*.NET Framework Version
Microsoft .NET Framework 4 [.NET 4.8 or later] (533325)
Microsoft .NET Framework 4 [.NET 4.8 or later] (533509)
*WebView2 Version
145.0.3800.82
@ -89,19 +111,21 @@ C:\Users\temp\Desktop\new_fw\DefaultBuild\multical.mot: b7280311119878968df65ae2
V9.13.00.05 [12 Nov 2024]
*Assembly Version
3.12.10.1
*Sales Area
Japan
*Product License
*Execution Place
C:\Program Files (x86)\Renesas Electronics\CS+\CC
*Memory Usage
*Private Working Set
311 MB
439 MB
*Number of GDI Objects
2672
2626
*Number of USER Objects
1647
1442
*Opened Files
24 editors, 24 files, 200 KB
25 editors, 25 files, 212 KB
--- Build Tool Plug-in Information ---
RH850 Build tool CC-RH Plug-in
@ -206,6 +230,20 @@ Editor plug-in DLL
1.1.0.0
*DLL File Name
SEditor.dll
Smart Configurator for RH850 Communication Plug-in
*Version
V1.02.10.03 [14 Nov 2024]
*Assembly Version
1.0.0.0
*DLL File Name
SmcCodePartRH850.dll
Smart Configurator for RL78 Communication Plug-in
*Version
V1.00.11.01 [25 Nov 2024]
*Assembly Version
1.0.0.0
*DLL File Name
SmcCodePartRL78.dll
Stack Usage Tracer
*Version
V1.05.00.02 [30 Jul 2014]
@ -237,7 +275,7 @@ Device Information Common Interface
DeviceInformation.dll
--- Main Project Information ---
C:\Users\temp\Desktop\new_fw\multical.mtpj
C:\Users\MSI\Desktop\amosense\multical_4251_fw\new_fw\multical.mtpj
Microcontroller Information
*R5F10PPJ
*File Name: Version
@ -280,6 +318,10 @@ Other Tool Information
*Version
V4.13.00.03 [24 May 2023]
*None
*None
*Code Generator
Other Information
*RL78/F14 Code Library

138
multical.MSI.mtud

File diff suppressed because one or more lines are too long

207
owi.c

@ -4,37 +4,37 @@
#include <stdio.h>
#include "uart.h"
#ifndef OWI_STRONG_DRIVE_HIGH_US
#define OWI_STRONG_DRIVE_HIGH_US 5u /* 5~20us 정도로 시작해서 튜닝 */
#define OWI_STRONG_DRIVE_HIGH_US 5u
#endif
/* 내부 상태 */
static uint32_t bit_period_us = OWI_BIT_PERIOD_US;
static uint8_t g_owi_timeout_latched = 0;
static uint16_t g_owi_last_timeout_byte_index = 0xFFFFu;
static uint8_t g_owi_last_timeout_bit_index = 0xFFu;
static uint16_t g_owi_current_read_byte_index = 0u;
static uint8_t g_owi_current_read_bit_index = 0u;
/* =========================================================
* GPIO helpers (P70 / HW Open-Drain)
* - LOW : + 0
* - HIGH : (Hi-Z) release (pull-up으로 )
* - HIGH : (Hi-Z) release
* ========================================================= */
void GPIO_Clear(void)
{
/* open-drain ON 보장 */
OWI_PORT_POM |= (uint8_t)OWI_PIN_MASK;
/* latch low */
OWI_PORT_P &= (uint8_t)~OWI_PIN_MASK;
/* output */
OWI_PORT_PM &= (uint8_t)~OWI_PIN_MASK;
}
void GPIO_Input(void)
{
OWI_PORT_POM |= OWI_PIN_MASK; // ★ 반드시
OWI_PORT_P |= OWI_PIN_MASK; // latch HIGH
OWI_PORT_PM |= OWI_PIN_MASK;
OWI_PORT_POM |= (uint8_t)OWI_PIN_MASK;
OWI_PORT_P |= (uint8_t)OWI_PIN_MASK;
OWI_PORT_PM |= (uint8_t)OWI_PIN_MASK;
}
int GPIO_Read(void)
@ -42,28 +42,19 @@ int GPIO_Read(void)
return (OWI_PORT_P & (uint8_t)OWI_PIN_MASK) ? 1 : 0;
}
void OWI_Release(void)
static void OWI_Release(void)
{
/* open-drain ON */
OWI_PORT_POM |= (uint8_t)OWI_PIN_MASK;
/* latch high (release 상태에서 깔끔) */
OWI_PORT_P |= (uint8_t)OWI_PIN_MASK;
/* input = Hi-Z */
OWI_PORT_PM |= (uint8_t)OWI_PIN_MASK;
}
static void GPIO_StrongDriveHighKick(uint32_t kick_us)
{
/* 1) 우선 release 상태 */
/* 1) 우선 release 상태 */
OWI_Release();
/* 2) 라인이 LOW면(누가 당기면) 강제 HIGH 금지 */
/* 2) 라인이 LOW면 강제 HIGH 금지 */
if (!GPIO_Read()) {
return;
}
@ -71,13 +62,13 @@ static void GPIO_StrongDriveHighKick(uint32_t kick_us)
/* 3) 오픈드레인 OFF -> push-pull */
OWI_PORT_POM &= (uint8_t)~OWI_PIN_MASK;
/* 4) 출력 HIGH로 강하게 밀어올림 */
OWI_PORT_P |= (uint8_t)OWI_PIN_MASK; /* latch high */
OWI_PORT_PM &= (uint8_t)~OWI_PIN_MASK; /* output */
/* 4) 출력 HIGH */
OWI_PORT_P |= (uint8_t)OWI_PIN_MASK;
OWI_PORT_PM &= (uint8_t)~OWI_PIN_MASK;
delay_us(kick_us);
/* 5) 다시 오픈드레인 ON + release(Hi-Z) */
/* 5) 다시 open-drain + release */
OWI_PORT_POM |= (uint8_t)OWI_PIN_MASK;
OWI_Release();
}
@ -87,18 +78,38 @@ void GPIO_ForceHighKick(void)
GPIO_StrongDriveHighKick(OWI_STRONG_DRIVE_HIGH_US);
}
void OWI_DriveLow(void)
static void OWI_DriveLow(void)
{
/* open-drain ON */
OWI_PORT_POM |= (uint8_t)OWI_PIN_MASK;
/* latch low */
OWI_PORT_P &= (uint8_t)~OWI_PIN_MASK;
/* output */
OWI_PORT_PM &= (uint8_t)~OWI_PIN_MASK;
}
/* =========================================================
* Diagnostics
* ========================================================= */
uint8_t OWI_HasTimeout(void)
{
return g_owi_timeout_latched;
}
void OWI_ClearTimeout(void)
{
g_owi_timeout_latched = 0;
g_owi_last_timeout_byte_index = 0xFFFFu;
g_owi_last_timeout_bit_index = 0xFFu;
}
uint16_t OWI_GetLastTimeoutByteIndex(void)
{
return g_owi_last_timeout_byte_index;
}
uint8_t OWI_GetLastTimeoutBitIndex(void)
{
return g_owi_last_timeout_bit_index;
}
/* =========================================================
* OWI Init
* ========================================================= */
@ -107,12 +118,12 @@ void OWI_Init(uint32_t bit_time_us)
bit_period_us = bit_time_us;
(void)bit_period_us; /* 현재 타이밍은 매크로(TBIT) 사용 */
/* HW Open-Drain enable: P70만 */
OWI_PORT_POM |= (uint8_t)OWI_PIN_MASK;
/* 내부 Pull-up: 필요 시 사용(외부 풀업이면 꺼도 됨) */
//OWI_PORT_PU |= (uint8_t)OWI_PIN_MASK;
OWI_PORT_PU &= (uint8_t)~OWI_PIN_MASK; // P70만 OFF
/* 외부 pull-up 사용 */
OWI_PORT_PU &= (uint8_t)~OWI_PIN_MASK;
OWI_ClearTimeout();
/* idle = release */
GPIO_Input();
@ -120,6 +131,8 @@ void OWI_Init(uint32_t bit_time_us)
/* =========================================================
* Start/Stop/Secure
* - 퀀
* - strong만
* ========================================================= */
void OWI_Start(void)
{
@ -127,8 +140,6 @@ void OWI_Start(void)
delay_us(TSTART_HOLD);
GPIO_Input();
GPIO_StrongDriveHighKick(OWI_STRONG_DRIVE_HIGH_US);
delay_us(TBIT);
}
@ -137,27 +148,19 @@ void OWI_Stop(void)
GPIO_Input();
delay_us(TSTOP_LOW);
delay_us(TIDLE);
//GPIO_Clear();
}
/* =========================================================
* Stop conditions
* - Write stop : keep line HIGH (release) for tOWI_STOP
* - Read stop : clamp line LOW for tOWI_STOP to terminate slave response loop
* ========================================================= */
static void OWI_StopWrite(void)
{
/* Request 종료: HIGH 고정(Release) */
OWI_Release();
delay_us(TSTOP_LOW); /* tOWI_STOP (>= 2*TBIT 권장) */
delay_us(TIDLE); /* bus free time */
delay_us(TSTOP_LOW);
delay_us(TIDLE);
}
static void OWI_StopRead(void)
{
/* Response 종료: 마스터가 LOW로 클램프해서 stop 생성 */
OWI_DriveLow();
delay_us(TSTOP_LOW); /* tOWI_STOP */
delay_us(TSTOP_LOW);
OWI_Release();
delay_us(TIDLE);
}
@ -171,13 +174,9 @@ void OWI_SecureStop(void)
for (i = 0; i < (int)SECURE_TOGGLE_COUNT; i++) {
/* HIGH 구간: release + strong kick */
/* HIGH 구간 */
GPIO_Input();
delay_us(SECURE_TOGGLE_HIGH);
//GPIO_ForceHighKick();
// if (SECURE_TOGGLE_HIGH > OWI_STRONG_HIGH_US) {
// delay_us(SECURE_TOGGLE_HIGH - OWI_STRONG_HIGH_US);
// }
/* LOW 구간 */
GPIO_Clear();
@ -186,10 +185,7 @@ void OWI_SecureStop(void)
/* 마지막 HIGH */
GPIO_Input();
GPIO_ForceHighKick();
if (SECURE_HIGH > OWI_STRONG_HIGH_US) {
delay_us(SECURE_HIGH - OWI_STRONG_HIGH_US);
}
delay_us(SECURE_HIGH);
/* 이어서 기존 시퀀스 유지 */
GPIO_Clear();
@ -199,6 +195,8 @@ void OWI_SecureStop(void)
/* =========================================================
* Bit/Byte IO
* - HIGH -> LOW
* - strong만
* ========================================================= */
void OWI_WriteBit(int bit)
{
@ -207,12 +205,7 @@ void OWI_WriteBit(int bit)
/* HIGH 구간 */
OWI_Release();
/* (선택) HIGH 초반에만 아주 짧게 킥 */
GPIO_StrongDriveHighKick(5u);
/* 나머지 HIGH 시간 */
if (t_high > 5u) delay_us(t_high - 5u);
delay_us(t_high);
/* LOW 구간 */
OWI_DriveLow();
@ -234,22 +227,32 @@ uint8_t OWI_ReadBit(void)
int timeout = (int)(bit_period_us * 2u);
while (!(GPIO_Read()) && timeout-- > 0) {
delay_us(1);
delay_us(1u);
}
if (timeout <= 0) {
if (!g_owi_timeout_latched) {
HOST_PRINT("OWI Timeout\r\n");
char msg[64];
g_owi_timeout_latched = 1;
g_owi_last_timeout_byte_index = g_owi_current_read_byte_index;
g_owi_last_timeout_bit_index = g_owi_current_read_bit_index;
sprintf(msg, "OWI Timeout B%u b%u\r\n",
(unsigned)g_owi_last_timeout_byte_index,
(unsigned)g_owi_last_timeout_bit_index);
HOST_PRINT(msg);
}
return 0xFF;
/* 기존 0xFF는 데이터를 오염시킴 */
return 0u;
}
delay_us((bit_period_us * 1u) / 2u);
bit = (uint8_t)GPIO_Read();
delay_us((bit_period_us * 2u) / 5u);
return bit;
return (bit ? 1u : 0u);
}
uint8_t OWI_ReadByte(void)
@ -258,6 +261,7 @@ uint8_t OWI_ReadByte(void)
int i;
for (i = 7; i >= 0; i--) {
g_owi_current_read_bit_index = (uint8_t)(7 - i);
data |= (uint8_t)(OWI_ReadBit() << i);
}
return data;
@ -275,8 +279,12 @@ void OWI_T_ReadBytesAndPrint(int length)
uint8_t va0, va1;
if (length > 129) length = 129;
if (length <= 0) return;
OWI_ClearTimeout();
for (i = 0; i < length; i++) {
g_owi_current_read_byte_index = (uint16_t)i;
buf[i] = OWI_ReadByte();
}
@ -286,7 +294,7 @@ void OWI_T_ReadBytesAndPrint(int length)
for (i = 1; i < length; i += 2) {
va0 = buf[i];
va1 = buf[i + 1];
va1 = (uint8_t)((i + 1 < length) ? buf[i + 1] : 0u);
delay(10000);
sprintf(uart_buf, "%02X%02X ", va0, va1);
@ -297,7 +305,7 @@ void OWI_T_ReadBytesAndPrint(int length)
}
/* =========================================================
* Command / Diagnostic ( )
* Command / Diagnostic
* ========================================================= */
#define OWI_MAX_RETRY 2
#define OWI_RECOVERY_MIN_US 500
@ -330,22 +338,33 @@ void OWI_A_CommandMode(const uint8_t *tx_data, uint8_t tx_len, uint8_t id)
delay_us(OWI_RECOVERY_MIN_US);
for (i = 0; i < RAM_BYTES; i++) rx[i] = 0xFF;
for (i = 0; i < RAM_BYTES; i++) rx[i] = 0xFFu;
for (retry = 0; retry <= OWI_MAX_RETRY; retry++) {
delay_us(OWI_RECOVERY_MIN_US);
OWI_ClearTimeout();
OWI_SecureStop();
OWI_WriteByte(read_address);
for (i = 0; i < RAM_BYTES; i++) rx[i] = OWI_ReadByte();
for (i = 0; i < RAM_BYTES; i++) {
g_owi_current_read_byte_index = (uint16_t)i;
rx[i] = OWI_ReadByte();
}
OWI_Stop();
all_ff = 1;
for (i = 0; i < RAM_BYTES; i++) {
if (rx[i] != 0xFF) { all_ff = 0; break; }
if (rx[i] != 0xFFu) {
all_ff = 0;
break;
}
}
if (!all_ff) break;
if (!all_ff && !OWI_HasTimeout()) {
break;
}
if (retry == OWI_MAX_RETRY) {
return;
@ -356,33 +375,43 @@ void OWI_A_CommandMode(const uint8_t *tx_data, uint8_t tx_len, uint8_t id)
line[n++] = ',';
}
if (tx_data != NULL && tx_len == 3) {
if (tx_data != NULL && tx_len == 3u) {
for (retry = 0; retry <= OWI_MAX_RETRY; retry++) {
OWI_ClearTimeout();
OWI_SecureStop();
OWI_WriteByte((uint8_t)(id << 1));
for (i = 0; i < 3; i++) {
OWI_WriteByte(tx_data[i]);
}
OWI_Stop();
OWI_Stop();
delay_us(OWI_RECOVERY_MIN_US);
for (i = 0; i < RAM_BYTES; i++) rx[i] = 0xFF;
for (i = 0; i < RAM_BYTES; i++) rx[i] = 0xFFu;
OWI_SecureStop();
OWI_WriteByte((uint8_t)((id << 1) | 1u));
for (i = 0; i < RAM_BYTES; i++) {
g_owi_current_read_byte_index = (uint16_t)i;
rx[i] = OWI_ReadByte();
}
OWI_Stop();
all_ff = 1;
for (i = 0; i < RAM_BYTES; i++) {
if (rx[i] != 0xFF) { all_ff = 0; break; }
if (rx[i] != 0xFFu) {
all_ff = 0;
break;
}
}
if (!all_ff) break;
if (!all_ff && !OWI_HasTimeout()) {
break;
}
if (retry == OWI_MAX_RETRY) {
return;
@ -399,7 +428,6 @@ void OWI_A_CommandMode(const uint8_t *tx_data, uint8_t tx_len, uint8_t id)
line[n] = '\0';
HOST_PRINT(line);
delay(10000);
}
@ -412,7 +440,6 @@ void OWI_T_CommandMode(const uint8_t *tx_data, uint8_t tx_len, uint8_t id)
{
int i;
delay_us(10000);
OWI_Init(OWI_BIT_PERIOD_US);
@ -431,6 +458,8 @@ void OWI_CommandMode(const uint8_t *tx_data, uint8_t tx_len, uint8_t id)
{
int i;
OWI_ClearTimeout();
OWI_SecureStop();
OWI_WriteByte((uint8_t)(id << 1));
@ -445,7 +474,7 @@ void OWI_CommandMode(const uint8_t *tx_data, uint8_t tx_len, uint8_t id)
void OWI_ReadBytesAndPrint(int length, uint8_t id)
{
static uint8_t buf[600];
static char out[2*600 + 3];
static char out[2 * 600 + 40];
int i;
uint16_t p = 0;
@ -455,12 +484,13 @@ void OWI_ReadBytesAndPrint(int length, uint8_t id)
}
if (length > 600) length = 600;
g_owi_timeout_latched = 0;
OWI_ClearTimeout();
OWI_SecureStop();
OWI_WriteByte((uint8_t)((id << 1) | 1u));
for (i = 0; i < length; i++) {
g_owi_current_read_byte_index = (uint16_t)i;
buf[i] = OWI_ReadByte();
}
@ -469,6 +499,13 @@ void OWI_ReadBytesAndPrint(int length, uint8_t id)
out[p++] = "0123456789ABCDEF"[b >> 4];
out[p++] = "0123456789ABCDEF"[b & 0x0F];
}
if (OWI_HasTimeout()) {
p += (uint16_t)sprintf(&out[p], " !TO(B%u b%u)",
(unsigned)OWI_GetLastTimeoutByteIndex(),
(unsigned)OWI_GetLastTimeoutBitIndex());
}
out[p++] = '\r';
out[p++] = '\n';
out[p] = '\0';
@ -476,5 +513,3 @@ void OWI_ReadBytesAndPrint(int length, uint8_t id)
OWI_StopRead();
HOST_PRINT(out);
}

42
owi.h

@ -9,41 +9,44 @@
/* =========================================================
* OWI GPIO: P70 (P7.0) + HW Open-Drain (POM7.0)
* ========================================================= */
#define OWI_PORT_P P7 /* port data (read/write latch) */
#define OWI_PORT_PM PM7 /* port mode (1=input, 0=output) */
#define OWI_PORT_PU PU7 /* pull-up enable */
#define OWI_PORT_POM POM7 /* open-drain enable */
#define OWI_PORT_P P7
#define OWI_PORT_PM PM7
#define OWI_PORT_PU PU7
#define OWI_PORT_POM POM7
/* P70 = bit0 */
#define OWI_PIN_MASK (1u << 0)
/* =========================================================
* Timing ( )
* Timing
* -
* - 퀀/
* ========================================================= */
#define OWI_BIT_PERIOD_US 1200u
#define TBIT OWI_BIT_PERIOD_US
#define TLOW_0 ((TBIT * 3u) / 4u) /* 75us (double calc) */
#define TLOW_1 ((TBIT * 1u) / 4u) /* 25us */
#define TSTOP_LOW (TBIT * 2) /* 200us */
#define TIDLE (TBIT * 3) /* 300us */
#define TLOW_0 ((TBIT * 3u) / 4u)
#define TLOW_1 ((TBIT * 1u) / 4u)
#define TSTOP_LOW (TBIT * 2u)
#define TIDLE (TBIT * 3u)
#define TSTART_HOLD 50u
#define SECURE_HIGH (2u * TBIT)
#define SECURE_TOGGLE_COUNT 3u
#define SECURE_TOGGLE_LOW (TBIT / 4u)
#define SECURE_TOGGLE_HIGH (TBIT / 5u)
#define OWI_STRONG_HIGH_US 5u /* 10~80us 범위에서 튜닝 */
#define OWI_STRONG_HIGH_US 5u
/* =========================================================
* External dependencies
* Strong kick policy
* - 퀀 strong만
* ========================================================= */
#define OWI_USE_STRONG_IN_START 0u
#define OWI_USE_STRONG_IN_WRITEBIT 0u
#define OWI_USE_STRONG_IN_SECURE_LASTHIGH 0u
#ifndef RAM_BYTES
#define RAM_BYTES 3
#endif
/* =========================================================
* API
* ========================================================= */
void GPIO_Clear(void);
void GPIO_Input(void);
int GPIO_Read(void);
@ -66,8 +69,11 @@ void OWI_CommandMode (const uint8_t *tx_data, uint8_t tx_len, uint8_t id);
void OWI_A_CommandMode(const uint8_t *tx_data, uint8_t tx_len, uint8_t id);
void OWI_disable(void);
/* strong high kick (push assist) */
void GPIO_ForceHighKick(void);
uint8_t OWI_HasTimeout(void);
void OWI_ClearTimeout(void);
uint16_t OWI_GetLastTimeoutByteIndex(void);
uint8_t OWI_GetLastTimeoutBitIndex(void);
#endif /* OWI_H */
Loading…
Cancel
Save