HAL to LL migration: GPIO, HSEM, AES (#1069)
* gpio, hsem, crypto: switch from HAL to LL/registers * Moved GPIO initialization to furi_hal * More HAL removed * All HAL modules disabled * HAL is finally removed * hal_gpio -> furi_hal_gpio, main.h removed * Bootloader build fix * RTOS config moved to freertos-glue * delay -> furi_hal_delay Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
		@@ -30,23 +30,23 @@ bool onewire_host_reset(OneWireHost* host) {
 | 
			
		||||
    furi_hal_ibutton_pin_high();
 | 
			
		||||
    do {
 | 
			
		||||
        if(--retries == 0) return 0;
 | 
			
		||||
        delay_us(2);
 | 
			
		||||
        furi_hal_delay_us(2);
 | 
			
		||||
    } while(!furi_hal_ibutton_pin_get_level());
 | 
			
		||||
 | 
			
		||||
    // pre delay
 | 
			
		||||
    delay_us(OWH_RESET_DELAY_PRE);
 | 
			
		||||
    furi_hal_delay_us(OWH_RESET_DELAY_PRE);
 | 
			
		||||
 | 
			
		||||
    // drive low
 | 
			
		||||
    furi_hal_ibutton_pin_low();
 | 
			
		||||
    delay_us(OWH_RESET_DRIVE);
 | 
			
		||||
    furi_hal_delay_us(OWH_RESET_DRIVE);
 | 
			
		||||
 | 
			
		||||
    // release
 | 
			
		||||
    furi_hal_ibutton_pin_high();
 | 
			
		||||
    delay_us(OWH_RESET_RELEASE);
 | 
			
		||||
    furi_hal_delay_us(OWH_RESET_RELEASE);
 | 
			
		||||
 | 
			
		||||
    // read and post delay
 | 
			
		||||
    r = !furi_hal_ibutton_pin_get_level();
 | 
			
		||||
    delay_us(OWH_RESET_DELAY_POST);
 | 
			
		||||
    furi_hal_delay_us(OWH_RESET_DELAY_POST);
 | 
			
		||||
 | 
			
		||||
    return r;
 | 
			
		||||
}
 | 
			
		||||
@@ -56,15 +56,15 @@ bool onewire_host_read_bit(OneWireHost* host) {
 | 
			
		||||
 | 
			
		||||
    // drive low
 | 
			
		||||
    furi_hal_ibutton_pin_low();
 | 
			
		||||
    delay_us(OWH_READ_DRIVE);
 | 
			
		||||
    furi_hal_delay_us(OWH_READ_DRIVE);
 | 
			
		||||
 | 
			
		||||
    // release
 | 
			
		||||
    furi_hal_ibutton_pin_high();
 | 
			
		||||
    delay_us(OWH_READ_RELEASE);
 | 
			
		||||
    furi_hal_delay_us(OWH_READ_RELEASE);
 | 
			
		||||
 | 
			
		||||
    // read and post delay
 | 
			
		||||
    result = furi_hal_ibutton_pin_get_level();
 | 
			
		||||
    delay_us(OWH_READ_DELAY_POST);
 | 
			
		||||
    furi_hal_delay_us(OWH_READ_DELAY_POST);
 | 
			
		||||
 | 
			
		||||
    return result;
 | 
			
		||||
}
 | 
			
		||||
@@ -91,19 +91,19 @@ void onewire_host_write_bit(OneWireHost* host, bool value) {
 | 
			
		||||
    if(value) {
 | 
			
		||||
        // drive low
 | 
			
		||||
        furi_hal_ibutton_pin_low();
 | 
			
		||||
        delay_us(OWH_WRITE_1_DRIVE);
 | 
			
		||||
        furi_hal_delay_us(OWH_WRITE_1_DRIVE);
 | 
			
		||||
 | 
			
		||||
        // release
 | 
			
		||||
        furi_hal_ibutton_pin_high();
 | 
			
		||||
        delay_us(OWH_WRITE_1_RELEASE);
 | 
			
		||||
        furi_hal_delay_us(OWH_WRITE_1_RELEASE);
 | 
			
		||||
    } else {
 | 
			
		||||
        // drive low
 | 
			
		||||
        furi_hal_ibutton_pin_low();
 | 
			
		||||
        delay_us(OWH_WRITE_0_DRIVE);
 | 
			
		||||
        furi_hal_delay_us(OWH_WRITE_0_DRIVE);
 | 
			
		||||
 | 
			
		||||
        // release
 | 
			
		||||
        furi_hal_ibutton_pin_high();
 | 
			
		||||
        delay_us(OWH_WRITE_0_RELEASE);
 | 
			
		||||
        furi_hal_delay_us(OWH_WRITE_0_RELEASE);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user