class pah8011 for mbed

Committer:
bell_huang
Date:
Wed Jan 23 08:01:57 2019 +0000
Revision:
6:d196b612b14a
Remove mbed

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bell_huang 6:d196b612b14a 1 /**
bell_huang 6:d196b612b14a 2 * @file pah_util.h
bell_huang 6:d196b612b14a 3 *
bell_huang 6:d196b612b14a 4 * Copyright (c) 2016-2017 PixArt Imaging Inc.
bell_huang 6:d196b612b14a 5 * All Rights Reserved.
bell_huang 6:d196b612b14a 6 * Confidential and Proprietary - PixArt Imaging Inc.
bell_huang 6:d196b612b14a 7 **/
bell_huang 6:d196b612b14a 8 #ifndef __pah_util_h__
bell_huang 6:d196b612b14a 9 #define __pah_util_h__
bell_huang 6:d196b612b14a 10
bell_huang 6:d196b612b14a 11
bell_huang 6:d196b612b14a 12 #include <stdint.h>
bell_huang 6:d196b612b14a 13
bell_huang 6:d196b612b14a 14
bell_huang 6:d196b612b14a 15 #define PAH_ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
bell_huang 6:d196b612b14a 16
bell_huang 6:d196b612b14a 17 #define PAH_SET_BIT(var,pos) do { ((var) |= (1 << (pos))); } while(0)
bell_huang 6:d196b612b14a 18 #define PAH_CLEAR_BIT(var,pos) do { ((var) &= ~(1 << (pos))); } while(0)
bell_huang 6:d196b612b14a 19 #define PAH_CHECK_BIT(var,pos) (((var) >> (pos)) & 1)
bell_huang 6:d196b612b14a 20
bell_huang 6:d196b612b14a 21 #define PAH_UINT64_HIGH(var) ((uint32_t)(var >> 32))
bell_huang 6:d196b612b14a 22 #define PAH_UINT64_LOW(var) ((uint32_t)(var & UINT32_MAX))
bell_huang 6:d196b612b14a 23
bell_huang 6:d196b612b14a 24
bell_huang 6:d196b612b14a 25 #endif // header guard
bell_huang 6:d196b612b14a 26