[sw/lib] Modify existing documentation comments to use doxygen format.
Also moved documentation of some interfaces from .c to .h files.
diff --git a/sw/lib/flash_ctrl.h b/sw/lib/flash_ctrl.h
index 544afcc..d0ba0d9 100644
--- a/sw/lib/flash_ctrl.h
+++ b/sw/lib/flash_ctrl.h
@@ -41,7 +41,7 @@
*/
int flash_check_empty(void);
-/*
+/**
* Erase flash bank |bank_idx|. Blocks until erase is complete.
*
* @param idx Flash bank index.
diff --git a/sw/lib/gpio.c b/sw/lib/gpio.c
index 1b6e920..aed2247 100644
--- a/sw/lib/gpio.c
+++ b/sw/lib/gpio.c
@@ -8,9 +8,6 @@
#include "sw/lib/common.h"
-/**
- * @param oe bits to use as output
- */
void gpio_init(uint32_t oe) { REG32(GPIO_DIRECT_OE(0)) = oe; }
void gpio_write_bit(unsigned int bit, unsigned int val) {
diff --git a/sw/lib/gpio.h b/sw/lib/gpio.h
index 08c00c7..850817c 100644
--- a/sw/lib/gpio.h
+++ b/sw/lib/gpio.h
@@ -13,7 +13,11 @@
#define GPIO_BOOTSTRAP_BIT_MASK 0x20000
+/**
+ * @param oe bits to use as output
+ */
void gpio_init(uint32_t oe);
+
void gpio_write_bit(unsigned int bit, unsigned int val);
void gpio_write_all(uint32_t val);
uint32_t gpio_read(void);
diff --git a/sw/lib/hmac.h b/sw/lib/hmac.h
index fcc2f7d..e683977 100644
--- a/sw/lib/hmac.h
+++ b/sw/lib/hmac.h
@@ -38,14 +38,14 @@
* Write |size_in_bytes| bytes of |data| to HMAC input buffer
*
* @param data pointer to input buffer.
- * @size_in_bytes number of bytes to write.
+ * @param size_in_bytes number of bytes to write.
*/
void hmac_update(const void *data, size_t size_in_bytes);
/**
* Poll for hmac done and read out digest.
*
- * @param pointer to output digest buffer.
+ * @param digest pointer to output digest buffer.
*/
void hmac_done(uint32_t *digest);
diff --git a/sw/lib/uart.c b/sw/lib/uart.c
index cbe55ec..f3b10d1 100644
--- a/sw/lib/uart.c
+++ b/sw/lib/uart.c
@@ -35,9 +35,6 @@
return !!(REG32(UART_STATUS(0)) & (1 << UART_STATUS_TXEMPTY));
}
-/**
- * Send a NULL-terminated string over UART
- */
void uart_send_str(char *str) {
while (*str != '\0') {
uart_send_char(*str++);
@@ -46,9 +43,6 @@
#define hexchar(i) (((i & 0xf) > 9) ? (i & 0xf) - 10 + 'A' : (i & 0xf) + '0')
-/**
- * Send unsigned int over UART
- */
void uart_send_uint(uint32_t n, int bits) {
for (int i = bits - 4; i >= 0; i -= 4) {
uart_send_char(hexchar(n >> i));
@@ -59,12 +53,6 @@
return !!(REG32(UART_STATUS(0)) & (1 << UART_STATUS_RXEMPTY));
}
-/**
- * Receive a single character from UART
- *
- * @param c received character, caller-allocated
- * @return 0 on success, -1 if no data is available
- */
int uart_rcv_char(char *c) {
if (uart_rx_empty()) {
return -1;
diff --git a/sw/lib/uart.h b/sw/lib/uart.h
index fca0001..8a4383f 100644
--- a/sw/lib/uart.h
+++ b/sw/lib/uart.h
@@ -12,11 +12,26 @@
#include "uart_regs.h" // Generated.
void uart_send_char(char c);
+
+/**
+ * Send unsigned int over UART
+ */
void uart_send_uint(uint32_t n, int size);
void uart_init(unsigned int baud);
+
+/**
+ * Send a NULL-terminated string over UART
+ */
void uart_send_str(char *str);
int uart_rx_empty(void);
int uart_tx_empty(void);
+
+/**
+ * Receive a single character from UART
+ *
+ * @param c received character, caller-allocated
+ * @return 0 on success, -1 if no data is available
+ */
int uart_rcv_char(char *c);
#endif
diff --git a/sw/lib/usb_simpleserial.h b/sw/lib/usb_simpleserial.h
index 8f37641..c1cc51a 100644
--- a/sw/lib/usb_simpleserial.h
+++ b/sw/lib/usb_simpleserial.h
@@ -23,18 +23,19 @@
/**
* Send a byte on a simpleserial endpoint
- * ssctx - instance context
- * c - byte to send
+ *
+ * @param ssctx instance context
+ * @param c byte to send
*/
void usb_simpleserial_send_byte(usb_ss_ctx_t *ssctx, uint8_t c);
/**
* Initialize a simpleserial endpoint
*
- * ctx - initialized usbdev context
- * ep - endpoint number for this instance
- * ssctx - unintialized simpleserial instance context
- * got_byte - callback function for when a byte is received
+ * @param ssctx unintialized simpleserial instance context
+ * @param ctx initialized usbdev context
+ * @param ep endpoint number for this instance
+ * @param got_byte callback function for when a byte is received
*/
void usb_simpleserial_init(usb_ss_ctx_t *ssctx, usbdev_ctx_t *ctx, int ep,
void (*got_byte)(uint8_t));