avr_isp_spi_sw.h 730 B

123456789101112131415161718192021222324
  1. #pragma once
  2. #include <furi_hal.h>
  3. typedef enum {
  4. AvrIspSpiSwSpeed1Mhz = 0,
  5. AvrIspSpiSwSpeed400Khz = 1,
  6. AvrIspSpiSwSpeed250Khz = 2,
  7. AvrIspSpiSwSpeed125Khz = 4,
  8. AvrIspSpiSwSpeed60Khz = 8,
  9. AvrIspSpiSwSpeed40Khz = 12,
  10. AvrIspSpiSwSpeed20Khz = 24,
  11. AvrIspSpiSwSpeed10Khz = 48,
  12. AvrIspSpiSwSpeed5Khz = 96,
  13. AvrIspSpiSwSpeed1Khz = 480,
  14. } AvrIspSpiSwSpeed;
  15. typedef struct AvrIspSpiSw AvrIspSpiSw;
  16. AvrIspSpiSw* avr_isp_spi_sw_init(AvrIspSpiSwSpeed speed);
  17. void avr_isp_spi_sw_free(AvrIspSpiSw* instance);
  18. uint8_t avr_isp_spi_sw_txrx(AvrIspSpiSw* instance, uint8_t data);
  19. void avr_isp_spi_sw_res_set(AvrIspSpiSw* instance, bool state);
  20. void avr_isp_spi_sw_sck_set(AvrIspSpiSw* instance, bool state);