-
Notifications
You must be signed in to change notification settings - Fork 0
UART module
alvaoze edited this page Jun 27, 2024
·
1 revision
api = HardsploitAPI()
api.load_firmware('UART')
crossvalue = [8, 9, 2, 3, 4, 5, 6, 7, 0, 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63]
api.set_cross_wiring(crossvalue)The code initializes the Hardsploit API and sets the cross-wiring configuration. It is required for the UART communication.
"set_cross_wiring()" is used to configure the physical and logical connections between Hardsploit's components.
uart = HardsploitUART(baud_rate,
word_width,
use_parity_bit,
parity_type,
nb_stop_bits,
idle_line_level,
hardsploit_api)| Parametter | Type | Range |
|---|---|---|
| baud_rate | integer | Between 2400 and 1036800 |
| word_width | integer | Between 5 and 8 |
| use_parity_bit | integer | 0 or 1 |
| parity_type | integer | 0 or 1 |
| nb_stop_bits | integer | 1 or 2 |
| idle_line_level | integer | 0 or 1 |
| hardsploit_api | Instance of HardsploitAPI |
RX -> A1
TX -> A0
uart.write(payload)| Parametter | Type | Range |
|---|---|---|
| payload | array of byte | max 4000 bytes |
This function define the payload to send.
uart.send_and_received()This fonction send the payload defined with the .write() functions then return the processed received data.
This function allow you to measure the baudrate of a Uart Chip.
uart.measure_baud_rate()