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:
parent
6a94296acc
commit
a4fac54abe
@ -74,6 +74,7 @@ protected:
|
||||
BitState mBitState;
|
||||
uint32_t mChipID;
|
||||
bool mCTSPending = false;
|
||||
uint16_t mPartNumber;
|
||||
};
|
||||
|
||||
#endif /* RFIC_HPP_ */
|
||||
|
@ -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_ */
|
||||
|
@ -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
|
@ -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
|
@ -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
|
||||
|
20
latest/Firmware/Src/si4463.cpp
Normal file
20
latest/Firmware/Src/si4463.cpp
Normal 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;
|
||||
}
|
||||
|
||||
|
17
latest/Firmware/Src/si4467.cpp
Normal file
17
latest/Firmware/Src/si4467.cpp
Normal 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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user