diff options
author | あく <alleteam@gmail.com> | 2022-01-05 19:10:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-05 19:10:18 +0300 |
commit | 389ff92cc14236db06605ee0992c9594da6cd7be (patch) | |
tree | 5b2d5777caf2a7a76c2c422c93dbb09f168134fa /firmware/targets/f6/furi_hal/furi_hal_usb_cdc_i.h | |
parent | c98e54da103ede7923af0a8b555ddb1cb8bb62fe (diff) |
Naming and coding style convention, new linter tool. (#945)
* Makefile, Scripts: new linter
* About: remove ID from IC
* Firmware: remove double define for DIVC/DIVR
* Scripts: check folder names too. Docker: replace syntax check with make lint.
* Reformat Sources and Migrate to new file naming convention
* Docker: symlink clang-format-12 to clang-format
* Add coding style guide
Diffstat (limited to 'firmware/targets/f6/furi_hal/furi_hal_usb_cdc_i.h')
-rw-r--r-- | firmware/targets/f6/furi_hal/furi_hal_usb_cdc_i.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/firmware/targets/f6/furi_hal/furi_hal_usb_cdc_i.h b/firmware/targets/f6/furi_hal/furi_hal_usb_cdc_i.h new file mode 100644 index 00000000..4ba150eb --- /dev/null +++ b/firmware/targets/f6/furi_hal/furi_hal_usb_cdc_i.h @@ -0,0 +1,24 @@ +#pragma once + +#include <stdint.h> +#include "usb_cdc.h" + +#define CDC_DATA_SZ 64 + +typedef struct { + void (*tx_ep_callback)(void* context); + void (*rx_ep_callback)(void* context); + void (*state_callback)(void* context, uint8_t state); + void (*ctrl_line_callback)(void* context, uint8_t state); + void (*config_callback)(void* context, struct usb_cdc_line_coding* config); +} CdcCallbacks; + +void furi_hal_cdc_set_callbacks(uint8_t if_num, CdcCallbacks* cb, void* context); + +struct usb_cdc_line_coding* furi_hal_cdc_get_port_settings(uint8_t if_num); + +uint8_t furi_hal_cdc_get_ctrl_line_state(uint8_t if_num); + +void furi_hal_cdc_send(uint8_t if_num, uint8_t* buf, uint16_t len); + +int32_t furi_hal_cdc_receive(uint8_t if_num, uint8_t* buf, uint16_t max_len); |