@@ -18,102 +18,120 @@ typedef struct {
1818 uint16_t usecond ;
1919} timestamp_t ;
2020
21- // Used to define the clock direction default of the device.
21+ /// Used to define the clock direction default of the device.
2222void core_callback_define_clock_default (void );
2323
24- // It's the first callback used, right after booting the core.
25- // The pins, ports and external hardware should be initialized.
24+ /// It's the first callback used, right after booting the core.
25+ /// The pins, ports and external hardware should be initialized.
2626void core_callback_initialize_hardware (void );
2727
28- // Used to initialize the registers.
29- // All registers should be written to their default state.
28+ /// Used to initialize the registers.
29+ /// All registers should be written to their default state.
3030void core_callback_reset_registers (void );
3131
32- // Call right after load the register with default or EEPROM values.
33- // The state registers and external hardware should be configured according the value of the registers.
32+ /// Call right after load the register with default or EEPROM values.
33+ /// The state registers and external hardware should be configured according the value of the registers.
3434void core_callback_registers_were_reinitialized (void );
3535
36- // Called when the application must turn off all the visual indicators.
36+ /// Called when the application must turn off all the visual indicators.
3737void core_callback_visualen_to_on (void );
38- // Called when the application can turn on the visual indicators.
38+ /// Called when the application can turn on the visual indicators.
3939void core_callback_visualen_to_off (void );
4040
41- // When the device goes to Standby Mode.
41+ /// When the device goes to Standby Mode.
4242void core_callback_device_to_standby (void );
43- // When the device goes to Active Mode.
43+ /// When the device goes to Active Mode.
4444void core_callback_device_to_active (void );
45- // When the device goes to Speed Mode.
45+ /// When the device goes to Speed Mode.
4646void core_callback_device_to_speed (void );
4747
4848
49- // Called before execute the timer interrupts
49+ /// Called before execute the timer interrupts
5050void core_callback_t_before_exec (void );
51- // Called after execute the timer interrupts
51+ /// Called after execute the timer interrupts
5252void core_callback_t_after_exec (void );
5353
54- // Called every millisecond.
54+ /// Called every millisecond.
5555void core_callback_t_1ms (void );
56- // Called 500 microseconds after the "void core_callback_t_1ms(void)".
56+ /// Called 500 microseconds after the "void core_callback_t_1ms(void)".
5757void core_callback_t_500us (void );
58- // Called every time a new second starts.
58+ /// Called every time a new second starts.
5959void core_callback_t_new_second (void );
6060
6161
62- // Read from an application register.
62+ /// Read from an application register.
6363bool core_read_app_register (uint8_t add , uint8_t type );
64- // Write to an application register.
64+ /// Write to an application register.
6565bool core_write_app_register (uint8_t add , uint8_t type , uint8_t * content , uint16_t n_elements );
66- // Read from a common register.
66+ /// Read from a common register.
6767bool hwbp_read_common_reg (uint8_t add , uint8_t type );
68- // Write to an common register.
68+ /// Write to an common register.
6969bool hwbp_write_common_reg (uint8_t add , uint8_t type , uint8_t * content , uint16_t n_elements );
7070
7171
7272/************************************************************************/
7373/* Register RESET_APP */
7474/************************************************************************/
75- // Write to common register RESET_APP.
75+ /// Write to common register RESET_APP.
7676bool hwbp_write_common_reg_RESET_APP (void * a );
7777
78- // Used to save all registers to non-volatile memory
78+ /// Used to save all registers to non-volatile memory
7979bool core_save_all_registers_to_eeprom (void );
8080
8181
8282/************************************************************************/
8383/* Register CONFIG */
8484/************************************************************************/
85- // Write to common register CONFIG.
85+ /// Write to common register CONFIG.
8686bool hwbp_write_common_reg_CONFIG (void * a );
87- // Read from common register CONFIG.
87+ /// Read from common register CONFIG.
8888void hwbp_read_common_reg_CONFIG (void );
8989
90- // Called when the application should configure the hardware to repeat the harp timestamp clock input.
90+ /// Called when the application should configure the hardware to repeat the harp timestamp clock input.
9191void core_callback_clock_to_repeater (void );
92- // Called when the application should configure the hardware to generate the harp timestamp clock.
92+ /// Called when the application should configure the hardware to generate the harp timestamp clock.
9393void core_callback_clock_to_generator (void );
94- // Called when the timestamp lock is changed to unlocked.
94+ /// Called when the timestamp lock is changed to unlocked.
9595void core_callback_clock_to_unlock (void );
96- // Called when the timestamp lock is changed to locked.
96+ /// Called when the timestamp lock is changed to locked.
9797void core_callback_clock_to_lock (void );
9898
99- // Used to know if the device is repeating the harp timestamp clock
99+ /// Used to know if the device is repeating the harp timestamp clock
100100bool core_bool_device_is_repeater (void );
101- // Used to know if the device is generating the harp timestamp clock
101+ /// Used to know if the device is generating the harp timestamp clock
102102bool core_bool_device_is_generator (void );
103- // Used to check if the timestamp register is locked
103+ /// Used to check if the timestamp register is locked
104104bool core_bool_clock_is_locked (void );
105105
106- // Used to set the device as a repeater
106+ /// Used to set the device as a repeater
107107bool core_device_to_clock_repeater (void );
108- // Used to set the device as a generator
108+ /// Used to set the device as a generator
109109bool core_device_to_clock_generator (void );
110- // Used to lock the timestamp register
110+ /// Used to lock the timestamp register
111111bool core_clock_to_lock (void );
112- // Used to unlock the timestamp register
112+ /// Used to unlock the timestamp register
113113bool core_clock_to_unlock (void );
114114
115115
116- // It is mandatory that this function is the first of the application code.
116+ /// It is mandatory that this function is the first of the application code.
117+ void core_func_start_core_V2 (
118+ const uint16_t who_am_i ,
119+ const uint8_t hwH ,
120+ const uint8_t hwL ,
121+ const uint8_t hwP ,
122+ const uint8_t fwH ,
123+ const uint8_t fwL ,
124+ const uint8_t fwP ,
125+ uint8_t * pointer_to_app_regs ,
126+ const uint16_t app_mem_size_to_save ,
127+ const uint8_t num_of_app_registers ,
128+ const uint8_t * device_name ,
129+ const bool device_is_able_to_repeat_clock ,
130+ const bool device_is_able_to_generate_clock ,
131+ const uint8_t default_timestamp_offset
132+ );
133+
134+ /// Old initialization function. Use "core_func_start_core_V2()" instead.
117135void core_func_start_core (
118136 const uint16_t who_am_i ,
119137 const uint8_t hwH ,
@@ -130,41 +148,45 @@ void core_func_start_core (
130148 const uint8_t default_timestamp_offset
131149 );
132150
133- // Call this function in case of error
134- // A power up or reset must be performed to remove the device from this state
151+ /// Call this function in case of error
152+ /// A power up or reset must be performed to remove the device from this state
135153void core_func_catastrophic_error_detected (void );
136- // When a catastrophic error is detected (last callback before go into error state)
137- // User should shutdown all the peripherals
154+ /// When a catastrophic error is detected (last callback before go into error state)
155+ /// User should shutdown all the peripherals
138156void core_callback_catastrophic_error_detected (void );
139157
140- // Used to leave the speed mode.
158+ /// Used to leave the speed mode.
141159void core_func_leave_speed_mode_and_go_to_standby_mode (void );
142160
143161
144- // Used to create a specific timestamp that can be used when sending Events
162+ /// Used to create a specific timestamp that can be used when sending Events
145163void core_func_update_user_timestamp (uint32_t seconds , uint16_t useconds );
146164
147- // Used to read the current user timestamps
165+ /// Used to read the current user timestamps
148166void core_func_read_user_timestamp (uint32_t * seconds , uint16_t * useconds );
149167
150- // Used to save the current timestamp
168+ /// Used to save the current timestamp
151169void core_func_mark_user_timestamp (void );
152170
153- // Used to send an Event
171+ /// Used to send an Event
154172void core_func_send_event (uint8_t add , bool use_core_timestamp );
155173
156- // Used to get the content of register R_TIMESTAMP_SECOND.
174+ /// Used to get the content of register R_TIMESTAMP_SECOND.
157175uint32_t core_func_read_R_TIMESTAMP_SECOND (void );
158- // Used to get the content of register R_TIMESTAMP_MICRO.
176+ /// Used to get the content of register R_TIMESTAMP_MICRO.
159177uint16_t core_func_read_R_TIMESTAMP_MICRO (void );
160178
161179
162180
163181
164- // Return "true" if the LEDs can be ON.
182+ /// Return "true" if the LEDs can be ON.
165183bool core_bool_is_visual_enabled (void );
166- // Return "true" if the device is in Speed Mode.
184+ /// Return "true" if the device is in Speed Mode.
167185bool core_bool_speed_mode_is_in_use (void );
186+ /// Return "true" if the device is in Active Mode.
187+ bool core_bool_device_is_active (void );
188+ /// Return "true" if the device is synchronized.
189+ bool core_bool_device_is_synchronized (void );
168190
169191
170192
0 commit comments