Skip to content

Commit 96b079b

Browse files
committed
Add more API documention
1 parent d88279d commit 96b079b

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
//! Device library for the STM32F746NG discovery board.
2+
//!
3+
//! Most of the device specific code is based on the stm32f746ng [reference manual],
4+
//! the [STM32CubeF7] package, and the [other stm32f746ng resources].
5+
//!
6+
//! [reference manual]: https://www.st.com/resource/en/reference_manual/dm00124865.pdf
7+
//! [STM32CubeF7]: https://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-mcu-packages/stm32cubef7.html#getsoftware-scroll
8+
//! [other stm32f746ng resources]: https://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit-arm-cortex-mcus/stm32-high-performance-mcus/stm32f7-series/stm32f7x6/stm32f746ng.html#design-scroll
9+
110
#![no_std]
211
#![feature(try_from)]
312
#![feature(trusted_len)]

src/sd/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
//! **This module is untested!**
1+
//! Provides functions to detect and initialize SD cards.
2+
//!
3+
//! **This module is currently untested!**
24
35
pub use self::init::{de_init, init};
46

src/touch.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Touchscreen functions.
2+
13
use crate::i2c::{self, I2C};
24
use arrayvec::ArrayVec;
35

@@ -8,6 +10,7 @@ const FT5336_STATUS_REGISTER: u8 = 0x02;
810
// Start locations for reading pressed touches
911
const FT5336_DATA_REGISTERS: [u8; 5] = [0x03, 0x09, 0x0F, 0x15, 0x1B];
1012

13+
/// Checks the whether the device familiy ID register contains the expected value.
1114
pub fn check_family_id(i2c_3: &mut I2C) -> Result<(), i2c::Error> {
1215
i2c_3.connect::<u8, _>(FT5336_ADDRESS, |mut conn| {
1316
// read and check device family ID
@@ -17,11 +20,13 @@ pub fn check_family_id(i2c_3: &mut I2C) -> Result<(), i2c::Error> {
1720
}
1821

1922
#[derive(Debug, Clone, Copy)]
23+
/// Represents a touch point on the display at coordinates (x,y).
2024
pub struct Touch {
2125
pub x: u16,
2226
pub y: u16,
2327
}
2428

29+
/// Returns a list of active touch points.
2530
pub fn touches(i2c_3: &mut I2C) -> Result<ArrayVec<[Touch; 5]>, i2c::Error> {
2631
let mut touches = ArrayVec::new();
2732
i2c_3.connect::<u8, _>(FT5336_ADDRESS, |mut conn| {

0 commit comments

Comments
 (0)