2015-09-17 21:11:42 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2014 Loci Controls Inc.
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @addtogroup cpu_cc2538
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief CC2538 SSI interface
|
|
|
|
*
|
|
|
|
* @author Ian Martin <ian@locicontrols.com>
|
2018-08-03 16:05:53 +02:00
|
|
|
* @author Sebastian Meiling <s@mlng.net>
|
2015-09-17 21:11:42 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CC2538_SSI_H
|
|
|
|
#define CC2538_SSI_H
|
|
|
|
|
|
|
|
#include "cc2538.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief SSI component registers
|
|
|
|
*/
|
|
|
|
typedef struct {
|
2018-08-03 16:05:53 +02:00
|
|
|
cc2538_reg_t CR0; /**< SSI Control Register 0 */
|
|
|
|
cc2538_reg_t CR1; /**< SSI Control Register 1 */
|
|
|
|
cc2538_reg_t DR; /**< SSI Data register */
|
|
|
|
cc2538_reg_t SR; /**< SSI FIFO/busy Status Register */
|
|
|
|
cc2538_reg_t CPSR; /**< SSI Clock Register */
|
|
|
|
cc2538_reg_t IM; /**< SSI Interrupt Mask register */
|
|
|
|
cc2538_reg_t RIS; /**< SSI Raw Interrupt Status register */
|
|
|
|
cc2538_reg_t MIS; /**< SSI Masked Interrupt Status register */
|
|
|
|
cc2538_reg_t ICR; /**< SSI Interrupt Clear Register */
|
|
|
|
cc2538_reg_t DMACTL; /**< SSI uDMA Control Register. */
|
|
|
|
cc2538_reg_t CC; /**< SSI clock configuration */
|
2015-09-17 21:11:42 +02:00
|
|
|
} cc2538_ssi_t;
|
|
|
|
|
2016-11-08 18:17:17 +01:00
|
|
|
/**
|
2018-08-03 16:05:53 +02:00
|
|
|
* @brief Set CR0 data size (bits)
|
2016-11-08 18:17:17 +01:00
|
|
|
*/
|
2018-08-03 16:05:53 +02:00
|
|
|
#define SSI_CR0_DSS(x) (x - 1)
|
2016-11-08 18:17:17 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Define CC register bitfields
|
|
|
|
* @{
|
|
|
|
*/
|
2018-08-03 16:05:53 +02:00
|
|
|
#define SSI_CC_CS_SYSDIV (0x0)
|
|
|
|
#define SSI_CC_CS_IODIV (0x1)
|
|
|
|
#define SSI_CC_CS_DSEN (0x4)
|
2016-11-08 18:17:17 +01:00
|
|
|
/** @} */
|
|
|
|
|
2015-09-17 21:11:42 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* end extern "C" */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* CC2538_SSI_H */
|
|
|
|
/** @} */
|