Loading...
Searching...
No Matches

Device driver for Microchip ATA8520E transceiver (Sigfox) More...

Detailed Description

Device driver for Microchip ATA8520E transceiver (Sigfox)

Author
Alexandre Abadie alexa.nosp@m.ndre.nosp@m..abad.nosp@m.ie@i.nosp@m.nria..nosp@m.fr

Definition in file ata8520e.h.

#include <stdint.h>
#include <inttypes.h>
#include "mutex.h"
#include "periph/gpio.h"
#include "periph/spi.h"
+ Include dependency graph for ata8520e.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ata8520e_params_t
 Initialization parameters. More...
 
struct  ata8520e_t
 device descriptor More...
 

Enumerations

enum  {
  ATA8520E_OK = 0 , ATA8520E_ERR_SPI , ATA8520E_ERR_GPIO_INT , ATA8520E_ERR_GPIO_RESET ,
  ATA8520E_ERR_GPIO_POWER , ATA8520E_ERR_EVENT_TIMEOUT
}
 return codes More...
 
enum  { ATA8520E_STATE_IDLE , ATA8520E_STATE_INIT , ATA8520E_STATE_TX , ATA8520E_STATE_RX }
 device internal states More...
 
enum  ata8520e_status_type_t { ATA8520E_SSM , ATA8520E_ATMEL , ATA8520E_SIGFOX }
 device module status More...
 
enum  ata8520e_atmel_status_t {
  ATA8520E_ATMEL_OK , ATA8520E_ATMEL_COMMAND_ERROR , ATA8520E_ATMEL_GENERIC_ERROR , ATA8520E_ATMEL_FREQUENCY_ERROR ,
  ATA8520E_ATMEL_USAGE_ERROR , ATA8520E_ATMEL_OPENING_ERROR , ATA8520E_ATMEL_CLOSING_ERROR , ATA8520E_ATMEL_SEND_ERROR
}
 Sigfox statuses. More...
 
enum  ata8520e_sigfox_status_t {
  ATA8520E_SIGFOX_OK , ATA8520E_SIGFOX_MANUFACTURER_ERROR , ATA8520E_SIGFOX_ID_OR_KEY_ERROR , ATA8520E_SIGFOX_STATE_MACHINE_ERROR ,
  ATA8520E_SIGFOX_FRAME_SIZE_ERROR , ATA8520E_SIGFOX_MANUFACTURER_SEND_ERROR , ATA8520E_SIGFOX_GET_VOLTAGE_TEMP_ERROR , ATA8520E_SIGFOX_CLOSE_ERROR ,
  ATA8520E_SIGFOX_API_ERROR , ATA8520E_SIGFOX_GET_PN9_ERROR , ATA8520E_SIGFOX_GET_FREQUENCY_ERROR , ATA8520E_SIGFOX_BUILDING_FRAME_ERROR ,
  ATA8520E_SIGFOX_DELAY_ROUTINE_ERROR , ATA8520E_SIGFOX_CALLBACK_ERROR , ATA8520E_SIGFOX_TIMING_ERROR , ATA8520E_SIGFOX_FREQUENCY_ERROR
}
 Sigfox statuses. More...
 

Functions

int ata8520e_init (ata8520e_t *dev, const ata8520e_params_t *params)
 Initialize the device.
 
void ata8520e_system_reset (const ata8520e_t *dev)
 Perform a complete reset of the device.
 
void ata8520e_read_atmel_version (const ata8520e_t *dev, uint8_t *version)
 Return the Atmel version of the device.
 
void ata8520e_read_sigfox_version (const ata8520e_t *dev, char *version)
 Return the Atmel version of the device.
 
void ata8520e_read_pac (const ata8520e_t *dev, char *pac)
 Return the porting authorization code (PAC) available in the device.
 
void ata8520e_read_id (const ata8520e_t *dev, char *id)
 Return the ID of the device.
 
int ata8520e_send_frame (ata8520e_t *dev, uint8_t *payload, uint8_t payload_len)
 Send a frame.
 
int ata8520e_send_receive_frame (ata8520e_t *dev, uint8_t *payload, uint8_t payload_len, uint8_t *rx_payload)
 Send a frame and wait for a RX packet.
 
int ata8520e_send_bit (ata8520e_t *dev, bool bit)
 Send a bit.
 

SIGFOX constants

#define SIGFOX_PAC_LENGTH   (16U)
 Length of Sigfox PAC.
 
#define SIGFOX_ID_LENGTH   (8U)
 Length of Sigfox ID.
 
#define SIGFOX_MAX_TX_LENGTH   (12U)
 Maximum length of a TX payload.
 
#define SIGFOX_RX_LENGTH   (8U)
 RX payload length is always 8.