1
0
mirror of https://github.com/peterantypas/maiana.git synced 2025-05-29 13:50:29 -07:00

Chip-specific config headers

This commit is contained in:
Peter Antypas 2020-12-20 19:07:36 -08:00
parent 6a94296acc
commit a4fac54abe
7 changed files with 70 additions and 7 deletions

View File

@ -74,6 +74,7 @@ protected:
BitState mBitState;
uint32_t mChipID;
bool mCTSPending = false;
uint16_t mPartNumber;
};
#endif /* RFIC_HPP_ */

View File

@ -21,8 +21,15 @@
#ifndef RADIO_CONFIG_STUB_H_
#define RADIO_CONFIG_STUB_H_
#include <stdint.h>
//#include "radio_config_ph_all_channels.h"
#include "radio_config_Si4467.h"
/**
* This allows us to avoid including auto-generated configuration headers for different chips
* which redefine the same symbols and cause conflicts.
*/
uint8_t* get_si4467_config_array();
uint8_t* get_si4463_config_array();
#endif /* RADIO_CONFIG_H_ */

View File

@ -11,8 +11,8 @@
* @n http://www.silabs.com
*/
#ifndef RADIO_CONFIG_H_
#define RADIO_CONFIG_H_
#ifndef _SI4463_RADIO_CONFIG_H_
#define _SI4463_RADIO_CONFIG_H_
// USER DEFINED PARAMETERS
// Define your own parameters here
@ -1047,6 +1047,8 @@
#define RADIO_CONFIGURATION_DATA_ARRAY { 0 }
#endif
#if 0
// DEFAULT VALUES FOR CONFIGURATION PARAMETERS
#define RADIO_CONFIGURATION_DATA_RADIO_XO_FREQ_DEFAULT 30000000L
#define RADIO_CONFIGURATION_DATA_CHANNEL_NUMBER_DEFAULT 0x00
@ -1097,3 +1099,4 @@
}
#endif /* RADIO_CONFIG_H_ */
#endif

View File

@ -11,8 +11,8 @@
* @n http://www.silabs.com
*/
#ifndef RADIO_CONFIG_H_
#define RADIO_CONFIG_H_
#ifndef _SI4467_RADIO_CONFIG_H_
#define _SI4467_RADIO_CONFIG_H_
// USER DEFINED PARAMETERS
// Define your own parameters here

View File

@ -152,7 +152,22 @@ bool RFIC::readSPIResponse(void *data, uint8_t length)
void RFIC::configure()
{
uint8_t radio_configuration[] = RADIO_CONFIGURATION_DATA_ARRAY;
PART_INFO_REPLY reply;
sendCmd(PART_INFO, nullptr, 0, &reply, sizeof reply);
mPartNumber = reply.PartNumberH << 8 | reply.PartNumberL;
uint8_t *radio_configuration = nullptr;
switch(mPartNumber)
{
case 0x4467:
radio_configuration = get_si4467_config_array();
break;
default:
radio_configuration = get_si4463_config_array();
}
//uint8_t radio_configuration[] = RADIO_CONFIGURATION_DATA_ARRAY;
uint8_t *cfg = radio_configuration;
while (*cfg)
{ // configuration array stops with 0

View File

@ -0,0 +1,20 @@
/*
* si4463.cpp
*
* Created on: Dec 20, 2020
* Author: peter
*/
#include <stdint.h>
#include "radio_config_si4463.h"
static uint8_t __si_4463_cfg[] = RADIO_CONFIGURATION_DATA_ARRAY;
uint8_t* get_si4463_config_array()
{
return __si_4463_cfg;
}

View File

@ -0,0 +1,17 @@
/*
* si4467.cpp
*
* Created on: Dec 20, 2020
* Author: peter
*/
#include <stdint.h>
#include "radio_config_si4467.h"
static uint8_t __si_4467_cfg[] = RADIO_CONFIGURATION_DATA_ARRAY;
uint8_t* get_si4467_config_array()
{
return __si_4467_cfg;
}