@@ -115,6 +115,7 @@ static void hm2_read(void *void_hm2, long period) {
115115 hm2_bspi_process_tram_read (hm2 , period );
116116 hm2_absenc_process_tram_read (hm2 , period );
117117 hm2_oneshot_process_tram_read (hm2 );
118+ hm2_periodm_process_tram_read (hm2 );
118119 //UARTS PktUARTS need to be explicitly handled by an external component
119120
120121 hm2_tp_pwmgen_process_read (hm2 ); // check the status of the fault bit
@@ -137,6 +138,7 @@ static void hm2_write(void *void_hm2, long period) {
137138 hm2_ioport_gpio_prepare_tram_write (hm2 );
138139 hm2_pwmgen_prepare_tram_write (hm2 );
139140 hm2_oneshot_prepare_tram_write (hm2 );
141+ hm2_periodm_prepare_tram_write (hm2 );
140142 hm2_rcpwmgen_prepare_tram_write (hm2 );
141143 hm2_inmux_prepare_tram_write (hm2 );
142144 hm2_inm_prepare_tram_write (hm2 );
@@ -146,6 +148,7 @@ static void hm2_write(void *void_hm2, long period) {
146148 hm2_bspi_prepare_tram_write (hm2 , period );
147149 hm2_ssr_prepare_tram_write (hm2 );
148150 hm2_outm_prepare_tram_write (hm2 );
151+
149152 //UARTS need to be explicitly handled by an external component
150153 hm2_tram_write (hm2 );
151154
@@ -155,6 +158,7 @@ static void hm2_write(void *void_hm2, long period) {
155158 hm2_watchdog_write (hm2 , period ); // in case the user has written to the watchdog.timeout_ns param
156159 hm2_pwmgen_write (hm2 ); // update pwmgen registers if needed
157160 hm2_oneshot_write (hm2 ); // update oneshot registers if needed
161+ hm2_periodm_write (hm2 ); // update periodm registers if needed
158162 hm2_rcpwmgen_write (hm2 ); // update rcpwmgen registers if needed
159163 hm2_inmux_write (hm2 ); // update inmux control register if needed
160164 hm2_inm_write (hm2 ); // update inm control register if needed
@@ -321,6 +325,7 @@ const char *hm2_get_general_function_name(int gtag) {
321325 case HM2_GTAG_DPAINTER : return "Data Painter" ;
322326 case HM2_GTAG_SSR : return "SSR" ;
323327 case HM2_GTAG_ONESHOT : return "OneShot" ;
328+ case HM2_GTAG_PERIODM : return "PeriodM" ;
324329
325330 default : {
326331 static char unknown [100 ];
@@ -400,6 +405,7 @@ static int hm2_parse_config_string(hostmot2_t *hm2, char *config_string) {
400405 hm2 -> config .num_ssrs = -1 ;
401406 hm2 -> config .num_outms = -1 ;
402407 hm2 -> config .num_oneshots = -1 ;
408+ hm2 -> config .num_periodms = -1 ;
403409 hm2 -> config .enable_raw = 0 ;
404410 hm2 -> config .firmware = NULL ;
405411
@@ -462,6 +468,10 @@ static int hm2_parse_config_string(hostmot2_t *hm2, char *config_string) {
462468 token += 13 ;
463469 hm2 -> config .num_oneshots = simple_strtol (token , NULL , 0 );
464470
471+ } else if (strncmp (token , "num_periodms=" , 13 ) == 0 ) {
472+ token += 13 ;
473+ hm2 -> config .num_periodms = simple_strtol (token , NULL , 0 );
474+
465475 } else if (strncmp (token , "num_ssrs=" , 9 ) == 0 ) {
466476 token += 9 ;
467477 hm2 -> config .num_ssrs = simple_strtol (token , NULL , 0 );
@@ -558,6 +568,7 @@ static int hm2_parse_config_string(hostmot2_t *hm2, char *config_string) {
558568 HM2_DBG (" num_inms=%d\n" , hm2 -> config .num_inms );
559569 HM2_DBG (" num_outms=%d\n" , hm2 -> config .num_outms );
560570 HM2_DBG (" num_oneshots=%d\n" , hm2 -> config .num_oneshots );
571+ HM2_DBG (" num_periodms=%d\n" , hm2 -> config .num_periodms );
561572 HM2_DBG (" num_ssrs=%d\n" , hm2 -> config .num_ssrs );
562573 HM2_DBG (" num_xy2mods=%d\n" , hm2 -> config .num_xy2mods );
563574 HM2_DBG (" num_3pwmgens=%d\n" , hm2 -> config .num_tp_pwmgens );
@@ -1062,6 +1073,10 @@ static int hm2_parse_module_descriptors(hostmot2_t *hm2) {
10621073 md_accepted = hm2_oneshot_parse_md (hm2 , md_index );
10631074 break ;
10641075
1076+ case HM2_GTAG_PERIODM :
1077+ md_accepted = hm2_periodm_parse_md (hm2 , md_index );
1078+ break ;
1079+
10651080 case HM2_GTAG_RCPWMGEN :
10661081 md_accepted = hm2_rcpwmgen_parse_md (hm2 , md_index );
10671082 break ;
@@ -1140,6 +1155,7 @@ static void hm2_cleanup(hostmot2_t *hm2) {
11401155 hm2_ssr_cleanup (hm2 );
11411156 hm2_outm_cleanup (hm2 );
11421157 hm2_oneshot_cleanup (hm2 );
1158+ hm2_periodm_cleanup (hm2 );
11431159 hm2_rcpwmgen_cleanup (hm2 );
11441160
11451161 // free all the tram entries
@@ -1162,6 +1178,7 @@ void hm2_print_modules(hostmot2_t *hm2) {
11621178 hm2_ssr_print_module (hm2 );
11631179 hm2_outm_print_module (hm2 );
11641180 hm2_oneshot_print_module (hm2 );
1181+ hm2_periodm_print_module (hm2 );
11651182 hm2_watchdog_print_module (hm2 );
11661183 hm2_inmux_print_module (hm2 );
11671184 hm2_inm_print_module (hm2 );
@@ -1826,6 +1843,7 @@ void hm2_force_write(hostmot2_t *hm2) {
18261843 hm2_inm_force_write (hm2 );
18271844 hm2_xy2mod_force_write (hm2 );
18281845 hm2_oneshot_force_write (hm2 );
1846+ hm2_periodm_force_write (hm2 );
18291847
18301848 // NOTE: It's important that the SSR is written *after* the
18311849 // ioport is written. Initialization of the SSR requires that
0 commit comments