123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- #include "CM_LIB.h"
- #include "CM_I2C.h"
- #include "CM_I2C_L.h"
- #include <unistd.h>
- #include <stdio.h>
- #include "linux/fcntl.h"
- #include "driver.h"
- #include <string.h>
- void cm_PowerOn(void)
- {
-
- cm_ResetCrypto();
- ucCM_UserZone = ucCM_AntiTearing = 0;
-
- int ret;
- crypto_t crypto_arg;
- crypto_arg.loop = CM_PWRON_CLKS;
- int fd = open("/dev/crypto", O_RDWR);
- if(fd <= 0)
- {
- printf("Open /dev/crypto error!\n");
- return;
- }
- ret = ioctl(fd, CRYPTO_POWER_ON, &crypto_arg);
- if(ret != 0)
- {
- printf("cm_PowerOn failed!\n");
- close(fd);
- return;
- }
- close(fd);
-
-
-
-
-
-
-
- }
- void cm_PowerOff(void)
- {
- printf("---> cm_PowerOff\n");
-
-
-
- int ret;
- crypto_t crypto_arg;
- int fd = open("/dev/crypto", O_RDWR);
- if(fd <= 0)
- {
- printf("Open /dev/crypto error!\n");
- return;
- }
- ret = ioctl(fd, CRYPTO_POWER_OFF, &crypto_arg);
- if(ret != 0)
- {
- printf("cm_PowerOff failed!\n");
- close(fd);
- return;
- }
- close(fd);
- }
|