spi_flash.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. /*
  2. * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #include <stdint.h>
  8. #include <stdbool.h>
  9. #include "esp_attr.h"
  10. #include "esp_rom_spiflash.h"
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. #define PERIPHS_SPI_FLASH_CMD SPI_MEM_CMD_REG(1)
  15. #define PERIPHS_SPI_FLASH_ADDR SPI_MEM_ADDR_REG(1)
  16. #define PERIPHS_SPI_FLASH_CTRL SPI_MEM_CTRL_REG(1)
  17. #define PERIPHS_SPI_FLASH_CTRL1 SPI_MEM_CTRL1_REG(1)
  18. #define PERIPHS_SPI_FLASH_STATUS SPI_MEM_RD_STATUS_REG(1)
  19. #define PERIPHS_SPI_FLASH_USRREG SPI_MEM_USER_REG(1)
  20. #define PERIPHS_SPI_FLASH_USRREG1 SPI_MEM_USER1_REG(1)
  21. #define PERIPHS_SPI_FLASH_USRREG2 SPI_MEM_USER2_REG(1)
  22. #define PERIPHS_SPI_FLASH_C0 SPI_MEM_W0_REG(1)
  23. #define PERIPHS_SPI_FLASH_C1 SPI_MEM_W1_REG(1)
  24. #define PERIPHS_SPI_FLASH_C2 SPI_MEM_W2_REG(1)
  25. #define PERIPHS_SPI_FLASH_C3 SPI_MEM_W3_REG(1)
  26. #define PERIPHS_SPI_FLASH_C4 SPI_MEM_W4_REG(1)
  27. #define PERIPHS_SPI_FLASH_C5 SPI_MEM_W5_REG(1)
  28. #define PERIPHS_SPI_FLASH_C6 SPI_MEM_W6_REG(1)
  29. #define PERIPHS_SPI_FLASH_C7 SPI_MEM_W7_REG(1)
  30. #define PERIPHS_SPI_FLASH_TX_CRC SPI_MEM_TX_CRC_REG(1)
  31. #define SPI0_R_QIO_DUMMY_CYCLELEN 5
  32. #define SPI0_R_QIO_ADDR_BITSLEN 23
  33. #define SPI0_R_FAST_DUMMY_CYCLELEN 7
  34. #define SPI0_R_DIO_DUMMY_CYCLELEN 3
  35. #define SPI0_R_FAST_ADDR_BITSLEN 23
  36. #define SPI0_R_SIO_ADDR_BITSLEN 23
  37. #define SPI1_R_QIO_DUMMY_CYCLELEN 5
  38. #define SPI1_R_QIO_ADDR_BITSLEN 23
  39. #define SPI1_R_FAST_DUMMY_CYCLELEN 7
  40. #define SPI1_R_DIO_DUMMY_CYCLELEN 3
  41. #define SPI1_R_DIO_ADDR_BITSLEN 23
  42. #define SPI1_R_FAST_ADDR_BITSLEN 23
  43. #define SPI1_R_SIO_ADDR_BITSLEN 23
  44. #define ESP_ROM_SPIFLASH_W_SIO_ADDR_BITSLEN 23
  45. #define ESP_ROM_SPIFLASH_TWO_BYTE_STATUS_EN SPI_MEM_WRSR_2B
  46. //SPI address register
  47. #define ESP_ROM_SPIFLASH_BYTES_LEN 24
  48. #define ESP_ROM_SPIFLASH_BUFF_BYTE_WRITE_NUM 32
  49. #define ESP_ROM_SPIFLASH_BUFF_BYTE_READ_NUM 16
  50. #define ESP_ROM_SPIFLASH_BUFF_BYTE_READ_BITS 0xf
  51. typedef void (* spi_flash_func_t)(void);
  52. typedef esp_rom_spiflash_result_t (* spi_flash_op_t)(void);
  53. typedef esp_rom_spiflash_result_t (* spi_flash_erase_t)(uint32_t);
  54. typedef esp_rom_spiflash_result_t (* spi_flash_rd_t)(uint32_t, uint32_t*, int);
  55. typedef esp_rom_spiflash_result_t (* spi_flash_wr_t)(uint32_t, const uint32_t*, int);
  56. typedef esp_rom_spiflash_result_t (* spi_flash_ewr_t)(uint32_t, const void*, uint32_t);
  57. typedef esp_rom_spiflash_result_t (* spi_flash_wren_t)(void*);
  58. typedef esp_rom_spiflash_result_t (* spi_flash_erase_area_t)(uint32_t, uint32_t);
  59. typedef struct {
  60. uint8_t pp_addr_bit_len;
  61. uint8_t se_addr_bit_len;
  62. uint8_t be_addr_bit_len;
  63. uint8_t rd_addr_bit_len;
  64. uint32_t read_sub_len;
  65. uint32_t write_sub_len;
  66. spi_flash_op_t unlock;
  67. spi_flash_erase_t erase_sector;
  68. spi_flash_erase_t erase_block;
  69. spi_flash_rd_t read;
  70. spi_flash_wr_t write;
  71. spi_flash_ewr_t encrypt_write;
  72. spi_flash_func_t check_sus;
  73. spi_flash_wren_t wren;
  74. spi_flash_op_t wait_idle;
  75. spi_flash_erase_area_t erase_area;
  76. } spiflash_legacy_funcs_t;
  77. typedef struct {
  78. uint8_t data_length;
  79. uint8_t read_cmd0;
  80. uint8_t read_cmd1;
  81. uint8_t write_cmd;
  82. uint16_t data_mask;
  83. uint16_t data;
  84. } esp_rom_spiflash_common_cmd_t;
  85. /**
  86. * @brief SPI Flash init, clock divisor is 4, use 1 line Slow read mode.
  87. * Please do not call this function in SDK.
  88. *
  89. * @param uint32_t ishspi: 0 for spi, 1 for hspi, flash pad decided by strapping
  90. * else, bit[5:0] spiclk, bit[11:6] spiq, bit[17:12] spid, bit[23:18] spics0, bit[29:24] spihd
  91. *
  92. * @param uint8_t legacy: always keeping false.
  93. *
  94. * @return None
  95. */
  96. void esp_rom_spiflash_attach(uint32_t ishspi, bool legacy);
  97. /**
  98. * @brief SPI Read Flash status register. We use CMD 0x05 (RDSR).
  99. * Please do not call this function in SDK.
  100. *
  101. * @param esp_rom_spiflash_chip_t *spi : The information for Flash, which is exported from ld file.
  102. *
  103. * @param uint32_t *status : The pointer to which to return the Flash status value.
  104. *
  105. * @return ESP_ROM_SPIFLASH_RESULT_OK : read OK.
  106. * ESP_ROM_SPIFLASH_RESULT_ERR : read error.
  107. * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : read timeout.
  108. */
  109. esp_rom_spiflash_result_t esp_rom_spiflash_read_status(esp_rom_spiflash_chip_t *spi, uint32_t *status);
  110. /**
  111. * @brief SPI Read Flash status register bits 8-15. We use CMD 0x35 (RDSR2).
  112. * Please do not call this function in SDK.
  113. *
  114. * @param esp_rom_spiflash_chip_t *spi : The information for Flash, which is exported from ld file.
  115. *
  116. * @param uint32_t *status : The pointer to which to return the Flash status value.
  117. *
  118. * @return ESP_ROM_SPIFLASH_RESULT_OK : read OK.
  119. * ESP_ROM_SPIFLASH_RESULT_ERR : read error.
  120. * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : read timeout.
  121. */
  122. esp_rom_spiflash_result_t esp_rom_spiflash_read_statushigh(esp_rom_spiflash_chip_t *spi, uint32_t *status);
  123. /**
  124. * @brief Write status to Flash status register.
  125. * Please do not call this function in SDK.
  126. *
  127. * @param esp_rom_spiflash_chip_t *spi : The information for Flash, which is exported from ld file.
  128. *
  129. * @param uint32_t status_value : Value to .
  130. *
  131. * @return ESP_ROM_SPIFLASH_RESULT_OK : write OK.
  132. * ESP_ROM_SPIFLASH_RESULT_ERR : write error.
  133. * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : write timeout.
  134. */
  135. esp_rom_spiflash_result_t esp_rom_spiflash_write_status(esp_rom_spiflash_chip_t *spi, uint32_t status_value);
  136. /**
  137. * @brief Use a command to Read Flash status register.
  138. * Please do not call this function in SDK.
  139. *
  140. * @param esp_rom_spiflash_chip_t *spi : The information for Flash, which is exported from ld file.
  141. *
  142. * @param uint32_t*status : The pointer to which to return the Flash status value.
  143. *
  144. * @return ESP_ROM_SPIFLASH_RESULT_OK : read OK.
  145. * ESP_ROM_SPIFLASH_RESULT_ERR : read error.
  146. * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : read timeout.
  147. */
  148. esp_rom_spiflash_result_t esp_rom_spiflash_read_user_cmd(uint32_t *status, uint8_t cmd);
  149. /**
  150. * @brief Config SPI Flash read mode when init.
  151. * Please do not call this function in SDK.
  152. *
  153. * @param esp_rom_spiflash_read_mode_t mode : QIO/QOUT/DIO/DOUT/FastRD/SlowRD.
  154. *
  155. * This function does not try to set the QIO Enable bit in the status register, caller is responsible for this.
  156. *
  157. * @return ESP_ROM_SPIFLASH_RESULT_OK : config OK.
  158. * ESP_ROM_SPIFLASH_RESULT_ERR : config error.
  159. * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : config timeout.
  160. */
  161. esp_rom_spiflash_result_t esp_rom_spiflash_config_readmode(esp_rom_spiflash_read_mode_t mode);
  162. /**
  163. * @brief Config SPI Flash clock divisor.
  164. * Please do not call this function in SDK.
  165. *
  166. * @param uint8_t freqdiv: clock divisor.
  167. *
  168. * @param uint8_t spi: 0 for SPI0, 1 for SPI1.
  169. *
  170. * @return ESP_ROM_SPIFLASH_RESULT_OK : config OK.
  171. * ESP_ROM_SPIFLASH_RESULT_ERR : config error.
  172. * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : config timeout.
  173. */
  174. esp_rom_spiflash_result_t esp_rom_spiflash_config_clk(uint8_t freqdiv, uint8_t spi);
  175. /**
  176. * @brief Clear all SR bits except QE bit.
  177. * Please do not call this function in SDK.
  178. *
  179. * @param None.
  180. *
  181. * @return ESP_ROM_SPIFLASH_RESULT_OK : Unlock OK.
  182. * ESP_ROM_SPIFLASH_RESULT_ERR : Unlock error.
  183. * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Unlock timeout.
  184. */
  185. esp_rom_spiflash_result_t esp_rom_spiflash_clear_bp(void);
  186. /**
  187. * @brief Clear all SR bits except QE bit.
  188. * Please do not call this function in SDK.
  189. *
  190. * @param None.
  191. *
  192. * @return ESP_ROM_SPIFLASH_RESULT_OK : Unlock OK.
  193. * ESP_ROM_SPIFLASH_RESULT_ERR : Unlock error.
  194. * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Unlock timeout.
  195. */
  196. esp_rom_spiflash_result_t esp_rom_spiflash_unlock(void);
  197. /**
  198. * @brief Update SPI Flash parameter.
  199. * Please do not call this function in SDK.
  200. *
  201. * @param uint32_t deviceId : Device ID read from SPI, the low 32 bit.
  202. *
  203. * @param uint32_t chip_size : The Flash size.
  204. *
  205. * @param uint32_t block_size : The Flash block size.
  206. *
  207. * @param uint32_t sector_size : The Flash sector size.
  208. *
  209. * @param uint32_t page_size : The Flash page size.
  210. *
  211. * @param uint32_t status_mask : The Mask used when read status from Flash(use single CMD).
  212. *
  213. * @return ESP_ROM_SPIFLASH_RESULT_OK : Update OK.
  214. * ESP_ROM_SPIFLASH_RESULT_ERR : Update error.
  215. * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Update timeout.
  216. */
  217. esp_rom_spiflash_result_t esp_rom_spiflash_config_param(uint32_t deviceId, uint32_t chip_size, uint32_t block_size,
  218. uint32_t sector_size, uint32_t page_size, uint32_t status_mask);
  219. /**
  220. * @brief Erase whole flash chip.
  221. * Please do not call this function in SDK.
  222. *
  223. * @param None
  224. *
  225. * @return ESP_ROM_SPIFLASH_RESULT_OK : Erase OK.
  226. * ESP_ROM_SPIFLASH_RESULT_ERR : Erase error.
  227. * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Erase timeout.
  228. */
  229. esp_rom_spiflash_result_t esp_rom_spiflash_erase_chip(void);
  230. /**
  231. * @brief Erase a 64KB block of flash
  232. * Uses SPI flash command D8H.
  233. * Please do not call this function in SDK.
  234. *
  235. * @param uint32_t block_num : Which block to erase.
  236. *
  237. * @return ESP_ROM_SPIFLASH_RESULT_OK : Erase OK.
  238. * ESP_ROM_SPIFLASH_RESULT_ERR : Erase error.
  239. * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Erase timeout.
  240. */
  241. esp_rom_spiflash_result_t esp_rom_spiflash_erase_block(uint32_t block_num);
  242. /**
  243. * @brief Erase a sector of flash.
  244. * Uses SPI flash command 20H.
  245. * Please do not call this function in SDK.
  246. *
  247. * @param uint32_t sector_num : Which sector to erase.
  248. *
  249. * @return ESP_ROM_SPIFLASH_RESULT_OK : Erase OK.
  250. * ESP_ROM_SPIFLASH_RESULT_ERR : Erase error.
  251. * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Erase timeout.
  252. */
  253. esp_rom_spiflash_result_t esp_rom_spiflash_erase_sector(uint32_t sector_num);
  254. /**
  255. * @brief Erase some sectors.
  256. * Please do not call this function in SDK.
  257. *
  258. * @param uint32_t start_addr : Start addr to erase, should be sector aligned.
  259. *
  260. * @param uint32_t area_len : Length to erase, should be sector aligned.
  261. *
  262. * @return ESP_ROM_SPIFLASH_RESULT_OK : Erase OK.
  263. * ESP_ROM_SPIFLASH_RESULT_ERR : Erase error.
  264. * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Erase timeout.
  265. */
  266. esp_rom_spiflash_result_t esp_rom_spiflash_erase_area(uint32_t start_addr, uint32_t area_len);
  267. /**
  268. * @brief Write Data to Flash, you should Erase it yourself if need.
  269. * Please do not call this function in SDK.
  270. *
  271. * @param uint32_t dest_addr : Address to write, should be 4 bytes aligned.
  272. *
  273. * @param const uint32_t *src : The pointer to data which is to write.
  274. *
  275. * @param uint32_t len : Length to write, should be 4 bytes aligned.
  276. *
  277. * @return ESP_ROM_SPIFLASH_RESULT_OK : Write OK.
  278. * ESP_ROM_SPIFLASH_RESULT_ERR : Write error.
  279. * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Write timeout.
  280. */
  281. esp_rom_spiflash_result_t esp_rom_spiflash_write(uint32_t dest_addr, const uint32_t *src, int32_t len);
  282. /**
  283. * @brief Read Data from Flash, you should Erase it yourself if need.
  284. * Please do not call this function in SDK.
  285. *
  286. * @param uint32_t src_addr : Address to read, should be 4 bytes aligned.
  287. *
  288. * @param uint32_t *dest : The buf to read the data.
  289. *
  290. * @param uint32_t len : Length to read, should be 4 bytes aligned.
  291. *
  292. * @return ESP_ROM_SPIFLASH_RESULT_OK : Read OK.
  293. * ESP_ROM_SPIFLASH_RESULT_ERR : Read error.
  294. * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Read timeout.
  295. */
  296. esp_rom_spiflash_result_t esp_rom_spiflash_read(uint32_t src_addr, uint32_t *dest, int32_t len);
  297. /**
  298. * @brief SPI1 go into encrypto mode.
  299. * Please do not call this function in SDK.
  300. *
  301. * @param None
  302. *
  303. * @return None
  304. */
  305. void esp_rom_spiflash_write_encrypted_enable(void);
  306. /**
  307. * @brief SPI1 go out of encrypto mode.
  308. * Please do not call this function in SDK.
  309. *
  310. * @param None
  311. *
  312. * @return None
  313. */
  314. void esp_rom_spiflash_write_encrypted_disable(void);
  315. /**
  316. * @brief Write data to flash with transparent encryption.
  317. * @note Sectors to be written should already be erased.
  318. *
  319. * @note Please do not call this function in SDK.
  320. *
  321. * @param uint32_t flash_addr : Address to write, should be 32 byte aligned.
  322. *
  323. * @param uint32_t *data : The pointer to data to write. Note, this pointer must
  324. * be 32 bit aligned and the content of the data will be
  325. * modified by the encryption function.
  326. *
  327. * @param uint32_t len : Length to write, should be 32 bytes aligned.
  328. *
  329. * @return ESP_ROM_SPIFLASH_RESULT_OK : Data written successfully.
  330. * ESP_ROM_SPIFLASH_RESULT_ERR : Encryption write error.
  331. * ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Encrypto write timeout.
  332. */
  333. esp_rom_spiflash_result_t esp_rom_spiflash_write_encrypted(uint32_t flash_addr, uint32_t *data, uint32_t len);
  334. /** @brief Wait until SPI flash write operation is complete
  335. *
  336. * @note Please do not call this function in SDK.
  337. *
  338. * Reads the Write In Progress bit of the SPI flash status register,
  339. * repeats until this bit is zero (indicating write complete).
  340. *
  341. * @return ESP_ROM_SPIFLASH_RESULT_OK : Write is complete
  342. * ESP_ROM_SPIFLASH_RESULT_ERR : Error while reading status.
  343. */
  344. esp_rom_spiflash_result_t esp_rom_spiflash_wait_idle(esp_rom_spiflash_chip_t *spi);
  345. /** @brief Enable Quad I/O pin functions
  346. *
  347. * @note Please do not call this function in SDK.
  348. *
  349. * Sets the HD & WP pin functions for Quad I/O modes, based on the
  350. * efuse SPI pin configuration.
  351. *
  352. * @param wp_gpio_num - Number of the WP pin to reconfigure for quad I/O.
  353. *
  354. * @param spiconfig - Pin configuration, as returned from ets_efuse_get_spiconfig().
  355. * - If this parameter is 0, default SPI pins are used and wp_gpio_num parameter is ignored.
  356. * - If this parameter is 1, default HSPI pins are used and wp_gpio_num parameter is ignored.
  357. * - For other values, this parameter encodes the HD pin number and also the CLK pin number. CLK pin selection is used
  358. * to determine if HSPI or SPI peripheral will be used (use HSPI if CLK pin is the HSPI clock pin, otherwise use SPI).
  359. * Both HD & WP pins are configured via GPIO matrix to map to the selected peripheral.
  360. */
  361. void esp_rom_spiflash_select_qio_pins(uint8_t wp_gpio_num, uint32_t spiconfig);
  362. /**
  363. * @brief Clear WEL bit unconditionally.
  364. *
  365. * @return always ESP_ROM_SPIFLASH_RESULT_OK
  366. */
  367. esp_rom_spiflash_result_t esp_rom_spiflash_write_disable(void);
  368. /**
  369. * @brief Set WREN bit.
  370. *
  371. * @param esp_rom_spiflash_chip_t *spi : The information for Flash, which is exported from ld file.
  372. *
  373. * @return always ESP_ROM_SPIFLASH_RESULT_OK
  374. */
  375. esp_rom_spiflash_result_t esp_rom_spiflash_write_enable(esp_rom_spiflash_chip_t *spi);
  376. /**
  377. * @brief Fix the bug in SPI hardware communication with Flash/Ext-SRAM in High Speed.
  378. * Please do not call this function in SDK.
  379. *
  380. * @param uint8_t spi: 0 for SPI0(Cache Access), 1 for SPI1(Flash read/write).
  381. *
  382. * @param uint8_t freqdiv: Pll is 80M, 4 for 20M, 3 for 26.7M, 2 for 40M, 1 for 80M.
  383. *
  384. * @return None
  385. */
  386. void esp_rom_spiflash_fix_dummylen(uint8_t spi, uint8_t freqdiv);
  387. /**
  388. * @brief Set SPI Flash pad drivers.
  389. * Please do not call this function in SDK.
  390. *
  391. * @param uint8_t wp_gpio_num: WP gpio number.
  392. *
  393. * @param uint32_t ishspi: 0 for spi, 1 for hspi, flash pad decided by strapping
  394. * else, bit[5:0] spiclk, bit[11:6] spiq, bit[17:12] spid, bit[23:18] spics0, bit[29:24] spihd
  395. *
  396. * @param uint8_t *drvs: drvs[0]-bit[3:0] for cpiclk, bit[7:4] for spiq, drvs[1]-bit[3:0] for spid, drvs[1]-bit[7:4] for spid
  397. * drvs[2]-bit[3:0] for spihd, drvs[2]-bit[7:4] for spiwp.
  398. * Values usually read from falsh by rom code, function usually callde by rom code.
  399. * if value with bit(3) set, the value is valid, bit[2:0] is the real value.
  400. *
  401. * @return None
  402. */
  403. void esp_rom_spiflash_set_drvs(uint8_t wp_gpio_num, uint32_t ishspi, uint8_t *drvs);
  404. /**
  405. * @brief Select SPI Flash function for pads.
  406. * Please do not call this function in SDK.
  407. *
  408. * @param uint32_t ishspi: 0 for spi, 1 for hspi, flash pad decided by strapping
  409. * else, bit[5:0] spiclk, bit[11:6] spiq, bit[17:12] spid, bit[23:18] spics0, bit[29:24] spihd
  410. *
  411. * @return None
  412. */
  413. void esp_rom_spiflash_select_padsfunc(uint32_t ishspi);
  414. /**
  415. * @brief Send CommonCmd to Flash so that is can go into QIO mode, some Flash use different CMD.
  416. * Please do not call this function in SDK.
  417. *
  418. * @param esp_rom_spiflash_common_cmd_t *cmd : A struct to show the action of a command.
  419. *
  420. * @return uint16_t 0 : do not send command any more.
  421. * 1 : go to the next command.
  422. * n > 1 : skip (n - 1) commands.
  423. */
  424. uint16_t esp_rom_spiflash_common_cmd(esp_rom_spiflash_common_cmd_t *cmd);
  425. extern const spiflash_legacy_funcs_t *rom_spiflash_legacy_funcs;
  426. #ifdef __cplusplus
  427. }
  428. #endif