Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ (drivers): Add CoreDACExpander #828

Closed
wants to merge 2 commits into from

Conversation

MMyster
Copy link
Contributor

@MMyster MMyster commented Jun 3, 2022

No description provided.

@codecov
Copy link

codecov bot commented Jun 3, 2022

Codecov Report

Merging #828 (05b6441) into develop (22ae36b) will increase coverage by 0.08%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop     #828      +/-   ##
===========================================
+ Coverage    95.50%   95.59%   +0.08%     
===========================================
  Files          116      118       +2     
  Lines         2649     2703      +54     
===========================================
+ Hits          2530     2584      +54     
  Misses         119      119              
Impacted Files Coverage Δ
drivers/CoreDACTouch/include/CoreDACTouch.h 100.00% <100.00%> (ø)
drivers/CoreDACTouch/source/CoreDACTouch.cpp 100.00% <100.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@github-actions
Copy link

github-actions bot commented Jun 3, 2022

File comparision analysis report

🔖 Info

Target Flash Used (%) Flash Available (%) Static RAM (%)
bootloader 168820 (64%) 93324 (35%) 30920 (5%)
os 363544 (23%) 1201128 (76%) 73720 (14%)
Click to show memory sections
| -          |      Hex |     Bytes |  KiB |
|------------|---------:|----------:|-----:|
| Flash      | 0x200000 | 2 097 152 | 2048 |
| SRAM       |  0x80000 |   524 288 |  512 |
| Bootloader |  0x40000 |   262 144 |  256 |
| Header     |   0x1000 |     4 096 |    4 |
| OS         | 0x17E000 | 1 564 672 | 1528 |
| Tail       |   0x1000 |     4 096 |    4 |
| Scratch    |  0x40000 |   262 144 |  256 |

📝 Summary

Click to show summary
  • ✔️ - existing target
  • ✨ - new target
  • ⚰️ - deleted target
  • ✅ - files are the same
  • ❌ - files are different
Target Status .bin .map Total Flash (base/head) Total Flash Δ Static RAM (base/head) Static RAM Δ
LekaOS ✔️ 363544 (17%) ø 73720 (14%) ø
bootloader ✔️ 168820 (8%) ø 30920 (5%) ø
certs_emc_ble_bt_lcd_led_motors ✔️ 250704 (11%) ø 29240 (5%) ø
certs_emc_ble_led_motors ✔️ 174584 (8%) ø 24952 (4%) ø
certs_emc_bt_lcd_qspi_rfid_touch_wifi ✔️ 148840 (7%) ø 22528 (4%) ø
certs_emc_lcd_led_motors ✔️ 92008 (4%) ø 16168 (3%) ø
hardware_motors_test_reduction_and_wheels ✔️ 177976 (8%) ø 24360 (4%) ø
spike_lk_behavior_kit ✔️ 187568 (8%) ø 48112 (9%) ø
spike_lk_ble ✔️ 225792 (10%) ø 28056 (5%) ø
spike_lk_bluetooth ✔️ 73256 (3%) ø 11448 (2%) ø
spike_lk_cg_animations ✔️ 144632 (6%) ø 46528 (8%) ø
spike_lk_color_kit ✔️ 65712 (3%) ø 13744 (2%) ø
spike_lk_command_kit ✔️ 189760 (9%) ø 50928 (9%) ø
spike_lk_config_kit ✔️ 124188 (5%) ø 14312 (2%) ø
spike_lk_coreled ✔️ 76164 (3%) ø 13688 (2%) ø
spike_lk_event_queue ✔️ 74736 (3%) ø 12072 (2%) ø
spike_lk_file_manager_kit ✔️ 128680 (6%) ø 14384 (2%) ø
spike_lk_file_reception ✔️ 326968 (15%) ø 27576 (5%) ø
spike_lk_flash_memory ✔️ 63880 (3%) ø 11448 (2%) ø
spike_lk_fs ✔️ 171728 (8%) ø 47880 (9%) ø
spike_lk_lcd ✔️ 167468 (7%) ø 47320 (9%) ø
spike_lk_led ✔️ 65744 (3%) ø 13392 (2%) ø
spike_lk_led_kit ✔️ 103992 (4%) ø 14608 (2%) ø
spike_lk_log_kit ✔️ 63736 (3%) ø 12256 (2%) ø
spike_lk_motors ✔️ 62600 (2%) ø 11488 (2%) ø
spike_lk_reinforcer ✔️ 103480 (4%) ø 14608 (2%) ø
spike_lk_rfid ✔️ 78644 (3%) ø 11504 (2%) ø
spike_lk_sensors_battery ✔️ 78196 (3%) ø 12568 (2%) ø
spike_lk_sensors_light ✔️ 60056 (2%) ø 11440 (2%) ø
spike_lk_sensors_microphone ✔️ 72496 (3%) ø 11504 (2%) ø
spike_lk_sensors_temperature_humidity ✔️ 67048 (3%) ø 11424 (2%) ø
spike_lk_sensors_touch ✔️ 68600 (3%) ø 11432 (2%) ø
spike_lk_serial_number ✔️ 58904 (2%) ø 11464 (2%) ø
spike_lk_ticker_timeout ✔️ 69052 (3%) ø 11632 (2%) ø
spike_lk_update_process_app_base ✔️ 122804 (5%) ø 15288 (2%) ø
spike_lk_update_process_app_update ✔️ 77632 (3%) ø 12352 (2%) ø
spike_lk_watchdog_isr ✔️ 79964 (3%) ø 13296 (2%) ø
spike_lk_wifi ✔️ 116392 (5%) ø 14808 (2%) ø
spike_mbed_blinky ✔️ 57968 (2%) ø 11400 (2%) ø
spike_mbed_watchdog_ticker_vs_thread ✔️ 63208 (3%) ø 12448 (2%) ø
spike_stl_cxxsupport ✔️ 58456 (2%) ø 11400 (2%) ø

🗺️ Map files diff output

Click to show diff list

No differenes where found in map files.

@github-actions
Copy link

github-actions bot commented Jun 3, 2022

File comparision analysis report

🔖 Info

Target Flash Used (%) Flash Available (%) Static RAM (%)
bootloader 180956 (69%) 81188 (30%) 37456 (7%)
os 397932 (25%) 1166740 (74%) 80776 (15%)
Click to show memory sections
| -          |      Hex |     Bytes |  KiB |
|------------|---------:|----------:|-----:|
| Flash      | 0x200000 | 2 097 152 | 2048 |
| SRAM       |  0x80000 |   524 288 |  512 |
| Bootloader |  0x40000 |   262 144 |  256 |
| Header     |   0x1000 |     4 096 |    4 |
| OS         | 0x17E000 | 1 564 672 | 1528 |
| Tail       |   0x1000 |     4 096 |    4 |
| Scratch    |  0x40000 |   262 144 |  256 |

📝 Summary

Click to show summary
  • ✔️ - existing target
  • ✨ - new target
  • ⚰️ - deleted target
  • ✅ - files are the same
  • ❌ - files are different
Target Status .bin .map Total Flash (base/head) Total Flash Δ Static RAM (base/head) Static RAM Δ
LekaOS ✔️ 397932 (18%) ø 80776 (15%) ø
bootloader ✔️ 180956 (8%) ø 37456 (7%) ø
certs_emc_ble_bt_lcd_led_motors ✔️ 257608 (12%) ø 35872 (6%) ø
certs_emc_ble_led_motors ✔️ 190960 (9%) ø 31512 (6%) ø
certs_emc_bt_lcd_qspi_rfid_touch_wifi ✔️ 164608 (7%) ø 29344 (5%) ø
certs_emc_lcd_led_motors ✔️ 91304 (4%) ø 16264 (3%) ø
hardware_motors_test_reduction_and_wheels ✔️ 193408 (9%) ø 30920 (5%) ø
spike_lk_behavior_kit ✔️ 196052 (9%) ø 54528 (10%) ø
spike_lk_ble ✔️ 233676 (11%) ø 34712 (6%) ø
spike_lk_bluetooth ✔️ 90616 (4%) ø 18016 (3%) ø
spike_lk_cg_animations ✔️ 152200 (7%) ø 53064 (10%) ø
spike_lk_color_kit ✔️ 88352 (4%) ø 20216 (3%) ø
spike_lk_command_kit ✔️ 199956 (9%) ø 57856 (11%) ø
spike_lk_config_kit ✔️ 136100 (6%) ø 20976 (4%) ø
spike_lk_coreled ✔️ 87916 (4%) ø 20104 (3%) ø
spike_lk_event_queue ✔️ 84088 (4%) ø 18744 (3%) ø
spike_lk_file_manager_kit ✔️ 143648 (6%) ø 21304 (4%) ø
spike_lk_file_reception ✔️ 331036 (15%) ø 34072 (6%) ø
spike_lk_flash_memory ✔️ 86712 (4%) ø 18056 (3%) ø
spike_lk_fs ✔️ 171024 (8%) ø 47968 (9%) ø
spike_lk_lcd ✔️ 177100 (8%) ø 53992 (10%) ø
spike_lk_led ✔️ 88168 (4%) ø 19872 (3%) ø
spike_lk_led_kit ✔️ 115708 (5%) ø 21024 (4%) ø
spike_lk_log_kit ✔️ 84440 (4%) ø 19248 (3%) ø
spike_lk_motors ✔️ 86008 (4%) ø 18088 (3%) ø
spike_lk_reinforcer ✔️ 112188 (5%) ø 21024 (4%) ø
spike_lk_rfid ✔️ 84512 (4%) ø 18032 (3%) ø
spike_lk_sensors_battery ✔️ 87056 (4%) ø 19120 (3%) ø
spike_lk_sensors_light ✔️ 83944 (4%) ø 18056 (3%) ø
spike_lk_sensors_microphone ✔️ 84696 (4%) ø 18056 (3%) ø
spike_lk_sensors_temperature_humidity ✔️ 90336 (4%) ø 18032 (3%) ø
spike_lk_sensors_touch ✔️ 91608 (4%) ø 18296 (3%) ø
spike_lk_serial_number ✔️ 82176 (3%) ø 18320 (3%) ø
spike_lk_ticker_timeout ✔️ 82584 (3%) ø 18072 (3%) ø
spike_lk_update_process_app_base ✔️ 144644 (6%) ø 21896 (4%) ø
spike_lk_update_process_app_update ✔️ 100328 (4%) ø 19080 (3%) ø
spike_lk_watchdog_isr ✔️ 88152 (4%) ø 20120 (3%) ø
spike_lk_wifi ✔️ 130640 (6%) ø 21368 (4%) ø
spike_mbed_blinky ✔️ 57616 (2%) ø 11496 (2%) ø
spike_mbed_watchdog_ticker_vs_thread ✔️ 84112 (4%) ø 18920 (3%) ø
spike_stl_cxxsupport ✔️ 83424 (3%) ø 18144 (3%) ø

🗺️ Map files diff output

Click to show diff list

No differenes where found in map files.

@MMyster MMyster marked this pull request as draft June 6, 2022 21:23
@MMyster MMyster force-pushed the mmyster/feature/add-core-dac-expander branch from d68ff5f to ad635a2 Compare June 10, 2022 17:39
@MMyster MMyster force-pushed the mmyster/feature/add-core-dac-expander branch from ad635a2 to 7fa9668 Compare June 20, 2022 10:39
@MMyster MMyster marked this pull request as ready for review June 20, 2022 11:02
Copy link
Member

@YannLocatelli YannLocatelli left a comment

Choose a reason for hiding this comment

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

Rediscuter ensemble de la segmentation entre AnalogOut et calibration toucher + les conséquences que ça va avoir dans l'utilisation du composant (utilisation partielle)

En tout cas, beau travail pour avoir bien balayer les fonctionnalités du composant 👏

drivers/CMakeLists.txt Show resolved Hide resolved

namespace leka::interface {

class DACTouch
Copy link
Member

Choose a reason for hiding this comment

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

Il y a 2 choses qui se mélange ici et je pense qu'il serait important de les séparer:

  • La partie DAC ou nommé AnalogOut sous mbed
  • La calibration du capteur de toucher, ici grâce à une entrée analogique

A cela, tu as ajouté le fonctionnement du driver utilisé aujourd'hui:

  • voltage reference
  • powermode
  • gain
  • ...

Or un driver, que ce soit le DAC ou la calibration du capteur de toucher, ne devrait pas présenter des fonctions spécifique à un matériel mais se doivent être générique et c'est l'implémentation qui va adapter le matériel pour qu'il soit conforme au driver, et ici à l'interface.

Copy link
Member

Choose a reason for hiding this comment

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

je rejoins @YannLocatelli !

il faut bien séparer les concepts:

  • le io_expander::AnalogOut
  • le calibrateur qui utilise le AnalogOut

drivers/CoreDACTouch/source/CoreDACTouch.cpp Show resolved Hide resolved
@ladislas ladislas added the 01 - type: task Something to do label Jun 23, 2022
@ladislas ladislas added this to the Next Release milestone Jun 23, 2022
@ladislas ladislas linked an issue Jun 23, 2022 that may be closed by this pull request
5 tasks
Copy link
Member

@ladislas ladislas left a comment

Choose a reason for hiding this comment

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

Premier passage


namespace command {

inline constexpr uint8_t writeAllInputRegister = 0x00;
Copy link
Member

Choose a reason for hiding this comment

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

même chose que dans #792 pour ici et pour tous les autres:

Suggested change
inline constexpr uint8_t writeAllInputRegister = 0x00;
inline constexpr auto writeAllInputRegister = uint8_t {0x00};

void CoreDACTouchMCP4728::writeToAllInputRegister(std::array<uint8_t, 2> value)
{
auto command = std::array<uint8_t, 2> {};
command.at(0) = static_cast<uint8_t>((0xC0 & mcp4728::command::writeAllInputRegister) | (0x3F & value.at(0)));
Copy link
Member

Choose a reason for hiding this comment

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

les & et | je comprends pas ce que ça fait.

est-ce que tu peux avoir une petite fonction privée avec un nom explicite de l'opération.

{
auto command = std::array<uint8_t, 3> {};
command.at(0) =
static_cast<uint8_t>((0xF8 & mcp4728::command::writeSpecificInputRegister) | (0x07 & ((0x03 & channel) << 1)));
Copy link
Member

Choose a reason for hiding this comment

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

pareil ici, pourquoi 0xF8 & et pas autre chose?
pourquoi (0x07 & ((0x03 & channel) << 1))) et pas autre chose.

faut que le nom de l'opération soit explicite

Copy link
Member

Choose a reason for hiding this comment

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

et pareil pour les autres en dessous qui sont parfois les mêmes.


namespace leka::interface {

class DACTouch
Copy link
Member

Choose a reason for hiding this comment

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

je rejoins @YannLocatelli !

il faut bien séparer les concepts:

  • le io_expander::AnalogOut
  • le calibrateur qui utilise le AnalogOut

@MMyster MMyster force-pushed the mmyster/feature/add-core-dac-expander branch 2 times, most recently from 00778d5 to ccf94ac Compare June 28, 2022 08:33
@MMyster MMyster force-pushed the mmyster/feature/add-core-dac-expander branch from ccf94ac to 05b6441 Compare June 28, 2022 08:35
@sonarcloud
Copy link

sonarcloud bot commented Jun 28, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 16 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@MMyster MMyster removed the 01 - type: task Something to do label Jul 13, 2022
@MMyster MMyster removed this from the Next Release milestone Jul 13, 2022
@MMyster MMyster removed a link to an issue Jul 13, 2022
5 tasks
@MMyster MMyster removed their assignment Jul 13, 2022
@YannLocatelli
Copy link
Member

A supprimer/fermer : se référer à

@MMyster MMyster closed this Jul 13, 2022
@MMyster MMyster deleted the mmyster/feature/add-core-dac-expander branch July 13, 2022 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants