@@ -142,8 +142,9 @@ static void hm2_write(void *void_hm2, long period) {
142142 hm2_stepgen_prepare_tram_write (hm2 , period );
143143 hm2_sserial_prepare_tram_write (hm2 , period );
144144 hm2_bspi_prepare_tram_write (hm2 , period );
145- hm2_ssr_prepare_tram_write (hm2 );
146- //UARTS need to be explicity handled by an external component
145+ hm2_ssr_prepare_tram_write (hm2 );
146+ hm2_outm_prepare_tram_write (hm2 );
147+ //UARTS need to be explicitly handled by an external component
147148 hm2_tram_write (hm2 );
148149
149150 // these usually do nothing
@@ -311,6 +312,7 @@ const char *hm2_get_general_function_name(int gtag) {
311312 case HM2_GTAG_HM2DPLL : return "Hostmot2 DPLL" ;
312313 case HM2_GTAG_INMUX : return "InMux Input Mux" ;
313314 case HM2_GTAG_INM : return "InM Input Module" ;
315+ case HM2_GTAG_OUTM : return "OutM Output Module" ;
314316 case HM2_GTAG_XY2MOD : return "xy2mod Galvo interface" ;
315317 case HM2_GTAG_DPAINTER : return "Data Painter" ;
316318 case HM2_GTAG_SSR : return "SSR" ;
@@ -390,6 +392,7 @@ static int hm2_parse_config_string(hostmot2_t *hm2, char *config_string) {
390392 hm2 -> config .num_xy2mods = -1 ;
391393 hm2 -> config .num_leds = -1 ;
392394 hm2 -> config .num_ssrs = -1 ;
395+ hm2 -> config .num_outms = -1 ;
393396 hm2 -> config .enable_raw = 0 ;
394397 hm2 -> config .firmware = NULL ;
395398
@@ -444,6 +447,14 @@ static int hm2_parse_config_string(hostmot2_t *hm2, char *config_string) {
444447 token += 9 ;
445448 hm2 -> config .num_inms = simple_strtol (token , NULL , 0 );
446449
450+ } else if (strncmp (token , "num_outms=" , 10 ) == 0 ) {
451+ token += 9 ;
452+ hm2 -> config .num_outms = simple_strtol (token , NULL , 0 );
453+
454+ } else if (strncmp (token , "num_ssrs=" , 9 ) == 0 ) {
455+ token += 9 ;
456+ hm2 -> config .num_ssrs = simple_strtol (token , NULL , 0 );
457+
447458 } else if (strncmp (token , "num_xy2mods=" , 12 ) == 0 ) {
448459 token += 12 ;
449460 hm2 -> config .num_xy2mods = simple_strtol (token , NULL , 0 );
@@ -534,6 +545,8 @@ static int hm2_parse_config_string(hostmot2_t *hm2, char *config_string) {
534545 HM2_DBG (" num_rcpwmgens=%d\n" , hm2 -> config .num_rcpwmgens );
535546 HM2_DBG (" num_inmuxs=%d\n" , hm2 -> config .num_inmuxs );
536547 HM2_DBG (" num_inms=%d\n" , hm2 -> config .num_inms );
548+ HM2_DBG (" num_outms=%d\n" , hm2 -> config .num_outms );
549+ HM2_DBG (" num_ssrs=%d\n" , hm2 -> config .num_ssrs );
537550 HM2_DBG (" num_xy2mods=%d\n" , hm2 -> config .num_xy2mods );
538551 HM2_DBG (" num_3pwmgens=%d\n" , hm2 -> config .num_tp_pwmgens );
539552 HM2_DBG (" sserial_port_0=%8.8s\n"
@@ -1027,6 +1040,10 @@ static int hm2_parse_module_descriptors(hostmot2_t *hm2) {
10271040 case HM2_GTAG_SSR :
10281041 md_accepted = hm2_ssr_parse_md (hm2 , md_index );
10291042 break ;
1043+
1044+ case HM2_GTAG_OUTM :
1045+ md_accepted = hm2_outm_parse_md (hm2 , md_index );
1046+ break ;
10301047
10311048 case HM2_GTAG_RCPWMGEN :
10321049 md_accepted = hm2_rcpwmgen_parse_md (hm2 , md_index );
@@ -1104,6 +1121,7 @@ static void hm2_cleanup(hostmot2_t *hm2) {
11041121 hm2_sserial_cleanup (hm2 );
11051122 hm2_bspi_cleanup (hm2 );
11061123 hm2_ssr_cleanup (hm2 );
1124+ hm2_outm_cleanup (hm2 );
11071125 hm2_rcpwmgen_cleanup (hm2 );
11081126
11091127 // free all the tram entries
@@ -1124,6 +1142,7 @@ void hm2_print_modules(hostmot2_t *hm2) {
11241142 hm2_bspi_print_module (hm2 );
11251143 hm2_ioport_print_module (hm2 );
11261144 hm2_ssr_print_module (hm2 );
1145+ hm2_outm_print_module (hm2 );
11271146 hm2_watchdog_print_module (hm2 );
11281147 hm2_inmux_print_module (hm2 );
11291148 hm2_inm_print_module (hm2 );
@@ -1790,5 +1809,6 @@ void hm2_force_write(hostmot2_t *hm2) {
17901809 // ioport is written. Initialization of the SSR requires that
17911810 // the IO Port pin directions is set appropriately.
17921811 hm2_ssr_force_write (hm2 );
1812+ hm2_outm_force_write (hm2 );
17931813}
17941814
0 commit comments