[FL-41] api-hal doxygen documentation (#387)

* targets/api-hal: rework documentation in doxygen style
* core/api-hal: rework documentation in doxygen style
* core/furi: rework documentation in doxygen style
* drivers: rework documentation in doxygen style

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
gornekich
2021-03-24 12:35:33 +03:00
committed by GitHub
parent cc263d743b
commit 610f4f5d73
23 changed files with 325 additions and 161 deletions

View File

@@ -12,39 +12,74 @@ typedef struct {
GpioPin* gpio;
} GpioDisableRecord;
// init GPIO API
/**
* Init GPIO API
* @return true on successful gpio initialization, false otherwize
*/
bool gpio_api_init();
// init GPIO
/**
* Init GPIO
* @param gpio GpioPin instance
* @param mode GpioMode gpio mode
*/
void gpio_init(const GpioPin* gpio, const GpioMode mode);
// init GPIO, extended version
/**
* Init GPIO, extended version
* @param gpio GpioPin instance
* @param mode GpioMode gpio mode
* @param pull GpioPull gpio pull mode
* @param speed GpioSpeed gpio speed
*/
void gpio_init_ex(
const GpioPin* gpio,
const GpioMode mode,
const GpioPull pull,
const GpioSpeed speed);
// write value to GPIO, false = LOW, true = HIGH
/**
* Write value to GPIO
* @param gpio GpioPin instance
* @param state false = LOW, true = HIGH
*/
static inline void gpio_write(const GpioPin* gpio, const bool state) {
hal_gpio_write(gpio, state);
}
// read value from GPIO, false = LOW, true = HIGH
/**
* Read value from GPIO
* @param gpio GpioPin instance
* @return false = LOW, true = HIGH
*/
static inline bool gpio_read(const GpioPin* gpio) {
return hal_gpio_read(gpio);
}
// put GPIO to Z-state
/**
* Put GPIO to Z-state
* @param gpio_record GpioDisableRecord instance
*/
void gpio_disable(GpioDisableRecord* gpio_record);
// get GPIO record
/**
* Get GPIO record
* @param name name of record
* @return ValueMutex instance
*/
ValueMutex* gpio_open_mutex(const char* name);
// get GPIO record and acquire mutex
/**
* Get GPIO record and acquire mutex
* @param name name of record
* @return GpioPin instance
*/
GpioPin* gpio_open(const char* name);
// get RFID IN level
/**
* Get RFID IN level
* @return false = LOW, true = HIGH
*/
bool get_rfid_in_level();
#ifdef __cplusplus

View File

@@ -6,8 +6,10 @@
extern "C" {
#endif
/** Interrupt callback prototype */
typedef void (*InterruptCallback)(void*, void*);
/** Interupt type */
typedef enum {
InterruptTypeComparatorTrigger,
InterruptTypeTimerCapture,
@@ -16,6 +18,7 @@ typedef enum {
InterruptTypeExternalInterrupt,
} InterruptType;
/** Interrupt callback type */
typedef struct {
InterruptCallback callback;
InterruptType type;
@@ -23,11 +26,46 @@ typedef struct {
bool ready;
} InterruptCallbackItem;
/**
* Init interrupt
* @return true on succsessful initialization, false otherwise
*/
bool api_interrupt_init();
/**
* Add interrupt
* @param callback InterruptCallback
* @param type InterruptType
* @param context context for callback
*/
void api_interrupt_add(InterruptCallback callback, InterruptType type, void* context);
/**
* Remove interrupt
* @param callback InterruptCallback
* @param type InterruptType
*/
void api_interrupt_remove(InterruptCallback callback, InterruptType type);
/**
* Enable interrupt
* @param callback InterruptCallback
* @param type InterruptType
*/
void api_interrupt_enable(InterruptCallback callback, InterruptType type);
/**
* Disable interrupt
* @param callback InterruptCallback
* @param type InterruptType
*/
void api_interrupt_disable(InterruptCallback callback, InterruptType type);
/**
* Call interrupt
* @param type InterruptType
* @param hw pointer to hardware peripheral
*/
void api_interrupt_call(InterruptType type, void* hw);
#ifdef __cplusplus