Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
run: cd esp-hal-smartled/ && cargo +esp check --features=esp32s3
# Ensure documentation can be built (requires a chip feature!)
- name: rustdoc
run: cd esp-hal-smartled/ && cargo doc --features=esp32c3
run: cd esp-hal-smartled/ && cargo doc --features=esp32c3,esp-hal-common/eh1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought in your other PR we determined this wasn't needed? Or am I missing something here?

Copy link
Contributor Author

@bugadani bugadani Jul 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, no, this is needed so that the eh1-specific links in the common crate don't throw warnings. It was just in the wrong place in that PR.

Copy link
Contributor Author

@bugadani bugadani Jul 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see how my comment was misleading. A specific example of a warning fixed by the feature can be seen here. To be fair, a proper solution would have been making the documentation conditional on the feature, but I don't think that would have been worth the complexity.


esp32-hal:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
run: cd esp32-hal/ && cargo check --example=embassy_i2c --features=embassy,embassy-time-timg0,async
# Ensure documentation can be built
- name: rustdoc
run: cd esp32-hal/ && cargo doc
run: cd esp32-hal/ && cargo doc --features=eh1

esp32c2-hal:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
run: cd esp32c2-hal/ && cargo check --example=interrupt_preemption --features=interrupt-preemption
# Ensure documentation can be built
- name: rustdoc
run: cd esp32c2-hal/ && cargo doc
run: cd esp32c2-hal/ && cargo doc --features=eh1

esp32c3-hal:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -179,7 +179,7 @@ jobs:
run: cd esp32c3-hal/ && cargo check --example=interrupt_preemption --features=interrupt-preemption
# Ensure documentation can be built
- name: rustdoc
run: cd esp32c3-hal/ && cargo doc
run: cd esp32c3-hal/ && cargo doc --features=eh1

esp32c6-hal:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -221,7 +221,7 @@ jobs:
run: cd esp32c6-hal/ && cargo check --example=interrupt_preemption --features=interrupt-preemption
# Ensure documentation can be built
- name: rustdoc
run: cd esp32c6-hal/ && cargo doc
run: cd esp32c6-hal/ && cargo doc --features=eh1

esp32h2-hal:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -263,7 +263,7 @@ jobs:
run: cd esp32h2-hal/ && cargo check --example=interrupt_preemption --features=interrupt-preemption
# Ensure documentation can be built
- name: rustdoc
run: cd esp32h2-hal/ && cargo doc
run: cd esp32h2-hal/ && cargo doc --features=eh1

esp32s2-hal:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -300,7 +300,7 @@ jobs:
run: cd esp32s2-hal/ && cargo check --example=embassy_i2c --features=embassy,embassy-time-timg0,async
# Ensure documentation can be built
- name: rustdoc
run: cd esp32s2-hal/ && cargo doc
run: cd esp32s2-hal/ && cargo doc --features=eh1

esp32s3-hal:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -342,7 +342,7 @@ jobs:
run: cd esp32s3-hal/ && cargo check --example=octal_psram --features=opsram_2m --release # This example requires release!
# Ensure documentation can be built
- name: rustdoc
run: cd esp32s3-hal/ && cargo doc
run: cd esp32s3-hal/ && cargo doc --features=eh1

esp-riscv-rt:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions esp-hal-common/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ fn gen_efuse_table(device_name: &str, out_dir: impl AsRef<Path>) {
fields.next().map(|s| s.trim()),
) {
(Some(name), Some(block), Some(bit_off), Some(bit_len), Some(desc)) => {
let desc = desc.replace('[', "`[").replace(']', "]`");
writeln!(writer, "/// {desc}").unwrap();
writeln!(
writer,
Expand Down
12 changes: 6 additions & 6 deletions esp-hal-common/src/analog/adc/cal_curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ pub trait AdcHasCurveCal {
/// This scheme implements final polynomial error correction using predefined
/// coefficient sets for each attenuation.
///
/// This scheme also includes basic calibration ([`AdcCalBasic`]) and line
/// fitting ([`AdcCalLine`]).
/// This scheme also includes basic calibration ([`super::AdcCalBasic`]) and
/// line fitting ([`AdcCalLine`]).
#[derive(Clone, Copy)]
pub struct AdcCalCurve<ADCI> {
line: AdcCalLine<ADCI>,
Expand Down Expand Up @@ -131,7 +131,7 @@ mod impls {
}

coeff_tables! {
/// Error curve coefficients derived from https://github.com/espressif/esp-idf/blob/903af13e8/components/esp_adc/esp32c3/curve_fitting_coefficients.c
/// Error curve coefficients derived from <https://github.com/espressif/esp-idf/blob/903af13e8/components/esp_adc/esp32c3/curve_fitting_coefficients.c>
#[cfg(esp32c3)]
CURVES_COEFFS1 [
Attenuation0dB => [
Expand All @@ -158,7 +158,7 @@ mod impls {
],
];

/// Error curve coefficients derived from https://github.com/espressif/esp-idf/blob/903af13e8/components/esp_adc/esp32c6/curve_fitting_coefficients.c
/// Error curve coefficients derived from <https://github.com/espressif/esp-idf/blob/903af13e8/components/esp_adc/esp32c6/curve_fitting_coefficients.c>
#[cfg(esp32c6)]
CURVES_COEFFS1 [
Attenuation0dB => [
Expand All @@ -183,7 +183,7 @@ mod impls {
],
];

/// Error curve coefficients derived from https://github.com/espressif/esp-idf/blob/903af13e8/components/esp_adc/esp32s3/curve_fitting_coefficients.c
/// Error curve coefficients derived from <https://github.com/espressif/esp-idf/blob/903af13e8/components/esp_adc/esp32s3/curve_fitting_coefficients.c>
#[cfg(esp32s3)]
CURVES_COEFFS1 [
Attenuation0dB => [
Expand All @@ -210,7 +210,7 @@ mod impls {
],
];

/// Error curve coefficients derived from https://github.com/espressif/esp-idf/blob/903af13e8/components/esp_adc/esp32s3/curve_fitting_coefficients.c
/// Error curve coefficients derived from <https://github.com/espressif/esp-idf/blob/903af13e8/components/esp_adc/esp32s3/curve_fitting_coefficients.c>
#[cfg(esp32s3)]
CURVES_COEFFS2 [
Attenuation0dB => [
Expand Down
22 changes: 11 additions & 11 deletions esp-hal-common/src/soc/esp32c2/efuse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ impl Efuse {

/// Get efuse block version
///
/// see https://github.com/espressif/esp-idf/blob/dc016f5987/components/hal/efuse_hal.c#L27-L30
/// see <https://github.com/espressif/esp-idf/blob/dc016f5987/components/hal/efuse_hal.c#L27-L30>
pub fn get_block_version() -> (u8, u8) {
// see https://github.com/espressif/esp-idf/blob/dc016f5987/components/hal/esp32c2/include/hal/efuse_ll.h#L65-L73
// https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c2/esp_efuse_table.csv#L90-L91
// see <https://github.com/espressif/esp-idf/blob/dc016f5987/components/hal/esp32c2/include/hal/efuse_ll.h#L65-L73>
// <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c2/esp_efuse_table.csv#L90-L91>
(
Self::read_field_le::<u8>(BLK_VERSION_MAJOR),
Self::read_field_le::<u8>(BLK_VERSION_MINOR),
Expand All @@ -51,7 +51,7 @@ impl Efuse {

/// Get version of RTC calibration block
///
/// see https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c2/esp_efuse_rtc_calib.c#L14
/// see <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c2/esp_efuse_rtc_calib.c#L14>
pub fn get_rtc_calib_version() -> u8 {
let (major, _minor) = Self::get_block_version();
if major == 0 {
Expand All @@ -63,15 +63,15 @@ impl Efuse {

/// Get ADC initial code for specified attenuation from efuse
///
/// see https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c2/esp_efuse_rtc_calib.c#L27
/// see <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c2/esp_efuse_rtc_calib.c#L27>
pub fn get_rtc_calib_init_code(_unit: u8, atten: Attenuation) -> Option<u16> {
let version = Self::get_rtc_calib_version();

if version != 1 {
return None;
}

// see https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c2/esp_efuse_table.csv#L94
// see <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c2/esp_efuse_table.csv#L94>
let diff_code0: u16 = Self::read_field_le(ADC1_INIT_CODE_ATTEN0);
let code0 = if diff_code0 & (1 << 7) != 0 {
2160 - (diff_code0 & 0x7f)
Expand All @@ -83,7 +83,7 @@ impl Efuse {
return Some(code0);
}

// see https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c2/esp_efuse_table.csv#L95
// see <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c2/esp_efuse_table.csv#L95>
let diff_code11: u16 = Self::read_field_le(ADC1_INIT_CODE_ATTEN3);
let code11 = code0 + diff_code11;

Expand All @@ -92,7 +92,7 @@ impl Efuse {

/// Get ADC reference point voltage for specified attenuation in millivolts
///
/// see https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c2/esp_efuse_rtc_calib.c#L65
/// see <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c2/esp_efuse_rtc_calib.c#L65>
pub fn get_rtc_calib_cal_mv(_unit: u8, atten: Attenuation) -> u16 {
match atten {
Attenuation::Attenuation0dB => 400,
Expand All @@ -102,15 +102,15 @@ impl Efuse {

/// Get ADC reference point digital code for specified attenuation
///
/// see https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c2/esp_efuse_rtc_calib.c#L65
/// see <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c2/esp_efuse_rtc_calib.c#L65>
pub fn get_rtc_calib_cal_code(_unit: u8, atten: Attenuation) -> Option<u16> {
let version = Self::get_rtc_calib_version();

if version != 1 {
return None;
}

// see https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c2/esp_efuse_table.csv#L96
// see <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c2/esp_efuse_table.csv#L96>
let diff_code0: u16 = Self::read_field_le(ADC1_CAL_VOL_ATTEN0);
let code0 = if diff_code0 & (1 << 7) != 0 {
1540 - (diff_code0 & 0x7f)
Expand All @@ -122,7 +122,7 @@ impl Efuse {
return Some(code0);
}

// see https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c2/esp_efuse_table.csv#L97
// see <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c2/esp_efuse_table.csv#L97>
let diff_code11: u16 = Self::read_field_le(ADC1_CAL_VOL_ATTEN3);
let code11 = if diff_code0 & (1 << 5) != 0 {
code0 - (diff_code11 & 0x1f)
Expand Down
20 changes: 10 additions & 10 deletions esp-hal-common/src/soc/esp32c3/efuse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ impl Efuse {

/// Get efuse block version
///
/// see https://github.com/espressif/esp-idf/blob/dc016f5987/components/hal/efuse_hal.c#L27-L30
/// see <https://github.com/espressif/esp-idf/blob/dc016f5987/components/hal/efuse_hal.c#L27-L30>
pub fn get_block_version() -> (u8, u8) {
// see https://github.com/espressif/esp-idf/blob/dc016f5987/components/hal/esp32c3/include/hal/efuse_ll.h#L70-L78
// https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c3/esp_efuse_table.csv#L163
// https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c3/esp_efuse_table.csv#L173
// see <https://github.com/espressif/esp-idf/blob/dc016f5987/components/hal/esp32c3/include/hal/efuse_ll.h#L70-L78>
// <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c3/esp_efuse_table.csv#L163>
// <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c3/esp_efuse_table.csv#L173>
(
Self::read_field_le::<u8>(BLK_VERSION_MAJOR),
Self::read_field_le::<u8>(BLK_VERSION_MINOR),
Expand All @@ -52,7 +52,7 @@ impl Efuse {

/// Get version of RTC calibration block
///
/// see https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c3/esp_efuse_rtc_calib.c#L12
/// see <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c3/esp_efuse_rtc_calib.c#L12>
pub fn get_rtc_calib_version() -> u8 {
let (major, _minor) = Self::get_block_version();
if major == 1 {
Expand All @@ -64,15 +64,15 @@ impl Efuse {

/// Get ADC initial code for specified attenuation from efuse
///
/// see https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c3/esp_efuse_rtc_calib.c#L25
/// see <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c3/esp_efuse_rtc_calib.c#L25>
pub fn get_rtc_calib_init_code(_unit: u8, atten: Attenuation) -> Option<u16> {
let version = Self::get_rtc_calib_version();

if version != 1 {
return None;
}

// See https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c3/esp_efuse_table.csv#L176-L179
// See <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c3/esp_efuse_table.csv#L176-L179>
let init_code: u16 = Self::read_field_le(match atten {
Attenuation::Attenuation0dB => ADC1_INIT_CODE_ATTEN0,
Attenuation::Attenuation2p5dB => ADC1_INIT_CODE_ATTEN1,
Expand All @@ -85,7 +85,7 @@ impl Efuse {

/// Get ADC reference point voltage for specified attenuation in millivolts
///
/// see https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c3/esp_efuse_rtc_calib.c#L49
/// see <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c3/esp_efuse_rtc_calib.c#L49>
pub fn get_rtc_calib_cal_mv(_unit: u8, atten: Attenuation) -> u16 {
match atten {
Attenuation::Attenuation0dB => 400,
Expand All @@ -97,15 +97,15 @@ impl Efuse {

/// Get ADC reference point digital code for specified attenuation
///
/// see https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c3/esp_efuse_rtc_calib.c#L49
/// see <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c3/esp_efuse_rtc_calib.c#L49>
pub fn get_rtc_calib_cal_code(_unit: u8, atten: Attenuation) -> Option<u16> {
let version = Self::get_rtc_calib_version();

if version != 1 {
return None;
}

// See https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c3/esp_efuse_table.csv#L180-L183
// See <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c3/esp_efuse_table.csv#L180-L183>
let cal_code: u16 = Self::read_field_le(match atten {
Attenuation::Attenuation0dB => ADC1_CAL_VOL_ATTEN0,
Attenuation::Attenuation2p5dB => ADC1_CAL_VOL_ATTEN1,
Expand Down
18 changes: 9 additions & 9 deletions esp-hal-common/src/soc/esp32c6/efuse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ impl Efuse {

/// Get efuse block version
///
/// see https://github.com/espressif/esp-idf/blob/dc016f5987/components/hal/efuse_hal.c#L27-L30
/// see <https://github.com/espressif/esp-idf/blob/dc016f5987/components/hal/efuse_hal.c#L27-L30>
pub fn get_block_version() -> (u8, u8) {
// see https://github.com/espressif/esp-idf/blob/dc016f5987/components/hal/esp32c6/include/hal/efuse_ll.h#L65-L73
// https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c6/esp_efuse_table.csv#L156
// see <https://github.com/espressif/esp-idf/blob/dc016f5987/components/hal/esp32c6/include/hal/efuse_ll.h#L65-L73>
// <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c6/esp_efuse_table.csv#L156>
(
Self::read_field_le::<u8>(BLK_VERSION_MAJOR),
Self::read_field_le::<u8>(BLK_VERSION_MINOR),
Expand All @@ -51,7 +51,7 @@ impl Efuse {

/// Get version of RTC calibration block
///
/// see https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c6/esp_efuse_rtc_calib.c#L20
/// see <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c6/esp_efuse_rtc_calib.c#L20>
pub fn get_rtc_calib_version() -> u8 {
let (_major, minor) = Self::get_block_version();
if minor >= 1 {
Expand All @@ -63,15 +63,15 @@ impl Efuse {

/// Get ADC initial code for specified attenuation from efuse
///
/// see https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c6/esp_efuse_rtc_calib.c#L32
/// see <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c6/esp_efuse_rtc_calib.c#L32>
pub fn get_rtc_calib_init_code(_unit: u8, atten: Attenuation) -> Option<u16> {
let version = Self::get_rtc_calib_version();

if version != 1 {
return None;
}

// See https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c6/esp_efuse_table.csv#L147-L152
// See <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c6/esp_efuse_table.csv#L147-L152>
let init_code: u16 = Self::read_field_le(match atten {
Attenuation::Attenuation0dB => ADC1_INIT_CODE_ATTEN0,
Attenuation::Attenuation2p5dB => ADC1_INIT_CODE_ATTEN1,
Expand All @@ -84,7 +84,7 @@ impl Efuse {

/// Get ADC reference point voltage for specified attenuation in millivolts
///
/// see https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c6/esp_efuse_rtc_calib.c#L42
/// see <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c6/esp_efuse_rtc_calib.c#L42>
pub fn get_rtc_calib_cal_mv(_unit: u8, atten: Attenuation) -> u16 {
match atten {
Attenuation::Attenuation0dB => 400,
Expand All @@ -96,15 +96,15 @@ impl Efuse {

/// Get ADC reference point digital code for specified attenuation
///
/// see https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c6/esp_efuse_rtc_calib.c#L42
/// see <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c6/esp_efuse_rtc_calib.c#L42>
pub fn get_rtc_calib_cal_code(_unit: u8, atten: Attenuation) -> Option<u16> {
let version = Self::get_rtc_calib_version();

if version != 1 {
return None;
}

// See https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c6/esp_efuse_table.csv#L153-L156
// See <https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c6/esp_efuse_table.csv#L153-L156>
let cal_code: u16 = Self::read_field_le(match atten {
Attenuation::Attenuation0dB => ADC1_CAL_VOL_ATTEN0,
Attenuation::Attenuation2p5dB => ADC1_CAL_VOL_ATTEN1,
Expand Down
Loading