hal_norflash.dox 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. /**
  14. * @defgroup HAL_SERIAL_NOR Serial NOR Flash Driver
  15. * @brief Serial NOR Flash driver.
  16. * @details This module implements a generic driver for serial NOR Flash
  17. * devices.
  18. *
  19. * @section snorflash_1 Driver State Machine
  20. * The flash driver implements a state machine internally, not all the driver
  21. * functionalities can be used in any moment, any transition not explicitly
  22. * shown in the following diagram has to be considered an error and shall
  23. * be captured by an assertion (if enabled).
  24. * @dot
  25. digraph example {
  26. rankdir="LR";
  27. node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true", width="0.9", height="0.9"];
  28. edge [fontname=Helvetica, fontsize=8];
  29. stop [label="FLS_STOP\nLow Power"];
  30. uninit [label="FLS_UNINIT", style="bold"];
  31. ready [label="FLS_READY\nClock Enabled"];
  32. read [label="FLS_READ\nReading"];
  33. pgm [label="FLS_PGM\nProgramming"];
  34. erase [label="FLS_ERASE\nErasing"];
  35. uninit -> stop [label=" snorInit()", constraint=false];
  36. stop -> stop [label=" snorStop()"];
  37. stop -> ready [label=" snorStart()"];
  38. ready -> stop [label=" snorStop()"];
  39. ready -> read [label=" flashRead()\nflashVerifyErase()"];
  40. read -> ready [label=" return"];
  41. ready -> pgm [label=" flashProgram()"];
  42. pgm -> ready [label=" return"];
  43. ready -> erase [label=" \n\nflashEraseAll()\nflashEraseSector()"];
  44. erase -> ready [label=" flashQueryErase()\nFLASH_NO_ERROR\nFLASH_ERROR_*"];
  45. erase -> erase [label=" flashQueryErase()\nflashProgram()\nflashRead()\nFLASH_BUSY_ERASING"];
  46. }
  47. * @enddot
  48. *
  49. * @ingroup HAL_COMPLEX_DRIVERS
  50. */