]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/commitdiff
spi: Rename spi_msg_head to spi_msg
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 28 Aug 2015 18:11:39 +0000 (20:11 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 28 Aug 2015 18:11:39 +0000 (20:11 +0200)
This new name makes more sense.

rpp/include/drv/spi.h
rpp/include/drv/spi_tms570.h
rpp/src/drv/hbridge.c
rpp/src/drv/spi.c
rpp/src/drv/spi_tms570.c

index ba4fb43a22bcc5781fa3351e8d59ad2d3135b011..fdf241e467e588737024bd5cefd1594d10ed27a4 100644 (file)
 #include "drv/spi_tms570.h"
 #include "drv/port.h"
 
-UL_LIST_CUST_DEC(spi_rq_queue, spi_drv_t, spi_msg_head_t, rq_queue, node)
+UL_LIST_CUST_DEC(spi_rq_queue, spi_drv_t, spi_msg_t, rq_queue, node)
 
 int spi_transfer(spi_drv_t *ifc, int addr, int rq_len, const void *tx_buf, void *rx_buf);
-int spi_msg_rq_ins(spi_drv_t *ifc, spi_msg_head_t *msg);
+int spi_msg_rq_ins(spi_drv_t *ifc, spi_msg_t *msg);
 int8_t port_spi_set(const struct port_desc *port, void *values, size_t size);
 
 #endif /* _SPI_DRV_H_ */
index e6281d1330a09978b5425091a860d251fde739bb..6a0c10da998d54be85f2213d8f9cbb2427b7ce70 100644 (file)
@@ -40,7 +40,7 @@ struct spi_drv;
 
 typedef int (spi_ctrl_fnc_t)(struct spi_drv *ifc, int ctrl, void *p);
 
-typedef struct spi_msg_head {
+typedef struct spi_msg {
        uint16_t flags;         // message flags
        uint16_t addr;          // message destination address -- used as index into the "address translation table"*/
 
@@ -51,15 +51,15 @@ typedef struct spi_msg_head {
 
        ul_list_node_t node;
        //struct spi_drv *ifc;
-       int (*callback)(struct spi_drv *ifc, int code, struct spi_msg_head *msg);    // Called when whole transfer is finished
+       int (*callback)(struct spi_drv *ifc, int code, struct spi_msg *msg);    // Called when whole transfer is finished
        long private;       // If set -- msg is processed by HW
-} spi_msg_head_t;
+} spi_msg_t;
 
 typedef struct spi_drv {
        uint16_t flags;         // Flags
        //uint16_t self_addr;
        ul_list_head_t rq_queue;    // Queue containing MSG requests to process
-       spi_msg_head_t *msg_act;    // MSG being actually processed
+       spi_msg_t *msg_act;    // MSG being actually processed
        spi_ctrl_fnc_t *ctrl_fnc;   // Device dependent function responsible for sending data
        //long private;
 } spi_drv_t;
index 7e9158aa51b92452b281add3c0928ff0cfba3333..cc126979c7fce84d8b3460803761a44d81443665 100644 (file)
@@ -68,7 +68,7 @@ static xSemaphoreHandle wdg_sync;
  * @return  always zero
  */
 int drv_hbr_spi_wdg_callback(struct spi_drv *ifc, int code,
-                                                        struct spi_msg_head *msg)
+                                                        struct spi_msg *msg)
 {
        hbr_spi_code = code;
        if (code == SPI_MSG_FINISHED) {
@@ -79,7 +79,7 @@ int drv_hbr_spi_wdg_callback(struct spi_drv *ifc, int code,
 }
 
 // SPI message format definition for watchdog reset command
-spi_msg_head_t hbr_spi_wdg = {
+spi_msg_t hbr_spi_wdg = {
        .flags = 0,
        .addr = 0,
        .rq_len = 2,
index ceca8ac50add34bc463870af64a150fb5ab88564..2539cd8b2d39204a5001d8cbe6fd88ce6cc9c38f 100644 (file)
@@ -14,7 +14,7 @@
 //#include "ul/ul_list.h"
 #include "drv/spi.h"
 
-int spi_msg_rq_ins(spi_drv_t *ifc, spi_msg_head_t *msg)
+int spi_msg_rq_ins(spi_drv_t *ifc, spi_msg_t *msg)
 {
        spi_isr_lock_level_t saveif;
 
@@ -31,7 +31,7 @@ int spi_msg_rq_ins(spi_drv_t *ifc, spi_msg_head_t *msg)
        return 0;
 }
 
-int spi_transfer_callback(struct spi_drv *ifc, int code, struct spi_msg_head *msg)
+int spi_transfer_callback(struct spi_drv *ifc, int code, struct spi_msg *msg)
 {
        if (msg->private)
                msg->private = 0;
@@ -43,7 +43,7 @@ int spi_transfer_callback(struct spi_drv *ifc, int code, struct spi_msg_head *ms
  */
 int spi_transfer(spi_drv_t *ifc, int addr, int rq_len, const void *tx_buf, void *rx_buf)
 {
-       spi_msg_head_t msg;
+       spi_msg_t msg;
 
        msg.flags = 0;
        //msg.ifc = NULL;
index 8a17d5aeb5708855f0140bc11c0d6c17734be0d6..3a97a506f348a349d6f88f78f50e57adc9a4da1f 100644 (file)
@@ -271,7 +271,7 @@ static int spi_tms570_ctrl_fnc(spi_drv_t *ifc, int ctrl, void *p)
 
 void spi_tms570_isr(int spi_ifc, uint32_t flags)
 {
-       spi_msg_head_t *msg;
+       spi_msg_t *msg;
        spi_tms570_iface_t *iface = &spi_ifcs[spi_ifc];
        spi_isr_lock_level_t saveif;
        uint8_t val_to_wr;