Device driver for Microchip ATA8520E transceiver (Sigfox) More...
Device driver for Microchip ATA8520E transceiver (Sigfox)
For more information, please refer to the datasheet http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-9409-Smart-RF-ATA8520E_Datasheet.pdf
Files | |
file | ata8520e_internals.h |
Internal addresses, registers, constants for the ATA8520E device. | |
file | ata8520e_params.h |
Default initialization parameters for the ATA8520E device. | |
file | ata8520e.h |
Device driver for Microchip ATA8520E transceiver (Sigfox) | |
Data Structures | |
struct | ata8520e_params_t |
Initialization parameters. More... | |
struct | ata8520e_t |
device descriptor 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. | |
#define SIGFOX_ID_LENGTH (8U) |
Length of Sigfox ID.
Definition at line 43 of file ata8520e.h.
#define SIGFOX_MAX_TX_LENGTH (12U) |
Maximum length of a TX payload.
Definition at line 44 of file ata8520e.h.
#define SIGFOX_PAC_LENGTH (16U) |
Length of Sigfox PAC.
Definition at line 42 of file ata8520e.h.
#define SIGFOX_RX_LENGTH (8U) |
RX payload length is always 8.
Definition at line 45 of file ata8520e.h.
anonymous enum |
return codes
Definition at line 51 of file ata8520e.h.
anonymous enum |
device internal states
Definition at line 63 of file ata8520e.h.
Sigfox statuses.
See ATA8520E datasheet, section 2.1.2.10, page 12
Definition at line 84 of file ata8520e.h.
Sigfox statuses.
See ATA8520E datasheet, section 2.1.2.10, page 12
Definition at line 100 of file ata8520e.h.
device module status
Enumerator | |
---|---|
ATA8520E_SSM | SoC System Management status. |
ATA8520E_ATMEL | Atmel status. |
ATA8520E_SIGFOX | Sigfox status. |
Definition at line 73 of file ata8520e.h.
int ata8520e_init | ( | ata8520e_t * | dev, |
const ata8520e_params_t * | params | ||
) |
Initialize the device.
This will also initialize the CS pin as a GPIO output, without pull resistors and the interrupt pin handler to manage events.
[out] | dev | Pointer to device descriptor |
[in] | params | Pointer to SPI settings |
void ata8520e_read_atmel_version | ( | const ata8520e_t * | dev, |
uint8_t * | version | ||
) |
Return the Atmel version of the device.
[in] | dev | Pointer to device descriptor |
[out] | version | Pointer to the string containing the version, must be able to hold 2 characters |
void ata8520e_read_id | ( | const ata8520e_t * | dev, |
char * | id | ||
) |
Return the ID of the device.
[in] | dev | Pointer to device descriptor |
[out] | id | String containing the ID, must be able to hold 9 characters |
void ata8520e_read_pac | ( | const ata8520e_t * | dev, |
char * | pac | ||
) |
Return the porting authorization code (PAC) available in the device.
[in] | dev | Pointer to device descriptor |
[out] | pac | String containing the pac, must be able to hold 17 characters |
void ata8520e_read_sigfox_version | ( | const ata8520e_t * | dev, |
char * | version | ||
) |
Return the Atmel version of the device.
[in] | dev | Pointer to device descriptor |
[out] | version | String containing the version, must be able to hold 11 characters |
int ata8520e_send_bit | ( | ata8520e_t * | dev, |
bool | bit | ||
) |
Send a bit.
[in] | dev | Pointer to device descriptor |
[in] | bit | The bit to send |
int ata8520e_send_frame | ( | ata8520e_t * | dev, |
uint8_t * | payload, | ||
uint8_t | payload_len | ||
) |
Send a frame.
[in] | dev | Pointer to device descriptor |
[in] | payload | The payload to send |
[in] | payload_len | The length of the payload to send |
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.
[in] | dev | Pointer to device descriptor |
[in] | payload | The payload to send |
[in] | payload_len | The length of the payload to send |
[out] | rx_payload | The payload received |
void ata8520e_system_reset | ( | const ata8520e_t * | dev | ) |
Perform a complete reset of the device.
[in] | dev | Pointer to device descriptor |