Bell Huang / pixart_pah8011
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers pah_util.h Source File

pah_util.h

Go to the documentation of this file.
00001 /**
00002  * @file pah_util.h
00003  *
00004  * Copyright (c) 2016-2017 PixArt Imaging Inc.
00005  * All Rights Reserved.
00006  * Confidential and Proprietary - PixArt Imaging Inc.
00007  **/
00008 #ifndef __pah_util_h__
00009 #define __pah_util_h__
00010 
00011 
00012 #include <stdint.h>
00013 
00014 
00015 #define PAH_ARRAY_SIZE(arr)         (sizeof(arr) / sizeof(arr[0]))
00016 
00017 #define PAH_SET_BIT(var,pos)        do { ((var) |= (1 << (pos))); } while(0)
00018 #define PAH_CLEAR_BIT(var,pos)      do { ((var) &= ~(1 << (pos))); } while(0)
00019 #define PAH_CHECK_BIT(var,pos)      (((var) >> (pos)) & 1)
00020 
00021 #define PAH_UINT64_HIGH(var)  ((uint32_t)(var >> 32))
00022 #define PAH_UINT64_LOW(var)   ((uint32_t)(var & UINT32_MAX))
00023 
00024 
00025 #endif  // header guard
00026