示例#1
0
int main()
{
    int value;
    float temp;
    while(1)
    {
        if(read_sysfs_temp(&temp) == 0)
        {
            printf("chip temp is %.3f\n", temp);
        }
        if(read_sysfs_u32(XSM_SEQ_CH_AUX06, &value) == 0)
        {
            printf("AUX06 voltage is %.3f\n", value / XADC_SCALE);
        }
        if(read_sysfs_u32(XSM_SEQ_CH_AUX07, &value) == 0)
        {
            printf("AUX07 voltage is %.3f\n", value / XADC_SCALE);
        }
        if(read_sysfs_u32(XSM_SEQ_CH_AUX14, &value) == 0)
        {
            printf("AUX14 voltage is %.3f\n", value / XADC_SCALE);
        }
        if(read_sysfs_u32(XSM_SEQ_CH_AUX15, &value) == 0)
        {
            printf("AUX15 voltage is %.3f\n", value / XADC_SCALE);
        }
        usleep(200000);
        
    }
    return 0;
}
示例#2
0
int get_zone_temp(int zone_index)
{
    char buffer[THERMAL_SYSFS_LENGTH];
    int temp, status;

    snprintf(buffer, sizeof(buffer), TEMP_PATH, zone_index);
    status = read_sysfs_temp(buffer, &temp);

    if (status) {
        LOGE("Error in reading temperature for zone index %d", zone_index);
        temp = 0;
    }
    return temp;
}