瀏覽代碼

Added Features section to README, main.c docs

The README now outlines the features of the PD Buddy Firmware.

A bit of documentation was added to main.c, along with renaming the
pd_buddy() function to sink().
Clara Hobbs 7 年之前
父節點
當前提交
9a484219a2
共有 2 個文件被更改,包括 18 次插入3 次删除
  1. 15
    1
      README.md
  2. 3
    2
      src/main.c

+ 15
- 1
README.md 查看文件

@@ -2,10 +2,24 @@
2 2
 
3 3
 This is the firmware for the PD Buddy project.  Currently, this specifically
4 4
 means the [PD Buddy Sink][].  The firmware is currently under heavy development,
5
-but is partially functional.
5
+but is largely functional.
6 6
 
7 7
 [PD Buddy Sink]: https://git.clayhobbs.com/pd-buddy/pd-buddy-sink
8 8
 
9
+## Features
10
+
11
+* Two boot modes, Setup and Sink, selected by the Setup button's state at
12
+  startup.
13
+* Sink mode Implements a simple USB Power Delivery sink, aiming for full
14
+  compliance with the USB Power Delivery Specification, Revision 2.0,
15
+  Version 1.3.
16
+* Requests the configured voltage and current if available, or a safe, low
17
+  power request otherwise.
18
+* Provides power on the output connector only when an explicit contract is in
19
+  place for the configured voltage and current.
20
+* Setup mode implements a USB CDC-ACM command-line interface allowing
21
+  configuration to be loaded from and stored in flash.
22
+
9 23
 ## Prerequisites
10 24
 
11 25
 To compile the firmware, you must first install the [GNU ARM Embedded

+ 3
- 2
src/main.c 查看文件

@@ -81,13 +81,14 @@ static void setup(void)
81 81
     usbStart(serusbcfg.usbp, &usbcfg);
82 82
     usbConnectBus(serusbcfg.usbp);
83 83
 
84
+    /* Start the shell */
84 85
     pdb_shell();
85 86
 }
86 87
 
87 88
 /*
88 89
  * Negotiate with the power supply for the configured power
89 90
  */
90
-static void pd_buddy(void)
91
+static void sink(void)
91 92
 {
92 93
     /* Start I2C2 to make communication with the PHY possible */
93 94
     i2cStart(&I2CD2, &i2c2config);
@@ -139,6 +140,6 @@ int main(void) {
139 140
         setup();
140 141
     } else {
141 142
         /* Button unpressed -> deliver power, buddy! */
142
-        pd_buddy();
143
+        sink();
143 144
     }
144 145
 }

Loading…
取消
儲存