C结构体 问题
typedef struct sChannelParams
{
/*!
* Frequency in Hz
*/
uint32_t Frequency;
/*!
* Data rate definition
*/
DrRange_t DrRange;
/*!
* Band index
*/
uint8_t Band;
}ChannelParams_t;
typedef union uDrRange
{
/*!
* Byte-access to the bits
*/
int8_t Value;
/*!
* Structure to store the minimum and the maximum datarate
*/
struct sFields
{
/*!
* Minimum data rate
*
* EU868 - [DR_0, DR_1, DR_2, DR_3, DR_4, DR_5, DR_6, DR_7]
*
* US915 - [DR_0, DR_1, DR_2, DR_3, DR_4]
*/
int8_t Min : 4;
/*!
* Maximum data rate
*
* EU868 - [DR_0, DR_1, DR_2, DR_3, DR_4, DR_5, DR_6, DR_7]
*
* US915 - [DR_0, DR_1, DR_2, DR_3, DR_4]
*/
int8_t Max : 4;
}Fields;
}DrRange_t;
#define LC4 { 867100000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
这里定义了一个结构体类型
但是我强制类型转化就报错了
( ChannelParams_t )LC4
这样我就报错了
说类型转化 不被允许。