Skip to content

Commit

Permalink
cc26xx_cc13xx: fix CCFG offset on x2 variants
Browse files Browse the repository at this point in the history
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
  • Loading branch information
jeandudey committed Apr 14, 2020
1 parent b9fda56 commit cbcd7d5
Showing 1 changed file with 30 additions and 12 deletions.
42 changes: 30 additions & 12 deletions cpu/cc26xx_cc13xx/include/cc26xx_cc13xx_ccfg.h
Expand Up @@ -22,17 +22,8 @@
extern "C" {
#endif

/** @ingroup cpu_specific_peripheral_memory_map
* @{
*/
#define CCFG_BASE 0x50003000 /**< base address of CCFG memory */
/*@}*/

/* TODO not present in datasheet but explained in cc26x0ware-lds */
#define CCFG_SIZE_AND_DIS_FLAGS_DIS_GPRAM 0x00000004 /**< CCFG_SIZE_AND_DIS_FLAGS_DIS_GPRAM */

/**
* CCFG registers
* @brief CCFG registers
*/
typedef struct {
reg32_t EXT_LF_CLK; /**< extern LF clock config */
Expand All @@ -59,12 +50,39 @@ typedef struct {
reg32_t CCFG_PROT_127_96; /**< protect sectors 96-127 */
} ccfg_regs_t;

#define CCFG ((ccfg_regs_t *) (CCFG_BASE + 0xFA8)) /**< CCFG register bank */
/**
* @brief CCFG register values
* @{
*/
#define CCFG_SIZE_AND_DIS_FLAGS_DIS_GPRAM 0x00000004
/** @} */

/**
* @ingroup cpu_specific_peripheral_memory_map
* @{
*/
/**
* @brief CCFG base address
*/
#define CCFG_BASE (0x50003000)
/** @} */

#ifdef CPU_VARIANT_X0
/**
* @brief CCFG register bank
*/
#define CCFG ((ccfg_regs_t *) (CCFG_BASE + 0xFA8))
#else
/**
* @brief CCFG register bank
*/
#define CCFG ((ccfg_regs_t *) (CCFG_BASE + 0x1FA8))
#endif

#ifdef __cplusplus
} /* end extern "C" */
#endif

#endif /* CC26XX_CC13XX_CCFG_H */

/*@}*/
/** @} */

0 comments on commit cbcd7d5

Please sign in to comment.