Advertisement
Guest User

Dla ustawień ABCD 8

a guest
Jan 25th, 2016
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.63 KB | None | 0 0
  1. /*AUTO GENERATED CODE BY MATEUSZ POPIELARZ pixdevlife.azurewebsites.net*/
  2.  
  3. class PortA{
  4. public:
  5. void static SetBits(uint8_t uCharValue)
  6. {
  7. PORTA |= uCharValue;
  8. }
  9.  
  10. void static Set()
  11. {
  12. PORTA = 0xff;
  13. }
  14.  
  15. void static ClearBits(uint8_t uCharValue)
  16. {
  17. PORTA &= ~(uCharValue);
  18. }
  19.  
  20. void static Clear()
  21. {
  22. PORTA = 0;
  23. }
  24.  
  25. void static ToggleBits(uint8_t uCharValue)
  26. {
  27. PORTA ^= uCharValue;
  28. }
  29. void static Toggle()
  30. {
  31. PORTA ^= 0xff;
  32. }
  33.  
  34. bool static Check()
  35. {
  36. return PINA;
  37. }
  38.  
  39. void static AsOutput()
  40. {
  41. DDRA = 0xff;
  42. }
  43. void static AsInput()
  44. {
  45. DDRA = 0;
  46. }
  47.  
  48. void static AsOutputBits(uint8_t uCharValue)
  49. {
  50. DDRA |= (uCharValue);
  51. }
  52.  
  53. void static AsInputBits(uint8_t uCharValue)
  54. {
  55. DDRA &= ~uCharValue;
  56. }
  57. };
  58.  
  59. class Pin_A0{
  60. public:
  61. void static Set()
  62. {
  63. PORTA |= 1 << 0;
  64. }
  65.  
  66. void static Clear()
  67. {
  68. PORTA &= ~(1<<0);
  69. }
  70.  
  71. void static Toggle()
  72. {
  73. PORTA ^= (1<<0);
  74. }
  75.  
  76. bool static Check()
  77. {
  78. return ((PINA >> 0) & 1);
  79. }
  80.  
  81. void static AsOutput()
  82. {
  83. DDRA |= (1<<0);
  84. }
  85.  
  86. void static AsInput()
  87. {
  88. DDRA &= !(1<<0);
  89. }
  90. };
  91.  
  92. class Pin_A1{
  93. public:
  94. void static Set()
  95. {
  96. PORTA |= 1 << 1;
  97. }
  98.  
  99. void static Clear()
  100. {
  101. PORTA &= ~(1<<1);
  102. }
  103.  
  104. void static Toggle()
  105. {
  106. PORTA ^= (1<<1);
  107. }
  108.  
  109. bool static Check()
  110. {
  111. return ((PINA >> 1) & 1);
  112. }
  113.  
  114. void static AsOutput()
  115. {
  116. DDRA |= (1<<1);
  117. }
  118.  
  119. void static AsInput()
  120. {
  121. DDRA &= !(1<<1);
  122. }
  123. };
  124.  
  125. class Pin_A2{
  126. public:
  127. void static Set()
  128. {
  129. PORTA |= 1 << 2;
  130. }
  131.  
  132. void static Clear()
  133. {
  134. PORTA &= ~(1<<2);
  135. }
  136.  
  137. void static Toggle()
  138. {
  139. PORTA ^= (1<<2);
  140. }
  141.  
  142. bool static Check()
  143. {
  144. return ((PINA >> 2) & 1);
  145. }
  146.  
  147. void static AsOutput()
  148. {
  149. DDRA |= (1<<2);
  150. }
  151.  
  152. void static AsInput()
  153. {
  154. DDRA &= !(1<<2);
  155. }
  156. };
  157.  
  158. class Pin_A3{
  159. public:
  160. void static Set()
  161. {
  162. PORTA |= 1 << 3;
  163. }
  164.  
  165. void static Clear()
  166. {
  167. PORTA &= ~(1<<3);
  168. }
  169.  
  170. void static Toggle()
  171. {
  172. PORTA ^= (1<<3);
  173. }
  174.  
  175. bool static Check()
  176. {
  177. return ((PINA >> 3) & 1);
  178. }
  179.  
  180. void static AsOutput()
  181. {
  182. DDRA |= (1<<3);
  183. }
  184.  
  185. void static AsInput()
  186. {
  187. DDRA &= !(1<<3);
  188. }
  189. };
  190.  
  191. class Pin_A4{
  192. public:
  193. void static Set()
  194. {
  195. PORTA |= 1 << 4;
  196. }
  197.  
  198. void static Clear()
  199. {
  200. PORTA &= ~(1<<4);
  201. }
  202.  
  203. void static Toggle()
  204. {
  205. PORTA ^= (1<<4);
  206. }
  207.  
  208. bool static Check()
  209. {
  210. return ((PINA >> 4) & 1);
  211. }
  212.  
  213. void static AsOutput()
  214. {
  215. DDRA |= (1<<4);
  216. }
  217.  
  218. void static AsInput()
  219. {
  220. DDRA &= !(1<<4);
  221. }
  222. };
  223.  
  224. class Pin_A5{
  225. public:
  226. void static Set()
  227. {
  228. PORTA |= 1 << 5;
  229. }
  230.  
  231. void static Clear()
  232. {
  233. PORTA &= ~(1<<5);
  234. }
  235.  
  236. void static Toggle()
  237. {
  238. PORTA ^= (1<<5);
  239. }
  240.  
  241. bool static Check()
  242. {
  243. return ((PINA >> 5) & 1);
  244. }
  245.  
  246. void static AsOutput()
  247. {
  248. DDRA |= (1<<5);
  249. }
  250.  
  251. void static AsInput()
  252. {
  253. DDRA &= !(1<<5);
  254. }
  255. };
  256.  
  257. class Pin_A6{
  258. public:
  259. void static Set()
  260. {
  261. PORTA |= 1 << 6;
  262. }
  263.  
  264. void static Clear()
  265. {
  266. PORTA &= ~(1<<6);
  267. }
  268.  
  269. void static Toggle()
  270. {
  271. PORTA ^= (1<<6);
  272. }
  273.  
  274. bool static Check()
  275. {
  276. return ((PINA >> 6) & 1);
  277. }
  278.  
  279. void static AsOutput()
  280. {
  281. DDRA |= (1<<6);
  282. }
  283.  
  284. void static AsInput()
  285. {
  286. DDRA &= !(1<<6);
  287. }
  288. };
  289.  
  290. class Pin_A7{
  291. public:
  292. void static Set()
  293. {
  294. PORTA |= 1 << 7;
  295. }
  296.  
  297. void static Clear()
  298. {
  299. PORTA &= ~(1<<7);
  300. }
  301.  
  302. void static Toggle()
  303. {
  304. PORTA ^= (1<<7);
  305. }
  306.  
  307. bool static Check()
  308. {
  309. return ((PINA >> 7) & 1);
  310. }
  311.  
  312. void static AsOutput()
  313. {
  314. DDRA |= (1<<7);
  315. }
  316.  
  317. void static AsInput()
  318. {
  319. DDRA &= !(1<<7);
  320. }
  321. };
  322.  
  323. class PortB{
  324. public:
  325. void static SetBits(uint8_t uCharValue)
  326. {
  327. PORTB |= uCharValue;
  328. }
  329.  
  330. void static Set()
  331. {
  332. PORTB = 0xff;
  333. }
  334.  
  335. void static ClearBits(uint8_t uCharValue)
  336. {
  337. PORTB &= ~(uCharValue);
  338. }
  339.  
  340. void static Clear()
  341. {
  342. PORTB = 0;
  343. }
  344.  
  345. void static ToggleBits(uint8_t uCharValue)
  346. {
  347. PORTB ^= uCharValue;
  348. }
  349. void static Toggle()
  350. {
  351. PORTB ^= 0xff;
  352. }
  353.  
  354. bool static Check()
  355. {
  356. return PINB;
  357. }
  358.  
  359. void static AsOutput()
  360. {
  361. DDRB = 0xff;
  362. }
  363. void static AsInput()
  364. {
  365. DDRB = 0;
  366. }
  367.  
  368. void static AsOutputBits(uint8_t uCharValue)
  369. {
  370. DDRB |= (uCharValue);
  371. }
  372.  
  373. void static AsInputBits(uint8_t uCharValue)
  374. {
  375. DDRB &= ~uCharValue;
  376. }
  377. };
  378.  
  379. class Pin_B0{
  380. public:
  381. void static Set()
  382. {
  383. PORTB |= 1 << 0;
  384. }
  385.  
  386. void static Clear()
  387. {
  388. PORTB &= ~(1<<0);
  389. }
  390.  
  391. void static Toggle()
  392. {
  393. PORTB ^= (1<<0);
  394. }
  395.  
  396. bool static Check()
  397. {
  398. return ((PINB >> 0) & 1);
  399. }
  400.  
  401. void static AsOutput()
  402. {
  403. DDRB |= (1<<0);
  404. }
  405.  
  406. void static AsInput()
  407. {
  408. DDRB &= !(1<<0);
  409. }
  410. };
  411.  
  412. class Pin_B1{
  413. public:
  414. void static Set()
  415. {
  416. PORTB |= 1 << 1;
  417. }
  418.  
  419. void static Clear()
  420. {
  421. PORTB &= ~(1<<1);
  422. }
  423.  
  424. void static Toggle()
  425. {
  426. PORTB ^= (1<<1);
  427. }
  428.  
  429. bool static Check()
  430. {
  431. return ((PINB >> 1) & 1);
  432. }
  433.  
  434. void static AsOutput()
  435. {
  436. DDRB |= (1<<1);
  437. }
  438.  
  439. void static AsInput()
  440. {
  441. DDRB &= !(1<<1);
  442. }
  443. };
  444.  
  445. class Pin_B2{
  446. public:
  447. void static Set()
  448. {
  449. PORTB |= 1 << 2;
  450. }
  451.  
  452. void static Clear()
  453. {
  454. PORTB &= ~(1<<2);
  455. }
  456.  
  457. void static Toggle()
  458. {
  459. PORTB ^= (1<<2);
  460. }
  461.  
  462. bool static Check()
  463. {
  464. return ((PINB >> 2) & 1);
  465. }
  466.  
  467. void static AsOutput()
  468. {
  469. DDRB |= (1<<2);
  470. }
  471.  
  472. void static AsInput()
  473. {
  474. DDRB &= !(1<<2);
  475. }
  476. };
  477.  
  478. class Pin_B3{
  479. public:
  480. void static Set()
  481. {
  482. PORTB |= 1 << 3;
  483. }
  484.  
  485. void static Clear()
  486. {
  487. PORTB &= ~(1<<3);
  488. }
  489.  
  490. void static Toggle()
  491. {
  492. PORTB ^= (1<<3);
  493. }
  494.  
  495. bool static Check()
  496. {
  497. return ((PINB >> 3) & 1);
  498. }
  499.  
  500. void static AsOutput()
  501. {
  502. DDRB |= (1<<3);
  503. }
  504.  
  505. void static AsInput()
  506. {
  507. DDRB &= !(1<<3);
  508. }
  509. };
  510.  
  511. class Pin_B4{
  512. public:
  513. void static Set()
  514. {
  515. PORTB |= 1 << 4;
  516. }
  517.  
  518. void static Clear()
  519. {
  520. PORTB &= ~(1<<4);
  521. }
  522.  
  523. void static Toggle()
  524. {
  525. PORTB ^= (1<<4);
  526. }
  527.  
  528. bool static Check()
  529. {
  530. return ((PINB >> 4) & 1);
  531. }
  532.  
  533. void static AsOutput()
  534. {
  535. DDRB |= (1<<4);
  536. }
  537.  
  538. void static AsInput()
  539. {
  540. DDRB &= !(1<<4);
  541. }
  542. };
  543.  
  544. class Pin_B5{
  545. public:
  546. void static Set()
  547. {
  548. PORTB |= 1 << 5;
  549. }
  550.  
  551. void static Clear()
  552. {
  553. PORTB &= ~(1<<5);
  554. }
  555.  
  556. void static Toggle()
  557. {
  558. PORTB ^= (1<<5);
  559. }
  560.  
  561. bool static Check()
  562. {
  563. return ((PINB >> 5) & 1);
  564. }
  565.  
  566. void static AsOutput()
  567. {
  568. DDRB |= (1<<5);
  569. }
  570.  
  571. void static AsInput()
  572. {
  573. DDRB &= !(1<<5);
  574. }
  575. };
  576.  
  577. class Pin_B6{
  578. public:
  579. void static Set()
  580. {
  581. PORTB |= 1 << 6;
  582. }
  583.  
  584. void static Clear()
  585. {
  586. PORTB &= ~(1<<6);
  587. }
  588.  
  589. void static Toggle()
  590. {
  591. PORTB ^= (1<<6);
  592. }
  593.  
  594. bool static Check()
  595. {
  596. return ((PINB >> 6) & 1);
  597. }
  598.  
  599. void static AsOutput()
  600. {
  601. DDRB |= (1<<6);
  602. }
  603.  
  604. void static AsInput()
  605. {
  606. DDRB &= !(1<<6);
  607. }
  608. };
  609.  
  610. class Pin_B7{
  611. public:
  612. void static Set()
  613. {
  614. PORTB |= 1 << 7;
  615. }
  616.  
  617. void static Clear()
  618. {
  619. PORTB &= ~(1<<7);
  620. }
  621.  
  622. void static Toggle()
  623. {
  624. PORTB ^= (1<<7);
  625. }
  626.  
  627. bool static Check()
  628. {
  629. return ((PINB >> 7) & 1);
  630. }
  631.  
  632. void static AsOutput()
  633. {
  634. DDRB |= (1<<7);
  635. }
  636.  
  637. void static AsInput()
  638. {
  639. DDRB &= !(1<<7);
  640. }
  641. };
  642.  
  643. class PortC{
  644. public:
  645. void static SetBits(uint8_t uCharValue)
  646. {
  647. PORTC |= uCharValue;
  648. }
  649.  
  650. void static Set()
  651. {
  652. PORTC = 0xff;
  653. }
  654.  
  655. void static ClearBits(uint8_t uCharValue)
  656. {
  657. PORTC &= ~(uCharValue);
  658. }
  659.  
  660. void static Clear()
  661. {
  662. PORTC = 0;
  663. }
  664.  
  665. void static ToggleBits(uint8_t uCharValue)
  666. {
  667. PORTC ^= uCharValue;
  668. }
  669. void static Toggle()
  670. {
  671. PORTC ^= 0xff;
  672. }
  673.  
  674. bool static Check()
  675. {
  676. return PINC;
  677. }
  678.  
  679. void static AsOutput()
  680. {
  681. DDRC = 0xff;
  682. }
  683. void static AsInput()
  684. {
  685. DDRC = 0;
  686. }
  687.  
  688. void static AsOutputBits(uint8_t uCharValue)
  689. {
  690. DDRC |= (uCharValue);
  691. }
  692.  
  693. void static AsInputBits(uint8_t uCharValue)
  694. {
  695. DDRC &= ~uCharValue;
  696. }
  697. };
  698.  
  699. class Pin_C0{
  700. public:
  701. void static Set()
  702. {
  703. PORTC |= 1 << 0;
  704. }
  705.  
  706. void static Clear()
  707. {
  708. PORTC &= ~(1<<0);
  709. }
  710.  
  711. void static Toggle()
  712. {
  713. PORTC ^= (1<<0);
  714. }
  715.  
  716. bool static Check()
  717. {
  718. return ((PINC >> 0) & 1);
  719. }
  720.  
  721. void static AsOutput()
  722. {
  723. DDRC |= (1<<0);
  724. }
  725.  
  726. void static AsInput()
  727. {
  728. DDRC &= !(1<<0);
  729. }
  730. };
  731.  
  732. class Pin_C1{
  733. public:
  734. void static Set()
  735. {
  736. PORTC |= 1 << 1;
  737. }
  738.  
  739. void static Clear()
  740. {
  741. PORTC &= ~(1<<1);
  742. }
  743.  
  744. void static Toggle()
  745. {
  746. PORTC ^= (1<<1);
  747. }
  748.  
  749. bool static Check()
  750. {
  751. return ((PINC >> 1) & 1);
  752. }
  753.  
  754. void static AsOutput()
  755. {
  756. DDRC |= (1<<1);
  757. }
  758.  
  759. void static AsInput()
  760. {
  761. DDRC &= !(1<<1);
  762. }
  763. };
  764.  
  765. class Pin_C2{
  766. public:
  767. void static Set()
  768. {
  769. PORTC |= 1 << 2;
  770. }
  771.  
  772. void static Clear()
  773. {
  774. PORTC &= ~(1<<2);
  775. }
  776.  
  777. void static Toggle()
  778. {
  779. PORTC ^= (1<<2);
  780. }
  781.  
  782. bool static Check()
  783. {
  784. return ((PINC >> 2) & 1);
  785. }
  786.  
  787. void static AsOutput()
  788. {
  789. DDRC |= (1<<2);
  790. }
  791.  
  792. void static AsInput()
  793. {
  794. DDRC &= !(1<<2);
  795. }
  796. };
  797.  
  798. class Pin_C3{
  799. public:
  800. void static Set()
  801. {
  802. PORTC |= 1 << 3;
  803. }
  804.  
  805. void static Clear()
  806. {
  807. PORTC &= ~(1<<3);
  808. }
  809.  
  810. void static Toggle()
  811. {
  812. PORTC ^= (1<<3);
  813. }
  814.  
  815. bool static Check()
  816. {
  817. return ((PINC >> 3) & 1);
  818. }
  819.  
  820. void static AsOutput()
  821. {
  822. DDRC |= (1<<3);
  823. }
  824.  
  825. void static AsInput()
  826. {
  827. DDRC &= !(1<<3);
  828. }
  829. };
  830.  
  831. class Pin_C4{
  832. public:
  833. void static Set()
  834. {
  835. PORTC |= 1 << 4;
  836. }
  837.  
  838. void static Clear()
  839. {
  840. PORTC &= ~(1<<4);
  841. }
  842.  
  843. void static Toggle()
  844. {
  845. PORTC ^= (1<<4);
  846. }
  847.  
  848. bool static Check()
  849. {
  850. return ((PINC >> 4) & 1);
  851. }
  852.  
  853. void static AsOutput()
  854. {
  855. DDRC |= (1<<4);
  856. }
  857.  
  858. void static AsInput()
  859. {
  860. DDRC &= !(1<<4);
  861. }
  862. };
  863.  
  864. class Pin_C5{
  865. public:
  866. void static Set()
  867. {
  868. PORTC |= 1 << 5;
  869. }
  870.  
  871. void static Clear()
  872. {
  873. PORTC &= ~(1<<5);
  874. }
  875.  
  876. void static Toggle()
  877. {
  878. PORTC ^= (1<<5);
  879. }
  880.  
  881. bool static Check()
  882. {
  883. return ((PINC >> 5) & 1);
  884. }
  885.  
  886. void static AsOutput()
  887. {
  888. DDRC |= (1<<5);
  889. }
  890.  
  891. void static AsInput()
  892. {
  893. DDRC &= !(1<<5);
  894. }
  895. };
  896.  
  897. class Pin_C6{
  898. public:
  899. void static Set()
  900. {
  901. PORTC |= 1 << 6;
  902. }
  903.  
  904. void static Clear()
  905. {
  906. PORTC &= ~(1<<6);
  907. }
  908.  
  909. void static Toggle()
  910. {
  911. PORTC ^= (1<<6);
  912. }
  913.  
  914. bool static Check()
  915. {
  916. return ((PINC >> 6) & 1);
  917. }
  918.  
  919. void static AsOutput()
  920. {
  921. DDRC |= (1<<6);
  922. }
  923.  
  924. void static AsInput()
  925. {
  926. DDRC &= !(1<<6);
  927. }
  928. };
  929.  
  930. class Pin_C7{
  931. public:
  932. void static Set()
  933. {
  934. PORTC |= 1 << 7;
  935. }
  936.  
  937. void static Clear()
  938. {
  939. PORTC &= ~(1<<7);
  940. }
  941.  
  942. void static Toggle()
  943. {
  944. PORTC ^= (1<<7);
  945. }
  946.  
  947. bool static Check()
  948. {
  949. return ((PINC >> 7) & 1);
  950. }
  951.  
  952. void static AsOutput()
  953. {
  954. DDRC |= (1<<7);
  955. }
  956.  
  957. void static AsInput()
  958. {
  959. DDRC &= !(1<<7);
  960. }
  961. };
  962.  
  963. class PortD{
  964. public:
  965. void static SetBits(uint8_t uCharValue)
  966. {
  967. PORTD |= uCharValue;
  968. }
  969.  
  970. void static Set()
  971. {
  972. PORTD = 0xff;
  973. }
  974.  
  975. void static ClearBits(uint8_t uCharValue)
  976. {
  977. PORTD &= ~(uCharValue);
  978. }
  979.  
  980. void static Clear()
  981. {
  982. PORTD = 0;
  983. }
  984.  
  985. void static ToggleBits(uint8_t uCharValue)
  986. {
  987. PORTD ^= uCharValue;
  988. }
  989. void static Toggle()
  990. {
  991. PORTD ^= 0xff;
  992. }
  993.  
  994. bool static Check()
  995. {
  996. return PIND;
  997. }
  998.  
  999. void static AsOutput()
  1000. {
  1001. DDRD = 0xff;
  1002. }
  1003. void static AsInput()
  1004. {
  1005. DDRD = 0;
  1006. }
  1007.  
  1008. void static AsOutputBits(uint8_t uCharValue)
  1009. {
  1010. DDRD |= (uCharValue);
  1011. }
  1012.  
  1013. void static AsInputBits(uint8_t uCharValue)
  1014. {
  1015. DDRD &= ~uCharValue;
  1016. }
  1017. };
  1018.  
  1019. class Pin_D0{
  1020. public:
  1021. void static Set()
  1022. {
  1023. PORTD |= 1 << 0;
  1024. }
  1025.  
  1026. void static Clear()
  1027. {
  1028. PORTD &= ~(1<<0);
  1029. }
  1030.  
  1031. void static Toggle()
  1032. {
  1033. PORTD ^= (1<<0);
  1034. }
  1035.  
  1036. bool static Check()
  1037. {
  1038. return ((PIND >> 0) & 1);
  1039. }
  1040.  
  1041. void static AsOutput()
  1042. {
  1043. DDRD |= (1<<0);
  1044. }
  1045.  
  1046. void static AsInput()
  1047. {
  1048. DDRD &= !(1<<0);
  1049. }
  1050. };
  1051.  
  1052. class Pin_D1{
  1053. public:
  1054. void static Set()
  1055. {
  1056. PORTD |= 1 << 1;
  1057. }
  1058.  
  1059. void static Clear()
  1060. {
  1061. PORTD &= ~(1<<1);
  1062. }
  1063.  
  1064. void static Toggle()
  1065. {
  1066. PORTD ^= (1<<1);
  1067. }
  1068.  
  1069. bool static Check()
  1070. {
  1071. return ((PIND >> 1) & 1);
  1072. }
  1073.  
  1074. void static AsOutput()
  1075. {
  1076. DDRD |= (1<<1);
  1077. }
  1078.  
  1079. void static AsInput()
  1080. {
  1081. DDRD &= !(1<<1);
  1082. }
  1083. };
  1084.  
  1085. class Pin_D2{
  1086. public:
  1087. void static Set()
  1088. {
  1089. PORTD |= 1 << 2;
  1090. }
  1091.  
  1092. void static Clear()
  1093. {
  1094. PORTD &= ~(1<<2);
  1095. }
  1096.  
  1097. void static Toggle()
  1098. {
  1099. PORTD ^= (1<<2);
  1100. }
  1101.  
  1102. bool static Check()
  1103. {
  1104. return ((PIND >> 2) & 1);
  1105. }
  1106.  
  1107. void static AsOutput()
  1108. {
  1109. DDRD |= (1<<2);
  1110. }
  1111.  
  1112. void static AsInput()
  1113. {
  1114. DDRD &= !(1<<2);
  1115. }
  1116. };
  1117.  
  1118. class Pin_D3{
  1119. public:
  1120. void static Set()
  1121. {
  1122. PORTD |= 1 << 3;
  1123. }
  1124.  
  1125. void static Clear()
  1126. {
  1127. PORTD &= ~(1<<3);
  1128. }
  1129.  
  1130. void static Toggle()
  1131. {
  1132. PORTD ^= (1<<3);
  1133. }
  1134.  
  1135. bool static Check()
  1136. {
  1137. return ((PIND >> 3) & 1);
  1138. }
  1139.  
  1140. void static AsOutput()
  1141. {
  1142. DDRD |= (1<<3);
  1143. }
  1144.  
  1145. void static AsInput()
  1146. {
  1147. DDRD &= !(1<<3);
  1148. }
  1149. };
  1150.  
  1151. class Pin_D4{
  1152. public:
  1153. void static Set()
  1154. {
  1155. PORTD |= 1 << 4;
  1156. }
  1157.  
  1158. void static Clear()
  1159. {
  1160. PORTD &= ~(1<<4);
  1161. }
  1162.  
  1163. void static Toggle()
  1164. {
  1165. PORTD ^= (1<<4);
  1166. }
  1167.  
  1168. bool static Check()
  1169. {
  1170. return ((PIND >> 4) & 1);
  1171. }
  1172.  
  1173. void static AsOutput()
  1174. {
  1175. DDRD |= (1<<4);
  1176. }
  1177.  
  1178. void static AsInput()
  1179. {
  1180. DDRD &= !(1<<4);
  1181. }
  1182. };
  1183.  
  1184. class Pin_D5{
  1185. public:
  1186. void static Set()
  1187. {
  1188. PORTD |= 1 << 5;
  1189. }
  1190.  
  1191. void static Clear()
  1192. {
  1193. PORTD &= ~(1<<5);
  1194. }
  1195.  
  1196. void static Toggle()
  1197. {
  1198. PORTD ^= (1<<5);
  1199. }
  1200.  
  1201. bool static Check()
  1202. {
  1203. return ((PIND >> 5) & 1);
  1204. }
  1205.  
  1206. void static AsOutput()
  1207. {
  1208. DDRD |= (1<<5);
  1209. }
  1210.  
  1211. void static AsInput()
  1212. {
  1213. DDRD &= !(1<<5);
  1214. }
  1215. };
  1216.  
  1217. class Pin_D6{
  1218. public:
  1219. void static Set()
  1220. {
  1221. PORTD |= 1 << 6;
  1222. }
  1223.  
  1224. void static Clear()
  1225. {
  1226. PORTD &= ~(1<<6);
  1227. }
  1228.  
  1229. void static Toggle()
  1230. {
  1231. PORTD ^= (1<<6);
  1232. }
  1233.  
  1234. bool static Check()
  1235. {
  1236. return ((PIND >> 6) & 1);
  1237. }
  1238.  
  1239. void static AsOutput()
  1240. {
  1241. DDRD |= (1<<6);
  1242. }
  1243.  
  1244. void static AsInput()
  1245. {
  1246. DDRD &= !(1<<6);
  1247. }
  1248. };
  1249.  
  1250. class Pin_D7{
  1251. public:
  1252. void static Set()
  1253. {
  1254. PORTD |= 1 << 7;
  1255. }
  1256.  
  1257. void static Clear()
  1258. {
  1259. PORTD &= ~(1<<7);
  1260. }
  1261.  
  1262. void static Toggle()
  1263. {
  1264. PORTD ^= (1<<7);
  1265. }
  1266.  
  1267. bool static Check()
  1268. {
  1269. return ((PIND >> 7) & 1);
  1270. }
  1271.  
  1272. void static AsOutput()
  1273. {
  1274. DDRD |= (1<<7);
  1275. }
  1276.  
  1277. void static AsInput()
  1278. {
  1279. DDRD &= !(1<<7);
  1280. }
  1281. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement