mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
drivers/cc110x: replace binary constants and use unsigned char
binary constants are a GCC extension
This commit is contained in:
parent
110609195f
commit
aa0e5e7afa
@ -20,7 +20,7 @@
|
|||||||
#include "cc110x.h"
|
#include "cc110x.h"
|
||||||
#include "cc110x_internal.h"
|
#include "cc110x_internal.h"
|
||||||
|
|
||||||
const char cc110x_conf[CC110X_CONF_SIZE] = {
|
const uint8_t cc110x_conf[CC110X_CONF_SIZE] = {
|
||||||
/*
|
/*
|
||||||
* IOCFG2; default: 0x29 (CHIP_RDYn)
|
* IOCFG2; default: 0x29 (CHIP_RDYn)
|
||||||
* Invert GDO2: off,
|
* Invert GDO2: off,
|
||||||
@ -327,4 +327,4 @@ const char cc110x_conf[CC110X_CONF_SIZE] = {
|
|||||||
0x00, /*< RCCTRL0 */
|
0x00, /*< RCCTRL0 */
|
||||||
};
|
};
|
||||||
|
|
||||||
const char cc110x_magic_registers[3] = { 0x88, 0x31, 0x09 };
|
const uint8_t cc110x_magic_registers[3] = { 0x88, 0x31, 0x09 };
|
||||||
|
@ -38,7 +38,7 @@ extern "C" {
|
|||||||
/**
|
/**
|
||||||
* @brief Configuration register values for CC1100/CC1101 transceivers
|
* @brief Configuration register values for CC1100/CC1101 transceivers
|
||||||
*/
|
*/
|
||||||
extern const char cc110x_conf[CC110X_CONF_SIZE];
|
extern const uint8_t cc110x_conf[CC110X_CONF_SIZE];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Magic numbers to write to the TEST2, TEST1 and TEST0 configuration
|
* @brief Magic numbers to write to the TEST2, TEST1 and TEST0 configuration
|
||||||
@ -51,7 +51,7 @@ extern const char cc110x_conf[CC110X_CONF_SIZE];
|
|||||||
* transceiver configuration, those numbers should be checked again with the
|
* transceiver configuration, those numbers should be checked again with the
|
||||||
* SmartRF Studio
|
* SmartRF Studio
|
||||||
*/
|
*/
|
||||||
extern const char cc110x_magic_registers[3];
|
extern const uint8_t cc110x_magic_registers[3];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Configuration data that specify the 8 available output power levels
|
* @name Configuration data that specify the 8 available output power levels
|
||||||
|
@ -261,13 +261,13 @@ extern "C" {
|
|||||||
* page 31 in the data sheet for the possible states in the status byte.
|
* page 31 in the data sheet for the possible states in the status byte.
|
||||||
*/
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
CC110X_STATE_IDLE = 0b00000000, /**< IDLE state */
|
CC110X_STATE_IDLE = 0x00, /**< IDLE state */
|
||||||
/**
|
/**
|
||||||
* @brief Frame received, waiting for upper layer to retrieve it
|
* @brief Frame received, waiting for upper layer to retrieve it
|
||||||
*
|
*
|
||||||
* Transceiver is in IDLE state.
|
* Transceiver is in IDLE state.
|
||||||
*/
|
*/
|
||||||
CC110X_STATE_FRAME_READY = 0b00001000,
|
CC110X_STATE_FRAME_READY = 0x08,
|
||||||
/**
|
/**
|
||||||
* @brief Frame received, waiting for upper layer to retrieve it
|
* @brief Frame received, waiting for upper layer to retrieve it
|
||||||
*
|
*
|
||||||
@ -276,26 +276,26 @@ typedef enum {
|
|||||||
* bring it in the IDLE state. Thus, we set the three least significant bits
|
* bring it in the IDLE state. Thus, we set the three least significant bits
|
||||||
* to the IDLE state
|
* to the IDLE state
|
||||||
*/
|
*/
|
||||||
CC110X_STATE_OFF = 0b00010000,
|
CC110X_STATE_OFF = 0x10,
|
||||||
CC110X_STATE_RX_MODE = 0b00000001, /**< Listening for frames */
|
CC110X_STATE_RX_MODE = 0x01, /**< Listening for frames */
|
||||||
/**
|
/**
|
||||||
* @brief Receiving a frame just now
|
* @brief Receiving a frame just now
|
||||||
*
|
*
|
||||||
* Transceiver is in RX state.
|
* Transceiver is in RX state.
|
||||||
*/
|
*/
|
||||||
CC110X_STATE_RECEIVING = 0b00001001,
|
CC110X_STATE_RECEIVING = 0x09,
|
||||||
CC110X_STATE_TX_MODE = 0b00000010, /**< Transmit mode */
|
CC110X_STATE_TX_MODE = 0x02, /**< Transmit mode */
|
||||||
/**
|
/**
|
||||||
* @brief Waiting for transceiver to complete outgoing transmission
|
* @brief Waiting for transceiver to complete outgoing transmission
|
||||||
*
|
*
|
||||||
* Transceiver is in TX state
|
* Transceiver is in TX state
|
||||||
*/
|
*/
|
||||||
CC110X_STATE_TX_COMPLETING = 0b00001010,
|
CC110X_STATE_TX_COMPLETING = 0x0A,
|
||||||
CC110X_STATE_FSTXON = 0b00000011, /**< Fast TX ready */
|
CC110X_STATE_FSTXON = 0x03, /**< Fast TX ready */
|
||||||
CC110X_STATE_CALIBRATE = 0b00000100, /**< Device is calibrating */
|
CC110X_STATE_CALIBRATE = 0x04, /**< Device is calibrating */
|
||||||
CC110X_STATE_SETTLING = 0b00000101, /**< PLL is settling */
|
CC110X_STATE_SETTLING = 0x05, /**< PLL is settling */
|
||||||
CC110X_STATE_RXFIFO_OVERFLOW = 0b00000110, /**< RX FIFO overflown */
|
CC110X_STATE_RXFIFO_OVERFLOW = 0x06, /**< RX FIFO overflown */
|
||||||
CC110X_STATE_TXFIFO_UNDERFLOW = 0b00000111, /**< TX FIFO underflown */
|
CC110X_STATE_TXFIFO_UNDERFLOW = 0x07, /**< TX FIFO underflown */
|
||||||
} cc110x_state_t;
|
} cc110x_state_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user