/*                                              -*- mode:C++; fill-column:100 -*-
  SFBTypes.h - Short names for sized ints, and limits
  Copyright (C) 2008 The Regents of the University of New Mexico.  All rights reserved.

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this library; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
  USA
*/

/**
  \file SFBTypes.h - Short names for sized ints, and limits
  \author David H. Ackley.  
  \date (C) 2008 All rights reserved.
  \lgpl
 */
#ifndef SFBTYPES_H
#define SFBTYPES_H

#include <inttypes.h>

typedef int8_t  s8;                    /* signed */
typedef int16_t s16;
typedef int32_t s32;
typedef int64_t s64;
typedef intptr_t sptr;

typedef const int8_t  sc8;             /* signed const */
typedef const int16_t sc16;
typedef const int32_t sc32;
typedef const int64_t sc64;
typedef const intptr_t scptr;

typedef volatile int8_t  sv8;          /* signed volatile */
typedef volatile int16_t sv16;
typedef volatile int32_t sv32;
typedef volatile int64_t sv64;
typedef volatile intptr_t svptr;

typedef volatile const int8_t  svc8;   /* signed volatile const */
typedef volatile const int16_t svc16;
typedef volatile const int32_t svc32;
typedef volatile const int64_t svc64;
typedef volatile const intptr_t svcptr;

typedef uint8_t  u8;                   /* unsigned */
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
typedef uintptr_t uptr;

typedef const uint8_t  uc8;            /* unsigned const */
typedef const uint16_t uc16;
typedef const uint32_t uc32;
typedef const uint64_t uc64;
typedef const uintptr_t ucptr;

typedef volatile uint8_t  uv8;         /* unsigned volatile */
typedef volatile uint16_t uv16;
typedef volatile uint32_t uv32;
typedef volatile uint64_t uv64;
typedef volatile uintptr_t uvptr;

typedef volatile const uint8_t  uvc8;  /* unsigned volatile const */
typedef volatile const uint16_t uvc16;
typedef volatile const uint32_t uvc32;
typedef volatile const uint64_t uvc64;
typedef volatile const uintptr_t uvcptr;

#define S8_MAX     ((s8)127)           /* signed ranges */
#define S8_MIN     ((s8)-128)
#define S16_MAX    ((s16)32767)
#define S16_MIN    ((s16)-32768)
#define S32_MAX    ((s32)2147483647)
#define S32_MIN    ((s32)2147483648UL)
#define S64_MIN    ((s64)2147483648UL)

#define U8_MAX     ((u8)255)           /* unsigned ranges */
#define U8_MIN     ((u8)0)
#define U16_MAX    ((u16)65535U)
#define U16_MIN    ((u16)0)
#define U32_MAX    ((u32)4294967295UL)
#define U32_MIN    ((u32)0)

typedef void IRQHandler (void);

#endif  /* SFBTYPES_H */
