|
HF-TMC51x0 Driver (TMC5130 & TMC5160) 0.1.0-dev
Hardware Agnostic C++ Driver for the TMC51x0 (TMC5130 & TMC5160)
|
Functions | |
| bool | init (QueueHandle_t event_queue) |
| Initialize ESP-NOW (WiFi STA + ESP-NOW) and start the receive task. | |
| bool | send_config_response (const Settings &s) |
| Send CONFIG_RESPONSE containing the current settings. | |
| bool | send_config_ack (bool ok, uint8_t err_code=0) |
| Send CONFIG_ACK for a CONFIG_SET request. | |
| bool | send_start_ack () |
| Send START_ACK (acknowledge START receipt). | |
| bool | send_pause_ack () |
| Send PAUSE_ACK (acknowledge PAUSE receipt). | |
| bool | send_resume_ack () |
| Send RESUME_ACK (acknowledge RESUME receipt). | |
| bool | send_stop_ack () |
| Send STOP_ACK (acknowledge STOP receipt). | |
| bool | send_status_update (uint32_t cycle, TestState state, uint8_t err_code=0, uint8_t bounds_valid=255) |
| Send STATUS_UPDATE with cycle count and state. | |
| bool | send_error (uint8_t err_code, uint32_t at_cycle) |
| Send ERROR message. | |
| bool | send_test_complete () |
| Send TEST_COMPLETE message. | |
| bool | send_bounds_result (uint8_t ok, uint8_t bounded, uint8_t cancelled, float min_deg_from_center, float max_deg_from_center, float global_min_deg, float global_max_deg) |
| Send BOUNDS_RESULT message. | |
| void | enter_pairing_mode (uint32_t timeout_sec=PAIRING_MODE_TIMEOUT_SEC) |
| Enter pairing mode for the specified duration. | |
| void | exit_pairing_mode () |
| Exit pairing mode immediately. | |
| bool | is_in_pairing_mode () |
| Check if device is currently in pairing mode. | |
| SecuritySettings & | get_security_settings () |
| Get access to the security settings for peer management. | |
| bool | add_approved_peer (const uint8_t mac[6], DeviceType type, const char *name) |
| Manually add a peer as approved (bypasses pairing). | |
| bool | remove_approved_peer (const uint8_t mac[6]) |
| Remove a peer from the approved list. | |
| size_t | get_approved_peer_count () |
| Get the number of approved peers. | |
| bool EspNowReceiver::add_approved_peer | ( | const uint8_t | mac[6], |
| DeviceType | type, | ||
| const char * | name ) |
Manually add a peer as approved (bypasses pairing).
Useful for adding pre-configured peers or debugging.
| mac | Peer's MAC address |
| type | Peer's device type |
| name | Human-readable name |
| void EspNowReceiver::enter_pairing_mode | ( | uint32_t | timeout_sec = PAIRING_MODE_TIMEOUT_SEC | ) |
Enter pairing mode for the specified duration.
While in pairing mode, the test unit will respond to PairingRequest messages from remote controllers. After the timeout expires, pairing mode is automatically disabled.
| timeout_sec | Duration of pairing mode in seconds (default: 30) |
| void EspNowReceiver::exit_pairing_mode | ( | ) |
Exit pairing mode immediately.
| size_t EspNowReceiver::get_approved_peer_count | ( | ) |
Get the number of approved peers.
| SecuritySettings & EspNowReceiver::get_security_settings | ( | ) |
Get access to the security settings for peer management.
Use this with PeerStore functions to manage approved peers.
| bool EspNowReceiver::init | ( | QueueHandle_t | event_queue | ) |
Initialize ESP-NOW (WiFi STA + ESP-NOW) and start the receive task.
ProtoEvent messages to event_queue.| event_queue | FreeRTOS queue that receives parsed ProtoEvent values. |
| bool EspNowReceiver::is_in_pairing_mode | ( | ) |
Check if device is currently in pairing mode.
| bool EspNowReceiver::remove_approved_peer | ( | const uint8_t | mac[6] | ) |
Remove a peer from the approved list.
| mac | Peer's MAC address |
| bool EspNowReceiver::send_bounds_result | ( | uint8_t | ok, |
| uint8_t | bounded, | ||
| uint8_t | cancelled, | ||
| float | min_deg_from_center, | ||
| float | max_deg_from_center, | ||
| float | global_min_deg, | ||
| float | global_max_deg ) |
Send BOUNDS_RESULT message.
| ok | 1 if bounds finding completed (bounded or default unbounded window); 0 on failure. |
| bounded | 1 if mechanical bounds were detected. |
| cancelled | 1 if cancelled by user/STOP/PAUSE. |
| min_deg_from_center | Local min bound relative to center/home (degrees). |
| max_deg_from_center | Local max bound relative to center/home (degrees). |
| global_min_deg | Global min (degrees). |
| global_max_deg | Global max (degrees). |
| bool EspNowReceiver::send_config_ack | ( | bool | ok, |
| uint8_t | err_code = 0 ) |
Send CONFIG_ACK for a CONFIG_SET request.
| ok | true if configuration was applied; false if rejected. |
| err_code | Optional error code (meaning is application-defined). |
| bool EspNowReceiver::send_config_response | ( | const Settings & | s | ) |
Send CONFIG_RESPONSE containing the current settings.
| s | Current settings (test unit portion is serialized to wire). |
| bool EspNowReceiver::send_error | ( | uint8_t | err_code, |
| uint32_t | at_cycle ) |
Send ERROR message.
| err_code | Application-defined error code. |
| at_cycle | Cycle count at which the error was observed. |
| bool EspNowReceiver::send_pause_ack | ( | ) |
Send PAUSE_ACK (acknowledge PAUSE receipt).
| bool EspNowReceiver::send_resume_ack | ( | ) |
Send RESUME_ACK (acknowledge RESUME receipt).
| bool EspNowReceiver::send_start_ack | ( | ) |
Send START_ACK (acknowledge START receipt).
| bool EspNowReceiver::send_status_update | ( | uint32_t | cycle, |
| TestState | state, | ||
| uint8_t | err_code = 0, | ||
| uint8_t | bounds_valid = 255 ) |
Send STATUS_UPDATE with cycle count and state.
| cycle | Current cycle count. |
| state | Current protocol state. |
| err_code | Optional error code (used when state == ERROR). |
| bool EspNowReceiver::send_stop_ack | ( | ) |
Send STOP_ACK (acknowledge STOP receipt).
| bool EspNowReceiver::send_test_complete | ( | ) |
Send TEST_COMPLETE message.