sys_pcr.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. /** @file sys_pcr.c
  2. * @brief PCR Driver Implementation File
  3. * @date 29.May.2013
  4. * @version 03.05.02
  5. *
  6. */
  7. /* (c) Texas Instruments 2009-2013, All rights reserved. */
  8. #include "sys_pcr.h"
  9. /* USER CODE BEGIN (0) */
  10. /* USER CODE END */
  11. /* USER CODE BEGIN (1) */
  12. /* USER CODE END */
  13. /** @fn void peripheral_Frame_Protection_Set(peripheral_Frame_Select_t peripheral_Frame)
  14. * @brief Set the peripheral protection of the selected frame
  15. * @param[in] peripheral_Frame - Peripheral frame to be protected
  16. *
  17. * This function sets the protection for the selected frame.
  18. */
  19. void peripheral_Frame_Protection_Set(peripheral_Frame_Select_t peripheral_Frame)
  20. {
  21. /* USER CODE BEGIN (2) */
  22. /* USER CODE END */
  23. uint32 chip_select_grp;
  24. uint32 Quarant_selct;
  25. chip_select_grp = (peripheral_Frame.Peripheral_CS >> 3U);
  26. Quarant_selct = (uint32)(peripheral_Frame.Peripheral_Quadrant << ((peripheral_Frame.Peripheral_CS & 7U) << 2U));
  27. if (chip_select_grp >= 3U)
  28. {
  29. pcrREG->PPROTSET3 = Quarant_selct;
  30. }
  31. else if (chip_select_grp >= 2U)
  32. {
  33. pcrREG->PPROTSET2 = Quarant_selct;
  34. }
  35. else if (chip_select_grp >= 1U)
  36. {
  37. pcrREG->PPROTSET1 = Quarant_selct;
  38. }
  39. else
  40. {
  41. pcrREG->PPROTSET0 = Quarant_selct;
  42. }
  43. /* USER CODE BEGIN (3) */
  44. /* USER CODE END */
  45. }
  46. /* USER CODE BEGIN (4) */
  47. /* USER CODE END */
  48. /** @fn void peripheral_Frame_Protection_Clr(peripheral_Frame_Select_t peripheral_Frame)
  49. * @brief Clear the peripheral protection of the selected frame
  50. * @param[in] peripheral_Frame - Peripheral frame to be out of protection
  51. *
  52. * This function clears the protection set for the selected frame.
  53. */
  54. void peripheral_Frame_Protection_Clr(peripheral_Frame_Select_t peripheral_Frame)
  55. {
  56. /* USER CODE BEGIN (5) */
  57. /* USER CODE END */
  58. uint32 chip_select_grp;
  59. uint32 Quarant_selct;
  60. chip_select_grp = (peripheral_Frame.Peripheral_CS >> 3U);
  61. Quarant_selct = (uint32)(peripheral_Frame.Peripheral_Quadrant << ((peripheral_Frame.Peripheral_CS & 7U) << 2U));
  62. if (chip_select_grp >= 3U)
  63. {
  64. pcrREG->PPROTCLR3 = Quarant_selct;
  65. }
  66. else if (chip_select_grp >= 2U)
  67. {
  68. pcrREG->PPROTCLR2 = Quarant_selct;
  69. }
  70. else if (chip_select_grp >= 1U)
  71. {
  72. pcrREG->PPROTCLR1 = Quarant_selct;
  73. }
  74. else
  75. {
  76. pcrREG->PPROTCLR0 = Quarant_selct;
  77. }
  78. /* USER CODE BEGIN (6) */
  79. /* USER CODE END */
  80. }
  81. /* USER CODE BEGIN (7) */
  82. /* USER CODE END */
  83. /** @fn void peripheral_Frame_Powerdown_Set(peripheral_Frame_Select_t peripheral_Frame)
  84. * @brief Take the selected peripheral to powerdown
  85. * @param[in] peripheral_Frame - Peripheral frame to be taken to powerdown
  86. *
  87. * This function will set the selected peripheral frame to powerdown.
  88. */
  89. void peripheral_Frame_Powerdown_Set(peripheral_Frame_Select_t peripheral_Frame)
  90. {
  91. /* USER CODE BEGIN (8) */
  92. /* USER CODE END */
  93. uint32 chip_select_grp;
  94. uint32 Quarant_selct;
  95. chip_select_grp = (peripheral_Frame.Peripheral_CS >> 3U);
  96. Quarant_selct = (uint32)(peripheral_Frame.Peripheral_Quadrant << ((peripheral_Frame.Peripheral_CS & 7U) << 2U));
  97. if (chip_select_grp >= 3U)
  98. {
  99. pcrREG->PSPWRDWNSET3 = Quarant_selct;
  100. }
  101. else if (chip_select_grp >= 2U)
  102. {
  103. pcrREG->PSPWRDWNSET2 = Quarant_selct;
  104. }
  105. else if (chip_select_grp >= 1U)
  106. {
  107. pcrREG->PSPWRDWNSET1 = Quarant_selct;
  108. }
  109. else
  110. {
  111. pcrREG->PSPWRDWNSET0 = Quarant_selct;
  112. }
  113. /* USER CODE BEGIN (9) */
  114. /* USER CODE END */
  115. }
  116. /* USER CODE BEGIN (10) */
  117. /* USER CODE END */
  118. /** @fn void peripheral_Frame_Powerdown_Clr(peripheral_Frame_Select_t peripheral_Frame)
  119. * @brief Bring the selected peripheral frame out of powerdown
  120. * @param[in] peripheral_Frame - Peripheral frame to be taken out of powerdown
  121. *
  122. * This function will bring the selected peripheral frame out of powerdown.
  123. */
  124. void peripheral_Frame_Powerdown_Clr(peripheral_Frame_Select_t peripheral_Frame)
  125. {
  126. /* USER CODE BEGIN (11) */
  127. /* USER CODE END */
  128. uint32 chip_select_grp;
  129. uint32 Quarant_selct;
  130. chip_select_grp = (peripheral_Frame.Peripheral_CS >> 3U);
  131. Quarant_selct = (uint32)(peripheral_Frame.Peripheral_Quadrant << ((peripheral_Frame.Peripheral_CS & 7U) << 2U));
  132. if (chip_select_grp >= 3U)
  133. {
  134. pcrREG->PSPWRDWNCLR3 = Quarant_selct;
  135. }
  136. else if (chip_select_grp >= 2U)
  137. {
  138. pcrREG->PSPWRDWNCLR2 = Quarant_selct;
  139. }
  140. else if (chip_select_grp >= 1U)
  141. {
  142. pcrREG->PSPWRDWNCLR1 = Quarant_selct;
  143. }
  144. else
  145. {
  146. pcrREG->PSPWRDWNCLR0 = Quarant_selct;
  147. }
  148. /* USER CODE BEGIN (12) */
  149. /* USER CODE END */
  150. }
  151. /* USER CODE BEGIN (13) */
  152. /* USER CODE END */
  153. /** @fn void peripheral_Mem_Frame_Prot_Set(peripheral_MemoryFrame_CS_t peripheral_Memory_Frame_CS)
  154. * @brief Set the peripheral memory protection of the selected frame
  155. * @param[in] peripheral_Memory_Frame_CS - Peripheral memory frame to be protected
  156. *
  157. * This function sets the protection for the selected peripheral memory frame.
  158. */
  159. void peripheral_Mem_Frame_Prot_Set(peripheral_MemoryFrame_CS_t peripheral_Memory_Frame_CS)
  160. {
  161. /* USER CODE BEGIN (14) */
  162. /* USER CODE END */
  163. uint32 chip_select_grp;
  164. chip_select_grp = (peripheral_Memory_Frame_CS >> 5U);
  165. if (chip_select_grp >= 1U)
  166. {
  167. pcrREG->PMPROTSET1 = (1U << (peripheral_Memory_Frame_CS & 0xFU));
  168. }
  169. else
  170. {
  171. pcrREG->PMPROTSET0 = (1U << peripheral_Memory_Frame_CS);
  172. }
  173. /* USER CODE BEGIN (15) */
  174. /* USER CODE END */
  175. }
  176. /* USER CODE BEGIN (16) */
  177. /* USER CODE END */
  178. /** @fn void peripheral_Mem_Frame_Prot_Clr(peripheral_MemoryFrame_CS_t peripheral_Memory_Frame_CS)
  179. * @brief Clear the peripheral memory protection of the selected frame
  180. * @param[in] peripheral_Memory_Frame_CS - Peripheral memory frame to be cleared from protection
  181. *
  182. * This function clears the protection set for the selected peripheral memory frame.
  183. */
  184. void peripheral_Mem_Frame_Prot_Clr(peripheral_MemoryFrame_CS_t peripheral_Memory_Frame_CS)
  185. {
  186. /* USER CODE BEGIN (17) */
  187. /* USER CODE END */
  188. uint32 chip_select_grp;
  189. chip_select_grp = (peripheral_Memory_Frame_CS >> 5U);
  190. if (chip_select_grp >= 1U)
  191. {
  192. pcrREG->PMPROTCLR1 = (1U << (peripheral_Memory_Frame_CS & 0xFU));
  193. }
  194. else
  195. {
  196. pcrREG->PMPROTCLR0 = (1U << peripheral_Memory_Frame_CS);
  197. }
  198. /* USER CODE BEGIN (18) */
  199. /* USER CODE END */
  200. }
  201. /* USER CODE BEGIN (19) */
  202. /* USER CODE END */
  203. /** @fn void peripheral_Mem_Frame_Pwrdwn_Set(peripheral_MemoryFrame_CS_t peripheral_Memory_Frame_CS)
  204. * @brief Take the selected peripheral memory frame to powerdown
  205. * @param[in] peripheral_Memory_Frame_CS - Peripheral memory frame to be taken to powerdown
  206. *
  207. * This function will set the selected peripheral memory frame to powerdown.
  208. */
  209. void peripheral_Mem_Frame_Pwrdwn_Set(peripheral_MemoryFrame_CS_t peripheral_Memory_Frame_CS)
  210. {
  211. /* USER CODE BEGIN (20) */
  212. /* USER CODE END */
  213. uint32 chip_select_grp;
  214. chip_select_grp = (peripheral_Memory_Frame_CS >> 5U);
  215. if (chip_select_grp >= 1U)
  216. {
  217. pcrREG->PSPWRDWNSET1 = (1U << (peripheral_Memory_Frame_CS & 0xFU));
  218. }
  219. else
  220. {
  221. pcrREG->PSPWRDWNSET0 = (1U << peripheral_Memory_Frame_CS);
  222. }
  223. /* USER CODE BEGIN (21) */
  224. /* USER CODE END */
  225. }
  226. /* USER CODE BEGIN (22) */
  227. /* USER CODE END */
  228. /** @fn void peripheral_Mem_Frame_Pwrdwn_Clr (peripheral_MemoryFrame_CS_t peripheral_Memory_Frame_CS)
  229. * @brief Bring the selected peripheral Memory frame out of powerdown
  230. * @param[in] peripheral_Memory_Frame_CS - Peripheral memory frame to be taken out of powerdown
  231. *
  232. * This function will bring the selected peripheral memory frame out of powerdown.
  233. */
  234. void peripheral_Mem_Frame_Pwrdwn_Clr (peripheral_MemoryFrame_CS_t peripheral_Memory_Frame_CS)
  235. {
  236. /* USER CODE BEGIN (23) */
  237. /* USER CODE END */
  238. uint32 chip_select_grp;
  239. chip_select_grp = (peripheral_Memory_Frame_CS >> 5U);
  240. if (chip_select_grp >= 1U)
  241. {
  242. pcrREG->PSPWRDWNCLR1 = (1U << (peripheral_Memory_Frame_CS & 0xFU));
  243. }
  244. else
  245. {
  246. pcrREG->PSPWRDWNCLR0 = (1U << peripheral_Memory_Frame_CS);
  247. }
  248. /* USER CODE BEGIN (24) */
  249. /* USER CODE END */
  250. }
  251. /* USER CODE BEGIN (25) */
  252. /* USER CODE END */
  253. /** @fn void peripheral_Protection_Set(peripheral_Quad_ChipSelect_t peripheral_Quad_CS)
  254. * @brief Set the peripheral protection of all the selected frames
  255. * @param[in] peripheral_Quad_CS - All Peripheral frames to be protected
  256. *
  257. * This function sets the protection for all the selected frames.
  258. */
  259. void peripheral_Protection_Set(peripheral_Quad_ChipSelect_t peripheral_Quad_CS)
  260. {
  261. /* USER CODE BEGIN (26) */
  262. /* USER CODE END */
  263. pcrREG->PPROTSET0 = peripheral_Quad_CS.Peripheral_Quad0_3_CS0_7;
  264. pcrREG->PPROTSET1 = peripheral_Quad_CS.Peripheral_Quad4_7_CS8_15;
  265. pcrREG->PPROTSET2 = peripheral_Quad_CS.Peripheral_Quad8_11_CS16_23;
  266. pcrREG->PPROTSET3 = peripheral_Quad_CS.Peripheral_Quad12_15_CS24_31;
  267. /* USER CODE BEGIN (27) */
  268. /* USER CODE END */
  269. }
  270. /* USER CODE BEGIN (28) */
  271. /* USER CODE END */
  272. /** @fn void peripheral_Protection_Clr(peripheral_Quad_ChipSelect_t peripheral_Quad_CS)
  273. * @brief Clear the peripheral protection of all the selected frames
  274. * @param[in] peripheral_Quad_CS - All Peripheral frames to be out of protection.
  275. *
  276. * This function clears the protection set for all the selected frame.
  277. */
  278. void peripheral_Protection_Clr(peripheral_Quad_ChipSelect_t peripheral_Quad_CS)
  279. {
  280. /* USER CODE BEGIN (29) */
  281. /* USER CODE END */
  282. pcrREG->PPROTCLR0 = peripheral_Quad_CS.Peripheral_Quad0_3_CS0_7;
  283. pcrREG->PPROTCLR1 = peripheral_Quad_CS.Peripheral_Quad4_7_CS8_15;
  284. pcrREG->PPROTCLR2 = peripheral_Quad_CS.Peripheral_Quad8_11_CS16_23;
  285. pcrREG->PPROTCLR3 = peripheral_Quad_CS.Peripheral_Quad12_15_CS24_31;
  286. /* USER CODE BEGIN (30) */
  287. /* USER CODE END */
  288. }
  289. /* USER CODE BEGIN (31) */
  290. /* USER CODE END */
  291. /** @fn void peripheral_Powerdown_Set(peripheral_Quad_ChipSelect_t peripheral_Quad_CS)
  292. * @brief Take all the selected peripheral frame to powerdown
  293. * @param[in] peripheral_Quad_CS - Peripheral frames to be taken to powerdown
  294. *
  295. * This function will set all the selected peripheral frame to powerdown.
  296. */
  297. void peripheral_Powerdown_Set(peripheral_Quad_ChipSelect_t peripheral_Quad_CS)
  298. {
  299. /* USER CODE BEGIN (32) */
  300. /* USER CODE END */
  301. pcrREG->PSPWRDWNSET0 = peripheral_Quad_CS.Peripheral_Quad0_3_CS0_7;
  302. pcrREG->PSPWRDWNSET1 = peripheral_Quad_CS.Peripheral_Quad4_7_CS8_15;
  303. pcrREG->PSPWRDWNSET2 = peripheral_Quad_CS.Peripheral_Quad8_11_CS16_23;
  304. pcrREG->PSPWRDWNSET3 = peripheral_Quad_CS.Peripheral_Quad12_15_CS24_31;
  305. /* USER CODE BEGIN (33) */
  306. /* USER CODE END */
  307. }
  308. /* USER CODE BEGIN (34) */
  309. /* USER CODE END */
  310. /** @fn void peripheral_Powerdown_Clr(peripheral_Quad_ChipSelect_t peripheral_Quad_CS)
  311. * @brief Bring all the selected peripheral frame out of powerdown
  312. * @param[in] peripheral_Quad_CS - Peripheral frames to be taken out of powerdown
  313. *
  314. * This function will bring all the selected peripheral frame out of powerdown.
  315. */
  316. void peripheral_Powerdown_Clr(peripheral_Quad_ChipSelect_t peripheral_Quad_CS)
  317. {
  318. /* USER CODE BEGIN (35) */
  319. /* USER CODE END */
  320. pcrREG->PSPWRDWNCLR0 = peripheral_Quad_CS.Peripheral_Quad0_3_CS0_7;
  321. pcrREG->PSPWRDWNCLR1 = peripheral_Quad_CS.Peripheral_Quad4_7_CS8_15;
  322. pcrREG->PSPWRDWNCLR2 = peripheral_Quad_CS.Peripheral_Quad8_11_CS16_23;
  323. pcrREG->PSPWRDWNCLR3 = peripheral_Quad_CS.Peripheral_Quad12_15_CS24_31;
  324. /* USER CODE BEGIN (36) */
  325. /* USER CODE END */
  326. }
  327. /* USER CODE BEGIN (37) */
  328. /* USER CODE END */
  329. /** @fn void peripheral_Memory_Protection_Set(peripheral_Memory_ChipSelect_t peripheral_Memory_CS)
  330. * @brief Set the peripheral memory protection of all the selected frame
  331. * @param[in] peripheral_Memory_CS - Peripheral memory frames to be protected
  332. *
  333. * This function sets the protection for all the selected peripheral memory frame.
  334. */
  335. void peripheral_Memory_Protection_Set(peripheral_Memory_ChipSelect_t peripheral_Memory_CS)
  336. {
  337. /* USER CODE BEGIN (38) */
  338. /* USER CODE END */
  339. pcrREG->PMPROTSET0 = peripheral_Memory_CS.Peripheral_Mem_CS0_31;
  340. pcrREG->PMPROTSET1 = peripheral_Memory_CS.Peripheral_Mem_CS32_63;
  341. /* USER CODE BEGIN (39) */
  342. /* USER CODE END */
  343. }
  344. /* USER CODE BEGIN (40) */
  345. /* USER CODE END */
  346. /** @fn void peripheral_Memory_Protection_Clr(peripheral_Memory_ChipSelect_t peripheral_Memory_CS)
  347. * @brief Clear the peripheral memory protection of all the selected frame
  348. * @param[in] peripheral_Memory_CS - Peripheral memory frames to be cleared from protection
  349. *
  350. * This function clears the protection set for all the selected peripheral memory frame.
  351. */
  352. void peripheral_Memory_Protection_Clr(peripheral_Memory_ChipSelect_t peripheral_Memory_CS)
  353. {
  354. /* USER CODE BEGIN (41) */
  355. /* USER CODE END */
  356. pcrREG->PMPROTCLR0 = peripheral_Memory_CS.Peripheral_Mem_CS0_31;
  357. pcrREG->PMPROTCLR1 = peripheral_Memory_CS.Peripheral_Mem_CS32_63;
  358. /* USER CODE BEGIN (42) */
  359. /* USER CODE END */
  360. }
  361. /* USER CODE BEGIN (43) */
  362. /* USER CODE END */
  363. /** @fn void peripheral_Memory_Powerdown_Set(peripheral_Memory_ChipSelect_t peripheral_Memory_CS)
  364. * @brief Take all the selected peripheral memory frame to powerdown
  365. * @param[in] peripheral_Memory_CS - Peripheral memory frames to be taken to powerdown
  366. *
  367. * This function will set all the selected peripheral memory frame to powerdown.
  368. */
  369. void peripheral_Memory_Powerdown_Set(peripheral_Memory_ChipSelect_t peripheral_Memory_CS)
  370. {
  371. /* USER CODE BEGIN (44) */
  372. /* USER CODE END */
  373. pcrREG->PSPWRDWNSET0 = peripheral_Memory_CS.Peripheral_Mem_CS0_31;
  374. pcrREG->PSPWRDWNSET1 = peripheral_Memory_CS.Peripheral_Mem_CS32_63;
  375. /* USER CODE BEGIN (45) */
  376. /* USER CODE END */
  377. }
  378. /* USER CODE BEGIN (46) */
  379. /* USER CODE END */
  380. /** @fn void peripheral_Memory_Powerdown_Clr(peripheral_Memory_ChipSelect_t peripheral_Memory_CS)
  381. * @brief Bring all the selected peripheral Memory frame out of powerdown
  382. * @param[in] peripheral_Memory_CS - Peripheral memory frames to be taken out of powerdown
  383. *
  384. * This function will bring all the selected peripheral memory frame out of powerdown.
  385. */
  386. void peripheral_Memory_Powerdown_Clr(peripheral_Memory_ChipSelect_t peripheral_Memory_CS)
  387. {
  388. /* USER CODE BEGIN (47) */
  389. /* USER CODE END */
  390. pcrREG->PSPWRDWNCLR0 = peripheral_Memory_CS.Peripheral_Mem_CS0_31;
  391. pcrREG->PSPWRDWNCLR1 = peripheral_Memory_CS.Peripheral_Mem_CS32_63;
  392. /* USER CODE BEGIN (48) */
  393. /* USER CODE END */
  394. }
  395. /* USER CODE BEGIN (49) */
  396. /* USER CODE END */
  397. /** @fn peripheral_Quad_ChipSelect_t peripheral_Powerdown_Status(void)
  398. * @brief Get the powerdown status of the peripheral frames.
  399. * @return Peripheral frames power down status
  400. *
  401. * This function gets the powerdown status of the peripheral frames.
  402. */
  403. peripheral_Quad_ChipSelect_t peripheral_Powerdown_Status(void)
  404. {
  405. /* USER CODE BEGIN (50) */
  406. /* USER CODE END */
  407. peripheral_Quad_ChipSelect_t peripheral_Quad_CS;
  408. peripheral_Quad_CS.Peripheral_Quad0_3_CS0_7 = pcrREG->PSPWRDWNSET0;
  409. peripheral_Quad_CS.Peripheral_Quad4_7_CS8_15 = pcrREG->PSPWRDWNSET1;
  410. peripheral_Quad_CS.Peripheral_Quad8_11_CS16_23 = pcrREG->PSPWRDWNSET2;
  411. peripheral_Quad_CS.Peripheral_Quad12_15_CS24_31 = pcrREG->PSPWRDWNSET3;
  412. /* USER CODE BEGIN (51) */
  413. /* USER CODE END */
  414. return peripheral_Quad_CS;
  415. }
  416. /* USER CODE BEGIN (52) */
  417. /* USER CODE END */
  418. /** @fn peripheral_Quad_ChipSelect_t peripheral_Protection_Status(void)
  419. * @brief Get the protection status of the peripheral frames
  420. * @return Peripheral frames protection status
  421. *
  422. * This function gets the protection status of the peripheral frames.
  423. */
  424. peripheral_Quad_ChipSelect_t peripheral_Protection_Status(void)
  425. {
  426. /* USER CODE BEGIN (53) */
  427. /* USER CODE END */
  428. peripheral_Quad_ChipSelect_t peripheral_Quad_CS;
  429. peripheral_Quad_CS.Peripheral_Quad0_3_CS0_7 = pcrREG->PPROTSET0;
  430. peripheral_Quad_CS.Peripheral_Quad4_7_CS8_15 = pcrREG->PPROTSET1;
  431. peripheral_Quad_CS.Peripheral_Quad8_11_CS16_23 = pcrREG->PPROTSET2;
  432. peripheral_Quad_CS.Peripheral_Quad12_15_CS24_31 = pcrREG->PPROTSET3;
  433. /* USER CODE BEGIN (54) */
  434. /* USER CODE END */
  435. return peripheral_Quad_CS;
  436. }
  437. /* USER CODE BEGIN (55) */
  438. /* USER CODE END */
  439. /** @fn peripheral_Memory_ChipSelect_t peripheral_Memory_Protection_Status(void)
  440. * @brief Get the protection set of all the peripheral Memory frame
  441. * @return Peripheral memory frames protection status
  442. *
  443. * This function gets the protection status of all the peripheral Memory frame.
  444. */
  445. peripheral_Memory_ChipSelect_t peripheral_Memory_Protection_Status(void)
  446. {
  447. /* USER CODE BEGIN (56) */
  448. /* USER CODE END */
  449. peripheral_Memory_ChipSelect_t peripheral_Memory_CS;
  450. peripheral_Memory_CS.Peripheral_Mem_CS0_31 = pcrREG->PMPROTSET0;
  451. peripheral_Memory_CS.Peripheral_Mem_CS32_63 = pcrREG->PMPROTSET1;
  452. /* USER CODE BEGIN (57) */
  453. /* USER CODE END */
  454. return peripheral_Memory_CS;
  455. }
  456. /* USER CODE BEGIN (58) */
  457. /* USER CODE END */
  458. /** @fn peripheral_Memory_ChipSelect_t Periipheral_Memory_Powerdown_Status(void)
  459. * @brief Get the powerdown status of all the peripheral Memory frame
  460. * @return Peripheral memory frames powerdown status
  461. *
  462. * This function gets the powerdown status of all the peripheral Memory frame.
  463. */
  464. peripheral_Memory_ChipSelect_t Periipheral_Memory_Powerdown_Status(void)
  465. {
  466. /* USER CODE BEGIN (59) */
  467. /* USER CODE END */
  468. peripheral_Memory_ChipSelect_t peripheral_Memory_CS;
  469. peripheral_Memory_CS.Peripheral_Mem_CS0_31 = pcrREG->PSPWRDWNSET0;
  470. peripheral_Memory_CS.Peripheral_Mem_CS32_63 = pcrREG->PSPWRDWNSET1;
  471. /* USER CODE BEGIN (60) */
  472. /* USER CODE END */
  473. return peripheral_Memory_CS;
  474. }
  475. /* USER CODE BEGIN (61) */
  476. /* USER CODE END */